Add SSL on Apache for Ubuntu

Monday, October 28, 2013

Add and configure SSL certificate on  Apache for Ubuntu system using the following system.

Step 1:
First enable SSL for your ubuntu

$ sudo a2enmod ssl

Step 2:
Restart your apache2 server

$ sudo service apache2 restart

Step 3:
Create a SSl folder at apache2

$ sudo mkdir /etc/apache2/ssl

Step 4:
Generate private/public keys for security purpose. Enter the below command and add related key information.

$ sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/apache2/ssl/apache.key -out /etc/apache2/ssl/apache.crt

Step 5:
Now configure default SSl file

$ nano /etc/apache2/sites-available/default-ssl

#Add the server name


#Add the ssl file location

SSLEngine on
SSLCertificateFile /etc/apache2/ssl/apache.crt
SSLCertificateKeyFile /etc/apache2/ssl/apache.key

Step 6:
Enable the virtual host default

$ sudo a2ensite default

Step 7:
Restart the apache2

$ sudo service apache2 restart

No comments:

Post a Comment