Installing SSL Certificate In Ubuntu On AWS

Once you received the new certificates from CA Authority upload it on server using SFTP / SSH .

IN this example I have created directory ssl in /etc/apache2 to store all my certificates.

Upload all certificates to /etc/apache2/ssl/

Move your keystore file sslcert.key to /etc/apache2/ssl/private/

In newer version of Ubuntu SSL configuration manage in file called “default-ssl.config “.

In this file we need to provide new certificates full path .

File path on Ubuntu : /etc/apache2/sites-available/default-ssl.config

Here is the extract of the regular SSL configuration file looks like.

Add virtual host : 443 entry in /etc/apache2/sites-available/000-default.conf

At last we need to allow HTTPS protocol in .HTAccess file which is security file on Linux.

Need to put .htaccess file in your web root which is in Ubuntu case : /var/www/html/.htaccess

Modify .htaccess file and add below block to allow HTTPS

Allow HTTPS in .HTAccess file : /www/var/html/.htaccess

RewriteCond %{HTTPS} off

RewriteCond %{HTTP:X-Forwarded-Proto} !https

RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

 

At last run below command to Enable the SSL Host and restart your Apache service.

#sudo a2enmod ssl

# sudo a2ensite default-ssl.conf

# a2ensite default-ssl

#service apache2 reload

Finally try to launch your web site using https and it will show you as secure connection.

E.g. https://nxtstartup.in/