Install SSL in ubuntu server

 Hi All,


Below are the details for installing ssl on linux server

At First lets create a private key. Below command needs to be run for the same

sudo openssl genrsa -out private.key

 


Once done, we can proceed generating CSR for the same

Below is the command and steps:

sudo openssl req -new -key private.key -out csr.pem

Next step would be enterng below information it will ask for:

Country Name (country code) example IN, GB etc

State Name: 

Locality Name: 

Organization Name:

Organization Unit : Mostly it is IT

Common Name: Domain or Website name

Email Address : 

Then it will ask for challenge password and company name. Skip it by pressing enter.


Use vi command to get the csr code: here in this case

sudo vi csr.pem

Copy all the code by selecting the same and then paste it in your providers panel.

Once you get the certificate files, upload the same to a directory. You can name it anything. I name it as certs.

Once the files are exported. We can go and edit our virtual host file and add below code :


#<VirtualHost *:443>
#SSLEngine on
#        SSLCertificateFile /var/www/html/*****/ServerCertificate.cer
#        SSLCertificateKeyFile /var/www/html/
*****/private.key
#        SSLCertificateChainFile /var/www/html/
*****/CACertificate-INTERMEDIATE-1.cer
#        ServerName domainname.com
#        ServerAlias www.
domainname.com
#        DocumentRoot  /var/www/html/*****/
#        ErrorLog /var/www/html/
*****/logs/error.log
#</VirtualHost>

Do replace the domainname with your website name and do not forget to add correct path of the certificate files


once done, run below command:

sudo systemctl restart apache2

It is done.. Do let me know in case of any queries in comment box.

 

Comments

Popular posts from this blog

Force HTTPS code using htaccess & web.config

Access Mysql from docker container and export the database

No space left on device: AH00023: Couldn't create the mpm-accept mutex