LLEMP
root@debian:# apt install lighttpd
root@debian:# apt install php-fpm
root@debian:# apt install mariadb-server
root@debian:# mkdir /etc/lighttpd/vhosts.d
root@debian:# nano /etc/lighttpd/lighttpd.conf
Ajouter dans le fichier
# Source vhosts directory include "/etc/lighttpd/vhosts.d/*.conf"
Création d'un fichier pour notre vhosts
# Create vhosts file root@debian:/etc/lighttpd/vhosts.d# nano projet.oowy.lan.conf
Ajouter le contenu suivant
$HTTP["host"] == "projet.oowy.lan" { server.document-root = "/srv/htdocs/projet.oowy.lan/" # Document-root of the webserver accesslog.filename = "/var/log/lighttpd/projet.oowy.lan_access.log" # Web server Access log file server.errorlog = "/var/log/lighttpd/projet.oowy.lan_error.log" # Web server Error log file }
Activer cgi
# nano /etc/php/7.3/fpm/php.ini ... ; cgi.fix_pathinfo provides *real* PATH_INFO/PATH_TRANSLATED support for CGI. PHP's ; previous behaviour was to set PATH_TRANSLATED to SCRIPT_FILENAME, and to not grok ; what PATH_INFO is. For more information on PATH_INFO, see the cgi specs. Setting ; this to 1 will cause PHP CGI to fix its paths to conform to the spec. A setting ; of zero causes PHP to behave as before. Default is 1. You should fix your scripts ; to use SCRIPT_FILENAME rather than PATH_TRANSLATED. ; http://php.net/cgi.fix-pathinfo cgi.fix_pathinfo=1
Redémarrer php-fpm
# systemctl restart php7.3-fpm
============== Config PHP
# cd /etc/lighttpd/conf-available/ # cp 15-fastcgi-php.conf 15-fastcgi-php.conf.bak
Remplacer
"socket" => "/var/run/lighttpd/php.socket",
Par
"socket" => "/var/run/php/php7.3-fpm.sock",
# -*- depends: fastcgi -*- # /usr/share/doc/lighttpd/fastcgi.txt.gz # http://redmine.lighttpd.net/projects/lighttpd/wiki/Docs:ConfigurationOptions#mod_fastcgi-fastcgi fastcgi.server += ( ".php" => (( "socket" => "/var/run/php/php7.3-fpm.sock", "broken-scriptfilename" => "enable" )) )
# lighttpd-enable-mod fastcgi Enabling fastcgi: ok Run "service lighttpd force-reload" to enable changes
# lighttpd-enable-mod fastcgi-php Enabling fastcgi-php: ok Run "service lighttpd force-reload" to enable changes
# systemctl restart lighttpd.service