Chapter: Installing on a server that we cannot configure
« Updating an application | ^ Deploying a Jelix application |
− Table of content
This section explains how to install a Jelix application on a web server you cannot configure, typically a shared hosting server, or a server where you cannot specify the document root.
Moving the content of www/ ¶
So for example, you should install your application "myapp" in a directory "mysite". This directory is directly accessible from a web browser.
In this case, it is better to move the content of the directory myapp/www
to
the root of your site, mysite/
. After that, you have for example:
mysite/
index.php
myapp/
application.init.php
app/
modules/
var/
vendor/
Here in this example, index.php
is the entry point of your application.
You have to modify this PHP file to change the relative paths it contains (if there
are other entry points, you should do it in them too). Same for the
myapp/application.init.php
file. For example, after modifications, the file
index.php
should look like this:
require_once ('myapp/application.init.php');
require_once (JELIX_LIB_CORE_PATH.'request/jClassicRequest.class.php');
$config_file = 'index/config.ini.php';
$jelix = new jCoordinator($config_file);
$jelix->process(new jClassicRequest());
You need also to modify the myapp/application.init.php
file in order to
update the path of each directory given to jApp
. Path should be
relative to the file. See the path of www
:
jApp::initPaths(
__DIR__.'/'
__DIR__.'/../www/',
__DIR__.'/var/',
__DIR__.'/var/log/',
__DIR__.'/var/config/'
);
Moving the content of jelix-www/ ¶
If the application does not already contain a www/jelix directory, you should
create it by copying the directory lib/jelix-www
. You will obtain:
mysite/
index.php
jelix/
myapp/
Note: you can choose another name for the www/jelix
directory. If you do this, you
have to change the jelixWWWPath option in the configuration file of the application
(myapp/var/config/localconfig.ini.php
)
- *WARNING: it highly recommended to not store your own scripts/CSS/whatever in
this directory or in jelix-www.** Else futur update will be difficult, because
other colleague will be confused, and may have difficult to know
what it comes from Jelix, and what it comes from your application. So don't
modify the content of jelix-www or of its copies, and store your own script in
an other directory, for instance,
mysite/js/
.
End ¶
You can then enter the address of your site (http://www.mysite.com for example, or http://localhost/)