Outils pour utilisateurs

Outils du site


technique:linux:lighttpd

Configuration de Lighttpd (Lighty) pour Drupal

Installation

Il faut installer les paquetages ainsi que le petit fichier magique pour Drupal

aptitude install lighttpd-mod-magnet php5-cgi php5-cli php5-mysql mysql-server php5-gd phpmyadmin
cd /etc/lighttpd
wget http://pixel.global-banlist.de/drupal.lua

Configuration de PHP

Changer le chemin binaire php et augmenter la limite de mémoire php dans le fichier /etc/php5/cgi/php.ini

cgi.fix_pathinfo = 1
memory_limit = 32M

Configuration de lighttpd

Dans /etc/lighttpd/lighttpd.conf, ajouter

$HTTP["url"] =~ "^/drupal" {
# we only need index.php here.
index-file.names = ( "index.php" )
# for clean urls
magnet.attract-physical-path-to = ( "/etc/lighttpd/drupal.lua" )
}

Activer les modules nécessaires et relancer

lighty-enable-mod fastcgi
lighty-enable-mod magnet
/etc/init.d/lighttpd force-reload

Contrôle de bon fonctionnement

Then visit http://localhost/phpmyadmin to verify that your php works.

There you go, fly light! ;)

Alternative: Setting up your work dir (for a development environment ) $ sudo vim /etc/lighttpd/lighttpd.conf ..change.. server.document-root = “/var/www/” ..to.. server.document-root = “/homewww/” restart the server: $ sudo /etc/init.d/lighttpd force-reload Some more info about clean urls and lua mod_magnet depends on lua5.1+ For history, see reference: http://pixel.global-banlist.de./2006/10/6/dr-magneto-vs-mr-404-handler If your drupal directory is named something other than drupal-5.1 eg. HEAD you will need to edit the drupal.lua file and lighttpd.conf: In lighttpd.conf you change $HTTP[“url”] =~ “^/drupal-6.1” to $HTTP[“url”] =~ “^/HEAD” and in drupal.lua you need to change the local prefix to: local prefix = '/HEAD' We currently do not support multiple installations for clean url's. But we hope to have this fixed in the near future. Memory limit Keep in mind the '500 error' you will get when your memory limit is set too low. 16MB is default (or at least used to be), but will be too small when enabling modules like CCK and Views. Set the memory_limit to 32MB under /etc/php5/cgi/php.ini (for ubuntu). Also, the php.ini located under cgi is the php settings for fastcgi and are different from the regular php.ini file you may locate on you server. CGI and FastCGI uses the same php-binary.

technique/linux/lighttpd.txt · Dernière modification : 2020/04/06 15:38 de 127.0.0.1