Wednesday, June 7, 2017

Apache SSL Certificate Installation on Linux (Ubuntu) OS

For SSL Certificate Installation in Apache (Ubuntu OS)  follow the instructions below :

1. First Copy the Certificate files to your server on apache directory : In case of Ubuntu or Linux OS find path /etc/apache2/

2. Find the Apache config file to edit  Apache's main configuration file is typically named httpd.conf or /etc/apache2/conf.d/ or /etc/apache/sites-available/. 

3. Create  a files under apache configuration directory mention above like website-ssl.conf  for SSL.
If you need your site to be accessible through both secure (https) and non-secure (http) connections, you will need a virtual host for each type of connection. Make a copy of the existing non-secure virtual host.

4. Configure it for SSL as described below :

 <VirtualHost *:443>
DocumentRoot /var/www/html/
ServerName www.yourdomainname.com
SSLEngine on
SSLCertificateFile /path/to/your_domain_name.crt
SSLCertificateKeyFile /path/to/your_private.key
SSLCertificateChainFile /path/to/DigiCertCA.crt

</VirtualHost>

rename the file names to match your certificate files as mention above.

5. Test your Apache config before restarting your apache service . Run the following command in case of ubuntu OS.

sudo service apache2 restart

Troubleshooting: If your web site is publicly accessible tool  like (SSL Tool 1 , SSL Tool 2, SSL (Grading)) can help you find problems.

3 comments:

  1. Thanks for Sharing!

    ReplyDelete
  2. Trying on ubuntu 12.04 facing problem with multiple sub domain configuration. Can you share code for this ?

    ReplyDelete
  3. For multiple sub domain use virtual host configuration for apache2. Code already shared above.

    ReplyDelete