Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Tree: f8124c31f8
Fetching contributors…

Cannot retrieve contributors at this time

170 lines (120 sloc) 6.35 kB
~~LANG:FR@frman:configurer-server~~
===== PHP configuration =====
* @@V@magic_quotes_gpc@@ and @@V@magic_quotes_runtime@@ must be set to off. If this is not the case, [[plugins/coord|you have to activate the magicquotes plugin]] delivered with Jelix.
* @@V@session_auto_start@@ must be set to @@L@off@@.
* @@V@safe_mode@@ must be set to @@L@off@@. (jelix not tested with @@L@on@@)
It is also recommended to set these values :
* @@V@register_globals = off@@
* @@V@asp_tags = off@@
* @@V@short_open_tag = off@@
The @@f@phpinfo()@@ function can help you to see if this options are set with the right values. You can see also the @@F@php.ini@@ file of your server.
===== Server configuration =====
Note: each time you change the configuration of your web server (like document root, php version etc,), you must delete all files in the temp directory of your applications (like @@F@temp/myapp@@ here), so Jelix will take care about modifications in the new configuration.
==== If you can change the document root ====
If you can specify the document root of the site by modifying the configuration files of the web server or through an administration interface provided by your web hosting, indicate the @@F@myapp/www@@ directory as the root of the site.
For example, with apache, you will indicate in the @@F@httpd.conf@@ file, something like:
<code htaccess>
<VirtualHost *>
ServerName www.mysite.com
DocumentRoot /home/mysite/myapp/www/
</VirtualHost>
<Directory "/home/mysite/myapp/www/">
AllowOverride None
Order allow,deny
Allow from all
</Directory>
</code>
You must also indicate an alias towards the @@F@lib/jelix-www@@ directory, by naming it to "jelix" :
<code htaccess>
<VirtualHost *>
ServerName www.mysite.com
DocumentRoot /home/mysite/myapp/www/
Alias /jelix/ "/home/mysite/lib/jelix-www/"
</VirtualHost>
<Directory "/home/mysite/myapp/www/">
AllowOverride None
Order allow,deny
Allow from all
</Directory>
<Directory "/home/mysite/lib/jelix-www/">
AllowOverride None
Order allow,deny
Allow from all
</Directory>
</code>
Note : you can choose an other name for the alias of @@F@jelix-www@@. If you do this, you have to change the @@V@jelixWWWPath@@ option in the configuration file of the application.
In the file @@F@myapp/var/config/defaultconfig.ini.php@@, you can adjust the @@V@basePath@@ option, by specifying the path to the @@F@index.php@@ file (here : /).
<code ini>
basePath="/"
</code>
This setting is optional since Jelix try to discover the base path. But on complex configuration (for example, you have many entry points in different sub directories), it could not work correctly, so you have to setup this option.
Thus, by typing http://www.mysite.com you reach your site, and http://www.mysite.com/jelix/, the contents of @@F@jelix-www@@, which contains a number of useful Javascript scripts etc.
==== If you can't change the document root ====
In this case, it is better to move the content of the directory @@F@myapp/www@@ to the root of your site, @@F@mysite/@@. After that, you have for example :
mysite/
myapp/
lib/
temp/
index.php
Here in this example, @@F@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 too). Same for the @@F@myapp/application.init.php@@ file. For example, after modifications, the file index.php should look like this :
<code php>
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());
</code>
You need also to modify the @@F@myapp/project.xml@@ file in order to update the path of each directory, so commands of jelix-scripts will work fine (path should be relative to the project.xml path):
<code xml>
<project xmlns="http://jelix.org/ns/project/1.0">
<!-- ... -->
<directories>
<config>./var/config/</config>
<log>./var/log/</log>
<var>./var/</var>
<www>../</www>
<temp>../temp/myapp/</temp>
</directories>
<entrypoints>
<!-- ... -->
</entrypoints>
</project>
</code>
It is finally necessary to move the @@F@lib/jelix-www@@ directory to the root and to rename it in @@F@jelix/@@. You will obtain:
mysite/
myapp/
jelix/
lib/
temp/
index.php
Note: you can choose another name for the @@F@jelix-www@@ directory. If you do this, you have to change the @@V@jelixWWWPath@@ option in the configuration file of the application (@@F@myapp/var/config/defaultconfig.ini.php@@)
Finally, in the file @@F@myapp/application.ini.php@@, you must change the path (second parameter to jApp::initPaths):
<code php>
jApp::initPaths(
$appPath
$appPath.'../',
//$appPath.'var/',
//$appPath.'var/log/',
//$appPath.'var/config/',
//$appPath.'scripts/'
);
</code>
You can then enter the address of your site (http://www.mysite.com for example, or http://localhost/)
==== Configuration for "cools" urls ====
In order to use significants URLS with the urls automatic system of jelix, you have to activate in Apache (in its configuration file or in the @@F@.htaccess@@):
<code htaccess>
Options +Multiviews
</code>
With Apache 2, you have also to do this :
<code htaccess>
AcceptPathInfo on
</code>
To verify if it is ok, create a @@F@test.php@@ on your site, which executes @@f@phpinfo()@@. Then try this url : @@mysite.com/test/foo/bar@@. the phpinfo should be displayed, and in the @@V@$_SERVER[’PATH_INFO’]@@ variable (at the bottom of the page), you should see "/foo/bar".
===== Directories permissions =====
You have to set write permission to the apache user at least on the @@F@myapp/var/log/@@ directory and on each sub-directories of the @@F@temp/@@ directory.
Example, on a debian/ubuntu server:
<code bash>
sudo chown www-data:www-data temp/myapp* myapp/var/log
sudo chmod g+w temp/myapp* myapp/var/log
</code>
For some applications, perhaps you may have to set this permissions on other folders in @@F@myapp/var/@@. Read the installation manual of the application.
Jump to Line
Something went wrong with that request. Please try again.