Code : Tout sélectionner
apt install lighttpd
Code : Tout sélectionner
apt install -y curl wget gnupg2 ca-certificates lsb-release apt-transport-https
wget -O /etc/apt/trusted.gpg.d/php.gpg
Code : Tout sélectionner
echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" | sudo tee /etc/apt/sources.list.d/php.list
wget https://packages.sury.org/php/apt.gpg
sudo apt-key add apt.gpg
echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" | sudo tee /etc/apt/sources.list.d/php7.list
apt update
Code : Tout sélectionner
apt install php7.4
Code : Tout sélectionner
php -v
Code : Tout sélectionner
apt install -y php7.4-{common,mysql,xml,xmlrpc,curl,gd,imagick,cli,dev,imap,mbstring,opcache,soap,zip,intl,bcmath} php7.4-cgi php7.4-fpm
Le fichier php.ini se trouve sous :
Code : Tout sélectionner
nano /etc/php/7.4/fpm/php.ini
Configurer le serveur Lighttp :
Code : Tout sélectionner
nano /etc/lighttpd/lighttpd.conf
Code : Tout sélectionner
server.modules = ( "mod_indexfile",
"mod_auth",
"mod_setenv",
"mod_access",
"mod_accesslog",
"mod_alias",
"mod_redirect",
"mod_openssl",
"mod_proxy",
"mod_fastcgi",
)
server.tag = ""
server.document-root = "/var/www"
server.upload-dirs = ( "/var/cache/lighttpd/uploads" )
server.errorlog = "/var/log/lighttpd/error.log"
server.pid-file = "/var/run/lighttpd.pid"
server.username = "www-data"
server.groupname = "www-data"
server.port = 80
# strict parsing and normalization of URL for consistency and security
# https://redmine.lighttpd.net/projects/lighttpd/wiki/Server_http-parseoptsDetails
# (might need to explicitly set "url-path-2f-decode" = "disable"
# if a specific application is encoding URLs inside url-path)
server.http-parseopts = (
"header-strict" => "enable",# default
"host-strict" => "enable",# default
"host-normalize" => "enable",# default
"url-normalize-unreserved"=> "enable",# recommended highly
"url-normalize-required" => "enable",# recommended
"url-ctrls-reject" => "enable",# recommended
"url-path-2f-decode" => "enable",# recommended highly (unless breaks app)
#"url-path-2f-reject" => "enable",
"url-path-dotseg-remove" => "enable",# recommended highly (unless breaks app)
#"url-path-dotseg-reject" => "enable",
#"url-query-20-plus" => "enable",# consistency in query string
)
## Start an FastCGI server for php
fastcgi.server += ( ".php" =>
((
"socket" => "/var/run/php/php7.4-fpm.sock",
"broken-scriptfilename" => "enable"
))
)
index-file.names = ( "index.html", "index.htm", "index.php" )
url.access-deny = ( "~", ".inc" )
static-file.exclude-extensions = ( ".php", ".pl", ".fcgi" )
compress.cache-dir = "/var/cache/lighttpd/compress/"
compress.filetype = ( "application/javascript", "text/css", "text/html", "text/plain" )
## Directory listings
dir-listing.encoding = "utf-8"
server.dir-listing = "disable"
# Deny access to version control system directories.
$HTTP["url"] =~ "/\.svn|/\.git" {
url.access-deny = ( "" )
}
# Deny access to apache configuration files.
$HTTP["url"] =~ "/\.htaccess|/\.htpasswd|/\.htgroups" {
url.access-deny = ( "" )
}
# default listening port for IPv6 falls back to the IPv4 port
include_shell "/usr/share/lighttpd/use-ipv6.pl " + server.port
include_shell "/usr/share/lighttpd/create-mime.conf.pl"
include "/etc/lighttpd/conf-enabled/*.conf"
#server.compat-module-load = "disable"
server.modules += (
"mod_compress",
"mod_dirlisting",
"mod_staticfile",
)
Ajouter Javascript et PHP
On reboot pour les upgrades, le hostname et le hosts :
Code : Tout sélectionner
reboot