Enabling SSL for Apache2 on Ubuntu

Edit /etc/apache2/apache2.conf – add:

LoadModule      ssl_module /usr/lib/apache2/modules/mod_ssl.so

Generate SSL certificates:


Add SSL config and 443 port to a new Virtual Host in apache2.conf – for example:

<VirtualHost *:443>
ServerAdmin your_admin@email.com
DocumentRoot /var/www/your_doc_root
SSLEngine on
SSLOptions +StrictRequire
SSLCertificateFile path/to/server.crt
SSLCertificateKeyFile path/to/server.key
ServerName your.server.name
DirectoryIndex index.php

Add a listen port on 443 to /etc/apache2/ports.conf:

NameVirtualHost *:443

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.