How to Secure Apache with Let's Encrypt SSL
Add a free, auto-renewing SSL certificate to your Apache site using Certbot and Let’s Encrypt.
1. Install Certbot
sudo apt update
sudo apt install -y certbot python3-certbot-apache2. Obtain and install the certificate
sudo certbot --apache -d example.com -d www.example.comCertbot edits your virtual host to enable HTTPS and can redirect all HTTP traffic to HTTPS automatically.
3. Test automatic renewal
sudo certbot renew --dry-runCertificates renew automatically via a systemd timer. Verify HTTPS by visiting https://example.com.