bash
apt install lighttpd
apt-get install php-cgi
lighttpd-enable-mod fastcgi fastcgi-php
service lighttpd force-reload
lighttpd配置https
sudo nano /etc/lighttpd/lighttpd.conf
加入:
server.modules += ("mod_openssl")
$SERVER["socket"] == "0.0.0.0:443" {
ssl.engine = "enable"
ssl.privkey= "/home/ubuntu/ssl/key.pem"
ssl.pemfile= "/home/ubuntu/ssl/fullchain.pem"
ssl.openssl.ssl-conf-cmd = ("MinProtocol" => "TLSv1.2") # (recommended to accept only TLSv1.2 and TLSv1.3)
#ssl.ca-file= "/etc/lighttpd/certs/www.example.com/chain.pem" # (needed in $SERVER["socket"] before lighttpd 1.4.56 if ssl.pemfile in $HTTP["ho>
}
ssl.privkey私钥
ssl.pemfile公钥
重启lighttpd
为了重定向所有网络主机到它们的HTTPS安全访问方式,用以下内容取代之前的socket 80端口配置:
server.modules += ( "mod_redirect" )
$SERVER["socket"] == ":80" {
$HTTP["host"] =~ ".*" {
url.redirect = (".*" => "https://%0$0")
}
}