Skip to main content

SSL with Lighttpd

Posted in

Use SSL encryption on your Lighttpd webserver.

Lighttpd installation
Lighttpd needs to be configured and compiled with SSL enabled:

./configure --with-openssl
make
make install

After lighty has been installed, you can confirm that it has been compiled with ssl enabled:
lighttpd -v

SSL Configuration

mkdir /root/lighttpdssl
openssl req -new -x509 -keyout lighttpd.pem -out lighttpd.pem -days 365 -nodes
chown nobody:nobody lighttpd.pem
chmod 600 lighttpd.pem

Edit /service/lighttpd/root/lighttpd.conf and add:
$SERVER["socket"] == ":443" {
ssl.engine = "enable"
ssl.pemfile = "/root/lighttpdssl/lighttpd.pem"
}

Also, enable mod_redirect in your lighttpd.conf:
server.modules = (
"mod_redirect",
)