Secure your website using Let’s Encrypt with Certbot SSL

After watching the below video about HTTPS, I decided to finally make the move over to SSL. Fortunately, there’s a free way of doing so by using Let’s Encrypt. I’m going to provide the exact steps I took, which really wasn’t hard at all. Let’s get to it.

OS: CentOS release 6.8 (Final)
Web Application: httpd – Server version: Apache/2.2.15 (Unix)

Run the following commands as root.

yum install epel-release
chmod a+x certbot-auto

Create conf

I created a separate conf file within /etc/httpd/conf.d/ (removed the old one within /etc/httpd/conf/httpd.conf).

Notice I added a redirect for all http requests to be forwarded to https.

vi /etc/httpd/conf.d/
<VirtualHost *:80>
 DocumentRoot /var/www/
 DirectoryIndex index.html index.php

Restart httpd

/etc/init.d/httpd restart

Run certbot-auto


Setup auto renewal using cron

Runs renew command every 6 hours.

crontab -e
*/6 * * * * /root/certbot-auto renew --quiet --no-self-upgrade

Congratulations! You’ve made your website secure.