Secure your Apache server with SSL/TLS.
Apache remains one of the most used web servers. Its SSL configuration is flexible but can be complex with many options.
An optimal configuration combines security and compatibility. Too strict, you block old clients. Too permissive, you're vulnerable.
This guide gives you a modern, balanced configuration to achieve an A+ on SSL Labs.
Necessary components:
Why optimize your configuration:
SSL setup on Apache:
Modern HTTPS VirtualHost:
<VirtualHost *:443>
ServerName example.com
DocumentRoot /var/www/html
SSLEngine on
SSLCertificateFile /etc/letsencrypt/live/example.com/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/example.com/privkey.pem
# Modern protocols
SSLProtocol all -SSLv3 -TLSv1 -TLSv1.1
SSLCipherSuite ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384
SSLHonorCipherOrder off
# HSTS
Header always set Strict-Transport-Security "max-age=63072000"
# OCSP Stapling
SSLUseStapling on
SSLStaplingCache shmcb:/var/run/apache2/stapling_cache(128000)
</VirtualHost>
# HTTP to HTTPS redirect
<VirtualHost *:80>
ServerName example.com
Redirect permanent / https://example.com/
</VirtualHost>
This configuration disables old protocols and enables HSTS + OCSP stapling.
Optimize your Apache configuration:
apachectl -M | grep ssl or a2query -m ssl.
Check the certificate path and permissions.
Use fullchain.pem which includes your cert + intermediates.
Redirect permanent in VirtualHost :80 or HSTS.
Use apachectl configtest to see the error.
Replace files and do systemctl reload (not restart).
A modern Apache SSL configuration protects your users and improves your SEO ranking.
Monitor your certificate expiration with MoniTao to avoid interruptions.
Start free, no credit card required.