SSL or the Secure Socket Layer help you to safeguard your website by providing encryption for your website information and providing a secure connection.

Pre-requisite:  Apache2 installed, you can check here to view the process to install apache in ubuntu

Enable the ssl modules via  $sudo a2enmod ssl

Create a new directory to store certificate and other files related to certifiacate

ssl3

The below command line creates a self signed certificate with one year validity and placing it in new directory created above i.e. /etc/apache2/ssl/

ssl1

Following processes will occur after the command executed above

ssl2

Enter the list of fields asked

ssl4

create a new virtual host for displaying ssl certificate. You can use the existing default-ssl host file or copy to another one. Here I have created a new virtual host file named amrit.

ssl5

ssl6

Open the host file via any editor and edit ServerName, ServerAlias and path of Document root based upon your requirement.

ssl7

Edit the SSLEngine to on and specify the path of SSLCertifiacteFile and SSLCertificateKeyFile

ssl8

Enable the virtual host file using a2ensite command

ssl9

Reload the apache service

ssl10

And now browse via any browser to  your https website

ssl11

Now, you have successfully applied self signed https website in  apache2 package of ubuntu OS Server !!

Advertisements