Apache 2 – Installing SSL certificates

Prerequisites

  • Have Apache2 installed.
  • Received CSR from Certificate Authority(CA), for more info refer to creating CSR

This post assumes the Operating System to be Linux (Ubuntu 14.04) distribution.

cd /etc/apache2/sites-available
cp 000-default.conf 000-default.conf.backup

// open to edit the conf file
sudo vi 000-default.conf

//add the following code
<VirtualHost *:443>
  ServerName nadzweb.com // if using subdomain, subdomain.nadzweb.com
  SSLEngine on
  SSLCertificateFile /home/nadzweb/nadzweb.com.crt // certificate file
  SSLCertificateKeyFile /home/nadzweb/nazweb.com.key // private key
  
  /**
   If you are using Apache 2.4.8 or greater, specify the CA intermediate bundle by adding this line **/
  SSLCACertificateFile /home/nadzweb/intermediate.crt // bundle file
/**
   If you are using Apache 2.4.7 or less, specify the CA intermediate bundle by adding this line **/
  SSLCertificateChainFile /home/nadzweb/intermediate.crt

 // apply other settings as required
</VirtualHost>

<VirtualHost *:80>
   ServerName nadzweb.com
   Redirect permanent / https://nadzweb.com/
</VirtualHost>

Once you have made the above changes, enable SSL on apache and restart the server.

sudo a2enmod ssl // enable SSL
sudo service apache2 restart // restart Apache2

You are all setup now.

Add a Comment

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

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Anti-spam image