SSL/TLS Configuration in Apache
From the Apache cheat sheet ยท Virtual Hosts ยท verified Jul 2026
SSL/TLS Configuration
Configuring HTTPS with SSL certificates
apache
# Redirect HTTP to HTTPS (must be a sibling block - vhosts cannot nest)
<VirtualHost *:80>
ServerName example.com
Redirect permanent / https://example.com/
</VirtualHost>
<VirtualHost *:443>
ServerName example.com
DocumentRoot /var/www/example.com
SSLEngine on
SSLCertificateFile /path/to/cert.pem
SSLCertificateKeyFile /path/to/key.pem
</VirtualHost>๐ Always use HTTPS in production
๐ Let's Encrypt for free SSL certificates
โก Enable HTTP/2 for better performance
๐ HSTS header enforces HTTPS