Installing SSL Certificate on Apache 2.4.9

Question:

My SSL Certificate is already active. How do I install it?

Answer:

1. Connect to your host ;
2. Turn on SSL mod:
sudo a2enmod ssl
3. Check your config path
 apachectl -S
4. Open your config, e.g. in Ubuntu path would be:
/etc/apache2/sites-enabled/000-default.conf:1
5. To set up a virtual host for HTTPS (port 443) include the following into your configuration.
Don't forget to include files to correct folders.
Save configuration.
<VirtualHost *:443>
ServerName example.com (replace with your domain)
DocumentRoot /var/www/
SSLEngine on
SSLCertificateFile /etc/ssl/certs/ssl-cert-snakeoil.pem
SSLCertificateKeyFile /etc/ssl/private/ssl-cert-snakeoil.key
SSLCertificateChainFile /etc/ssl/certs/hosted_fun.ca-bundle
</VirtualHost>
5. Here's an explanation of directives
SSLCertificateFile /etc/ssl/certs/ssl-cert-snakeoil.pem - this is a pem certificate for site itself
SSLCertificateKeyFile /etc/ssl/private/ssl-cert-snakeoil.key - your private key
SSLCertificateChainFile /etc/ssl/certs/hosted_fun.ca-bundle - bundle from downloaded archive (obsolete since 2.4.8, you can comment it by adding "#" before SSLCertificateChainFile or leave it but it won't affect configuration)
6. Check config syntax after you've changed configuration:
apachectl -t

7. Restart Apache service:

sudo service apache2 reload

Changes will affect immediately.

Was this article helpful?
0 out of 0 found this helpful
Additional questions? Submit a request