HTTP over SSL → HTTPS
De simpelste weg is via de website van Let’s Encrypt.
Ga naar https://letsencrypt.org/getting-started/ Hier staat wat te doen als je wel of niet root access hebt. In dit voorbeeld neem ik aan dat je dat wel hebt. Klik op Visit Certbot Site (https://certbot.eff.org/).
Geef aan My Website runs Apache on openSUSE Leap
Scroll iets naar onderen en daar zie je twee tabs. Kies de default
Vervolgens gewoon doen wat er staat (veel zal al gedaan zijn). We laten Cert Bot al het werk doen. Het gaat er voor citroends.famtenhoopen.nl (die al helemaal lekker werkt over http) zo uitzien:
$ certbot --apache Saving debug log to /var/log/letsencrypt/letsencrypt.log Plugins selected: Authenticator apache, Installer apache Which names would you like to activate HTTPS for? - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1: famtenhoopen.nl 2: citroends.famtenhoopen.nl 3: cloud.famtenhoopen.nl 4: eagle360.famtenhoopen.nl 5: www.famtenhoopen.nl - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Select the appropriate numbers separated by commas and/or spaces, or leave input blank to select all options shown (Enter 'c' to cancel): 2 Obtaining a new certificate Performing the following challenges: http-01 challenge for citroends.famtenhoopen.nl Waiting for verification... Cleaning up challenges Created an SSL vhost at /etc/apache2/vhosts.d/ip-based_vhosts-le-ssl.conf Deploying Certificate to VirtualHost /etc/apache2/vhosts.d/ip-based_vhosts-le-ssl.conf Please choose whether or not to redirect HTTP traffic to HTTPS, removing HTTP access. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1: No redirect - Make no further changes to the webserver configuration. 2: Redirect - Make all requests redirect to secure HTTPS access. Choose this for new sites, or if you're confident your site works on HTTPS. You can undo this change by editing your web server's configuration. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Select the appropriate number [1-2] then [enter] (press 'c' to cancel): 2 Redirecting vhost in /etc/apache2/vhosts.d/ip-based_vhosts.conf to ssl vhost in /etc/apache2/vhosts.d/ip-based_vhosts-le-ssl.conf - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Congratulations! You have successfully enabled https://citroends.famtenhoopen.nl You should test your configuration at: https://www.ssllabs.com/ssltest/analyze.html?d=citroends.famtenhoopen.nl - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - IMPORTANT NOTES: - Congratulations! Your certificate and chain have been saved at: /etc/letsencrypt/live/citroends.famtenhoopen.nl/fullchain.pem Your key file has been saved at: /etc/letsencrypt/live/citroends.famtenhoopen.nl/privkey.pem Your cert will expire on 2020-02-15. To obtain a new or tweaked version of this certificate in the future, simply run certbot again with the "certonly" option. To non-interactively renew *all* of your certificates, run "certbot renew" - If you like Certbot, please consider supporting our work by: Donating to ISRG / Let's Encrypt: https://letsencrypt.org/donate Donating to EFF: https://eff.org/donate-le $
in /etc/apache2/vhosts.d/ip-based_vhosts-le-ssl.conf zit de configuratie voor ssl, prima niet aankomen!
in /etc/apache2/vhosts.d/ip-based_vhosts.conf zat al de configuratie voor http en er zijn nu Rewrite statements opgenomen , prima niet aankomen!
Nu nog herstarten
systemctl restart apache2
Automatische Update van de certificaten
De certificaten zijn 3 maanden geldig. Bij de renewal is een renewal window van 30 dagen, als je daarin valt wordt er ge-renewed. In alle andere gevallen wordt er niets gedaan.
Doe het dus (net iets) vaker dan 1 maal per 3 maanden. Gebruik bijvoorbeeld volgende regel in de crontab van root:
3 4 17 * * /bin/certbot renew
Dit commando vernieuwd om 3 over 4 op de 17de van de maand alle certificaten van alle websites op je server.
Klaar!