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
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/
Following processes will occur after the command executed above
Enter the list of fields asked
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.
Open the host file via any editor and edit ServerName, ServerAlias and path of Document root based upon your requirement.
Edit the SSLEngine to on and specify the path of SSLCertifiacteFile and SSLCertificateKeyFile
Enable the virtual host file using a2ensite command
Reload the apache service
And now browse via any browser to your https website
Now, you have successfully applied self signed https website in apache2 package of ubuntu OS Server !!