Chapter: Installing an application
« Configuring a production server | ^ Deploying a Jelix application | Updating an application » |
− Table of content
This chapter explains how to install an existing application developed with Jelix. We're going to take the TestApp application availabled in the download section of jelix.org. It is an application which contains some examples and some unit tests for Jelix (It is useful for developers who modify jelix).
The explanations are of course valid for any application based on Jelix.
Files installations ¶
Depending of the project, you may have an archive (zip or tar.gz) which contains all files. Or you may have to retrieve files from a source code repository (based an subversion, mercurial, git). The second solution is pretty good, because updates are easiers.
When the archive is decompressed, or source code retrieved from the repository, you get the following directories:
testapp/ application directory install/ script to install the application modules/ modules of the application responses/ common responses for the application plugins/ plugins of the application var/ contain all the files created or that can be modified by Jelix during execution config/ configuration files of the application log/ log files of jelix and of the application www/ root of the site of the application (document root)
You may have too a lib/
and a temp/
directory, provided into the source code. If not, you have to retrieve an archive of Jelix, and to create a temp directory.
All these directories could be in a same mysite/
directory. You then have:
mysite/ lib/ temp/ testapp/
The tree structure of the sources is by default organized in order to install the application on a server on which you can specify the public root directory of the site (document root). This directory is mysite/testapp/www
.
You will of course be able to change the place of these directories but it is not recommended, for security reasons.
You will notice that the files of the application and those of the framework are separated. This way, you can share the lib directory with several applications.
Configuration files renaming ¶
In testapp/var/config
, you have *.dist
files. Rename them by removing this '.dist' suffix. You have certainly some things to modify in this new files, like database configuration in dbprofils.ini.php
etc. We will see how exactly below.
Creating the temporary directory ¶
Create the mysite/temp/testapp
directory. Perhaps your application contains different *.init.php
files, similar to the application.init.php
, but declaring different temporary folders. So create the corresponding folders.
Configuring the server ¶
You have to configure the web server (virtual host, with a document root..), and to configure certainly a SQL database.
Read the corresponding chapter before continuing.
Installing the application ¶
There is three ways to install the application, depending what is providing with your application.
With a wizard ¶
If there is a testapp/www/install.php
script, this is certainly a script, a wizard, to launch with your browser. So open your browser, and go to the url of this script, for instance http://www.mysite.com/install.php
. Follow instructions and that's it. The wizard will probably modify configuration file for you (database access etc), after asking you informations about it. The installation is then done.
It is recommended to remove the install.php
file (save it in a protected folder), so it is not accessible anymore from the web.
With the application installer ¶
If there is a testapp/install/installer.php
script, this is a script to execute in a console. So first fill all needed parameters in dbProfils.ini.php
and in defaultconfig.ini.php
(read the documentation of the application to know what exactly change). Then open a console, go into the testapp/install/
directory, and then type php.exe installer.php
.
With the jelix installer ¶
If there isn't wizard or dedicated installation script, you have to configure dbProfils.ini.php
and in defaultconfig.ini.php
, then, with a console, go into the lib/jelix-scripts/
directory and type php.exe jelix.php --testapp installapp
. Read the chapter about jelix commands to have more informations about this command line.
If the installation system is deactivated into the configuration ¶
In some project, especially on internal projects where the installation process is very specific, a choice has probably be made to deactivate the installation system (disableInstallers=on
). In this case, no need to launch the application installer or the jelix installer. However, you have to install all things needed by the application, "by hand", or by your own scripts of your installation process.