How to install SSL certificate | Abdul Haq

How to install SSL certificate

Step 1: Generate Key.

Run the following command in putty command prompt:

openssl genrsa 2048 > keyfilename.key

Step 2: Generate CSR file with following command.

openssl req –new –key keufilename.key > csrfilename.csr

After that command is entered, system will ask few questions:
Country: PK

State/Province: Punjab

City: Lahore

Organization name: Opendp

Organization unit: IT

Common name: www.yourdomain.com

Email: youremail@email.com

Challenge password: [leave blank]

Optional company name: [leave blank]

Step 3: Buy a SSL certificate.

Step 4: Enter generated CSR file contents from where you bought SSL certificate.

 

Watch this video for above steps practical implementation: https://www.youtube.com/watch?v=XrZxJsKUQR8

Step 5: Confirm your domain ownership.

This can be done by 3 ways. By adding file to you domain, through your registrant email and by adding a DNS record.

Step 6: Get your certificate.

After confirming your ownership, you will be sent an email to your registered email address containing you certificate files. There will 3 files, one with your_domain.crt name, that is your certificate. Another file name your_domain.p7b, this was not used by me. And last with your_domain.ca-bundle name, this file was used.

Step 7: Upload certificate files to server.

Upload your_domain.crt, your_domain.ca-bundle and keyfilename.key (this file was generated in step 1) to your server. Recommended to upload them in /etc/apache2/ssl folder. (it’s only a recommendation, can be uploaded anywhere).

Step 8: Configure default-ssl.conf file.

Next you need to configure you default-ssl.conf file which is located in /etc/apache2/sites-available. Below contents need to be uploaded in the file:

<VirtualHost 192.168.0.1:443>
DocumentRoot /var/www/html2
ServerName www.yourdomain.com
SSLEngine on
SSLCertificateFile /path/to/
your_domain.crt
SSLCertificateKeyFile /path/to/
keyfilename.key
SSLCertificateChainFile /path/to/
your_domain.ca-bundle
</VirtualHost>

This article will help you with above steps: https://www.digicert.com/ssl-certificate-installation-apache.htm

Step 9: Restart server.

Finally, you should restart your server with following command:

sudo service apache2 restart


Tags:


Please share if you found this useful


Recent Posts

Developing a WordPress theme

If you are here, I assume you have heard about WordPress before.  If not, let me tell you th...

Creating feed like Instagram Android

Few weeks back I showed how you can create profile similar to Instagram. You can see that article...

Reducing EBS volume size AWS

I recently shifted all my images and videos data from EBS volume to S3 as it was cheaper. After c...

Android Instagram like profile

Today I will show how you can create profile similar to Instagram's profile in android. It is mor...

top