Leafiny Documentation
Installation
This section describes Leafiny installation on Linux / MacOs environment with Apache 2. Leafiny also work on Windows with Wamp or equivalent.
Create web directory
On server, create web directory, ex: /var/www/leafiny
or /Library/WebServer/Documents/leafiny
on Mac OS.
Extract sources
Downloads last stable release file that contains the Leafiny software on Github. Extract it in your new website root directory.
Create new Virtual Host
Create the Virtual Host file (ex: leafiny.conf
) with example content bellow:
<VirtualHost *:80>
ServerAdmin admin@localhost
DocumentRoot /var/www/leafiny/pub
ServerName www.example.com
SetEnv DEVELOPER_MODE 0
SetEnv ENVIRONMENT prod
SetEnv LANGUAGE en_US
<Directory /var/www/leafiny/pub>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
# Apache >= 2.4
Require all granted
# Apache < 2.4 (deprectated from 2.4)
# Order deny, allow
# Allow from all
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.example.log
CustomLog ${APACHE_LOG_DIR}/access.example.log combined
</VirtualHost>
Update port with 443 for secure connection.
The Leafiny app is served from pub (recommanded). Setting the webroot to the pub directory in production prevents site visitors from accessing sensitive areas of the Leafiny file system from a browser.
Next, update variables for the current environment.
Note: Environment variables may be set or override in .htaccess
DEVELOPER_MODE
SetEnv DEVELOPER_MODE [0|1]
- In developer mode all errors are displayed.
ENVIRONMENT
SetEnv ENVIRONMENT [dev|preprod|prod]
- Environment variable is used to load local config file in etc directory (config.X.php).
default is used if no ENVIRONMENT variable has been defined. You can set your own value for a specific environment (e.g. "staging").
LANGUAGE
SetEnv LANGUAGE [en_US|fr_FR|de_DE|...]
- This variable is for multi-language websites. You create a host per language (en.website.com, fr.webiste.com…).
Finally, enabled vhost if needed and restart Apache.
Deploy resources
Deploy all static modules resources (js, css, images…) in pub directory. This is optionnal if you don't use pub as docroot.
In Leafiny website root directory, use command below:
php deploy.php
Module directory names are encoded with unique salt (stored in var/crypt directory). 2 Leafiny sites never have the same folder names.
Create MySQL database
Create new MySQL database with UTF8 character set syntax:
CREATE SCHEMA `leafiny` CHARACTER SET utf8 COLLATE utf8_general_ci;