Skip to content

Instantly share code, notes, and snippets.

@rrmhearts
Created June 15, 2020 19:17
Show Gist options
  • Save rrmhearts/aac45194b64109e03b20582f42c2efe8 to your computer and use it in GitHub Desktop.
Save rrmhearts/aac45194b64109e03b20582f42c2efe8 to your computer and use it in GitHub Desktop.
Renew lighttpd server certs using letsencrypt
#!/bin/bash
sudo /usr/local/bin/certbot-auto renew
sudo cp /etc/letsencrypt/live/domain.com/* /etc/lighttpd/certs/
cd /etc/lighttpd/certs
sudo cat privkey.pem cert.pem | sudo tee merged.pem
sudo systemctl restart lighttpd.service
## Renew every two months
# crontab -e
# 0 0 1 */2 * ~/cert-renew.sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment