Support

Installation of a certificate on the Lighttpd web server

You will receive your certificate by e-mail, which will be a file named:

www.domain.ext.crt

Depending on the CA you choose, you might need to download the CA certificate as well, what is needed is the intermediate certificate (without this, browsers will complain that they cannot trust the CA).

At this point you have all the needed files, but a couple of actions still need to be performed. If you entered a password when creating the private key with OpenSSl, you'll now most likely want to remove it, otherwise Lighttpd will always prompt you for it when starting (which is not so handy):

cp www.mydomain.ext.key www.mydomain.ext.key.orig
openssl rsa -in www.mydomain.ext.key.orig -out www.mydomain.ext.key

Also, Lighttpd wants a single pem file, so you need to concatenate the key file and the certificate file as follows:

cat www.domain.ext.key www.domain.ext.crt > www.domain.ext.pem

For the sake of security you'd better make all these files readable only by root user:

chmod 600 *.pem *.key *.csr *.crt

The final step is the configuration of the web server. Open lighttpd.conf and add something similar to the following (this binds to a specific IP address):

var.confdir  = "/etc/lighttpd"
$SERVER["socket"] == "15.15.15.15:443" {
    ssl.engine    = "enable"
    ssl.pemfile   = var.confdir + "/www.domain.com.pem"
    ssl.ca-file   = var.confdir + "/gd_intermediate.crt"
    server.name   = var.confdir + "/www.domain.com"
    server.document-root = "/my/document/root/"
}

Make sure that the var.confdir (/etc/lighttpd) matches the location where you saved your certificate files. Also change the IP address (15.15.15.15) to match your IP address.

You should be all set and ready to go now!