HTTPS gratuito con Let's Encrypt su Apache
Come ottenere e configurare un certificato SSL gratuito con rinnovo automatico.
1. Installazione Certbot
apt install -y certbot python3-certbot-apache
2. Ottenere il certificato
certbot --apache -d miosito.it -d www.miosito.it
Certbot configura automaticamente Apache per HTTPS e redirect da HTTP.
3. Verifica rinnovo automatico
certbot renew --dry-run
Il timer systemd rinnova automaticamente. Verifica:
systemctl list-timers | grep certbot
4. Hardening SSL
Aggiungi a /etc/apache2/conf-available/ssl-hardening.conf:
SSLProtocol all -SSLv3 -TLSv1 -TLSv1.1
SSLCipherSuite ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256
SSLHonorCipherOrder off
SSLSessionTickets off
Header always set Strict-Transport-Security "max-age=31536000; includeSubDomains"
a2enconf ssl-hardening
a2enmod headers
systemctl reload apache2
5. Test
Vai su SSL Labs e testa il tuo dominio. Dovresti ottenere un rating A+.
Risultato: Sito protetto con HTTPS, certificato gratuito e rinnovo automatico ogni 90 giorni.