In this blog we are going to discuss how to install the SSL certificate and how to renew the existing SSL Certificate and also how to change the exisitng SSL certificate when domain/sub-domain name changed.

How to install SSL Certificate in Apache2

Install the Certbot

apt-get install software-properties-common python-software-properties
add-apt-repository ppa:certbot/certbot
apt-get update
apt-get install python-certbot-apache

Install the certificate now

sudo certbot certonly -d YOUR_DOMAIN_1 -d YOUR_DOMAIN_2

Now choose the authentication method for your domain

And Finally you will get

How to Renew the SSL Certificate

Type the below command and follow the choices given

sudo certbot

Now choose the desired certificate and press enter, Now you will see

Choose second option and press enter

Press your desired option and boom certificate is renewed

How to replace the existing certificate with new one

Just remove the old certificate by following commands

sudo certbot certificates
sudo certbot delete

the certificate will be deleted. Now just replace its reference with the new certificate name in

 sudo vi /etc/apache2/sites-enabled/000-default-le-ssl.conf

Finally Restart your apache2

 sudo /etc/init.d/apache2 start

Leave a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.