CMS
Now Reading
How To Install an SSL Certificate on Ubuntu with Apache
0

How To Install an SSL Certificate on Ubuntu with Apache

by Adrian RandallMay 30, 2015

Lately, I’ve had to install an SSL Certificate quite a number of times and every time I do it I always have to look up a tutorial to ensure I don’t miss anything. And, everytime I read one something is missed so this should be a step by step how to guid for installing an SSL certificate that you’ll just have to copy and paste.

Let’s do it

1. I’m assuming you already have your SSL Certificate and Intermediate Certificate…and you have a web server running Ubuntu and Apache. I like NGINX better personally but for WordPress, Silverstripe and Magento which we deal with a lot, Apache is so much easier. I’m also assuming you have the site running through HTTP currently and just need to add an SSL to swap to HTTPS

2. Change to the Apache SSL Certificate directory:

cd /etc/apache2/ssl

OR

If it doesn’t exist then create it:

sudo mkdir /etc/apache2/ssl

3. You need three files:

– The public key provided by the Certificate Authority
– The Private key from your server which you created and submitted to the Certificate Authority
– The Intermediate or Chain Certificate provided from your Certificate Authority

Move them all to the /etc/apache2/ssl directory and name them appropriately

– your_domain_public.crt // The Public Key provided from the Certificate Autority
– your_domain_private.key // The key you created initially (probably using OpenSSL and submitted to the Certificate Authority)
– your_domain_intermediate.crt

4. Modify your virtual hosts file and add the config to listen on port 443:

<VirtualHost *:443>

ServerName your_domain.com
DocumentRoot /var/www/html/path_to_your_site
SSLEngine on
SSLCertificateFile /etc/apache2/ssl/your_domain_public.crt // The Public Key provided from the Certificate Autority
SSLCertificateKeyFile /etc/apache2/ssl/your_domain_private.key // The key you created initially (probably using OpenSSL and submitted to the Certificate Authority)
SSLCertificateChainFile /etc/apache2/ssl/your_domain_intermediate.crt // The Intermediate Certificate provided from the Certificate Autority

<Directory /var/www/html/path_to_your_site/>
AllowOverride All
</Directory>

</VirtualHost>

5. Restart the Apache service using

sudo service apache2 restart

 

Now you should be able to navigate to load your site using HTTPS but depending on your CMS or Shopping Cart platform you may need to make a config change in the admin area to force it to use HTTPS.

Magento

To change this in Magento navigate to:

System->Configuration->General->Web->Unsecure and System->Configuration->General->Web->Secure

Magento Secure Unsecure Setting

WordPress

To change this in Magento navigate to:

Settings->General->WordPress Address (URL) and Settings->General->Site Address (URL)

Screenshot from 2015-05-30 14:44:31

About The Author
Adrian Randall
I'm a digital marketing specialist, love working on digital business and coding on just about anything. I'm the founder of Arcadian Digital and this site shares some of our knowledge and practices.

Leave a Response