Here’s a standard template for SSL Apache found in /etc/apache2/sites-available/default-ssl.conf.
<IfModule mod_ssl.c> <VirtualHost _default_:443> ServerAdmin your-email@your-domain.com ServerName www.yourdomain.com ServerName yourdomain.com DocumentRoot /var/www/your-domain.com ErrorLog /var/www/your-domain.com/log/error.log CustomLog /var/www/your-domain.com/log/access.log combined <Directory /var/www/your-domain.com> Options Indexes FollowSymLinks MultiViews AllowOverride All Require all granted </Directory> SSLCertificateFile /etc/letsencrypt/live/your-domain.com/fullchain.pem SSLCertificateKeyFile /etc/letsencrypt/live/your-domain.com/privkey.pem Include /etc/letsencrypt/options-ssl-apache.conf </VirtualHost> </IfModule> |
Enable SSL.
# Enable SSL Module a2enmod ssl systemctl restart apache2.service # Enable SSL Apache Config a2ensite default-ssl systemctl restart apache2.service # Alternate way to restart. service apache2 restart |