Suppose you have already a website running on http protocol with apache
ubuntu server and you want to install a free SSL in your website then
follow the below steps and this license will expire in 90 days so you
will need to renew it again:
1- First of all run following commands to activate SSL mode and webserver to listen on port 443.
$ sudo a2enmod ssl
$ sudo a2ensite default-ssl.conf
$ sudo service apache2 restart
You can check your website URL with https like https://www.yourdomain.com
2- Install Free Let’s Encrypt Client
In order to install Let’s Encrypt software on your server you need to have git
package installed on your system.
$sudo apt-get -y install git
$cd /usr/local
$sudo git clone https://github.com/letsencrypt/letsencrypt
3- Now Generate a SSL Certificate for Apache
$cd /usr/local/letsencrypt
$sudo ./letsencrypt-auto --apache -d yourdomain.com
If you need multiple domain or sub-doamins add them all using -d switch for
each extra sub domains after base domain as below:
$sudo ./letsencrypt-auto --apache -d yourdomain.com -d www.yourdomain.com
After running this command you will be asked which .conf file you wish to
choose so that config file will be updated.
Now the SSL is installed and you can check your website using https protocol and it should work fine.
4- To Auto Renew Lets Encrypt Certificates
$sudo ./letsencrypt-auto --apache -d yourdomain.com -d www.yourdomain.com