Webhosting Blog

Installing SSL on UBUNTU

Well a bit tedious but easy to install SSL on ubuntu.  :)

Following are the steps to install SSL for a domain on ubuntu server.

A) Create CSR and Key files:

1) Navigate to the folder/etc/ssl/private

# cd /etc/ssl/private

2) Let us create a private key for the SSL specifically of 2048 bits.

# openssl genrsa -des3 -out dns.server.com.key 2048     [OR openssl genrsa -out dns.server.com.key 2048 (without des3 encryption)]

3)Lets create CSR (Certificate Signing Request ) with the above created key.

# openssl req -new -key dns.server.com.key -out /etc/ssl/certs/dns.server.com.csr

Use the above CSR to get the cert from the CA.

Once you get the certificate from the CA follow the following steps to install the SSL for the domain on the server.

B) Enabling the certificate for the domain:

1)Add the CA bundle for the domain in the file /etc/ssl/certs/ca-certificates.crt .

2)Open the file  /etc/apache2/sites-available/default. Check all the configurations are correct.

3)Open the file  /etc/apache2/sites-available/default-ssl add the entries for the .crt and .key file:

SSLEngine on
SSLCertificateFile    /etc/ssl/certs/dns.server.com.crt
SSLCertificateKeyFile /etc/ssl/private/dns.server.com.key

4) Now issue following command to enable SSL module on the server

# a2ensite ssl OR  a2ensite default- ssl

5)Once done restart the apache service on the server.

#/etc/init.d/apache2 restart

You should now be able to access the domain with https.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s