A simple approach to creating a secure site HTTPS

Creating a secure site in Ubuntu / apache seems like a daunting task, so I thought there must me an easier way – and there is by installing Letsencrypt on the server.

Installing Letsencrypt (aka cerbot)

Step 1 – add the repository

sudo add-apt-repository ppa:certbot/certbot

Then update

sudo apt-get update

and install

sudo apt-get install python-certbot-apach

Step 2 – Creating the Certificate for a domain

sudo certbot --apache -d example.com

or for multiple simply

sudo certbot --apache -d example.com -d www.example.com

the terminal will then present you with a step by step guide. The certificates can be viewed here /etc/letsencrypt/live

You can verify your site using the following link (replacing the example with your own)
https://www.ssllabs.com/ssltest/analyze.html?d=example.com&latest

You should now able to conect to you site using HTTPS

Step 3 -Auto Renew

You will need to auto renew the certificate every 90 days by simply running the following command. You can then set up a cron job to do this automatically.

sudo certbot renew 

More information here

Share this:
CategoriesIT

Leave a Reply

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