Let's Encrypt certificates expires after 3 months, but everything is done to encourage automatic renewal.
I don't really like the official client install described in the original post, because it automatically modify the Apache configuration... I prefer to use software packaged by my Linux distribution.
Here is how to I do it with "Dehydrated" client, with Apache web server on Debian 9 :
- # apt-get install dehydrated dehydrated-apache2
- Create file "/etc/dehydrated/domains.txt" and put your complete domain name into it.
- # dehydrated -c
Certificates are created and put in /var/lib/dehydrated/certs/your_domain/
To configure Apache :
- # a2enmod ssl
- # a2ensite default-ssl
- Modify /etc/apache2/sites-available/default-ssl.conf :
- SSLCertificateFile /var/lib/dehydrated/certs/your_domain/cert.pem
- SSLCertificateKeyFile /var/lib/dehydrated/certs/your_domain/privkey.pem
- SSLCertificateChainFile /var/lib/dehydrated/certs/your_domain/fullchain.pem
- # systemctl reload apache2
To automate renewal, add a script in /etc/cron.daily/ :
#!/bin/sh
/usr/bin/dehydrated -c
Reloading configuration is already done daily by logrotate, so I don't do it in the renewal script.
To redirect http to https, add "Redirect permanent / https://your_domain/" in the non-https virtualhost.
To activate HSTS, add « Header always set Strict-Transport-Security "max-age=15768000" » in the https configuration.
To test your configuration, you can use this site : https://www.ssllabs.com/ssltest/
To obtain the best grade, you can configure SSL algorithms recommended by the Mozilla wiki ("intermediate" is a good choice on their configuration generator) : https://wiki.mozilla.org/Security/Server_Side_TLS