Secure your website using Let’s Encrypt with Certbot SSL

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 * * * * scl enable python27 '/root/certbot-auto renew'

Congratulations! You’ve made your website secure.