Script based on this : https://gist.github.com/xorus/27d5fb2bdba94e80425c
Putting this script in my crontab should renew automatically my domain names certificates.
Note : I installed letsencrypt to /opt/letsencrypt
I am using a nginx webserver and I didn't want downtime for certificate renewal.
This is a raw summary of what I did to renew my domains.
File : /etc/letsencrypt/cli.ini
authenticator = webroot
webroot-path = /var/www/html/
renew-by-default
agree-tos
email = [email protected]You can specify any path, it does not nececarly needs to be in any webroot.
Now I needed to redirect the letsencrypt challenge verification to the webroot-path.
I created a nginx config file intended to be included in all my server entries :
/etc/nginx/conf.d/global/letsencrypt.conf
location /.well-known/acme-challenge {
alias /var/www/html/.well-known/acme-challenge;
auth_basic off; # I needed this to basic auth I had set on one of my hosts
}I then included it in my virtual hosts, simply by adding include /etc/nginx/conf.d/global/letsencrypt.conf; into them.
Everything is setup, let's encrypt again! ;)
/opt/letsencrypt/letsencrypt-auto --config /etc/letsencrypt/cli.ini -d example.org -d another-domain.org certonly && service nginx reload
Add any domains you want to renew like this : -d domain.com
I guess you can use the same method to register new domains