First generate a key:
openssl genrsa -des3 -out testing.key 2048
You can leave the password blank if this isn't going to be used for a publicly accessible web server. (ie localhost only)
Then generate a certificate signing request:
openssl req -new -key testing.key -out testing.csr
Then generate a certificate:
openssl x509 -req -days 365 -in testing.csr -signkey testing.key -out testing.crt
At this point you should have 3 files: testing.key
,testing.csr
, and testing.crt
To create a .pem file that lighttpd can use, concatenate your key and certificate:
cat testing.key testing.crt > certificate.pem
You can save the certificate in /etc/lighttpd/ssl or some such directory.