On a Linux system running Lighttpd, how can I automate certificate renewal for Let’s Encrypt certs. Let’s Encrypt provides great scripts for Apache 2 and NGINX but not Lighttpd which is much more comfortable for small systems like Raspberry Pi or old boxes.
Danny Tuppeny provides a great start with a simple script you can run on his blog posting Installing Lighttpd, PHP 7 and LetsEncrypt on a Raspberry Pi (Raspbian Jessie Lite)
# Renew cert
# updated for name change [mscalora]
letsencrypt-auto renew
# Rebuild the cert
pushd /etc/letsencrypt/live/<your-domain-here>/
cat privkey.pem cert.pem > combined.pem
popd
# Reload
/etc/init.d/lighttpd force-reload
A more generalized version based on the latest Let’s Encrypt script package can be found in my Gist: letsencrypt-update-lighttpd. This script will handle multiple domains with certificates.
Danny Tuppeny's blog post has info about the original setup too.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With