How to install Let’s Encrypt SSL on CentOS 6

#Introduction

In this tutorial, How to install Let’s Encrypt SSL on CentOS 6. Let’s Encrypt is a free, automated for TLS/SSL certificate web server.

Prerequisite

You server has installed Web server If it’s not then you can use command to install a web server

For Nginx
# yum install nginx
 For Apache
# yum install httpd mod_ssl

Install LetsEncrypt on Centos 6

curl -o /usr/local/sbin/certbot-auto https://dl.eff.org/certbot-auto
chmod a+x /usr/local/sbin/certbot-auto

Generate a SSL certificate

sudo /usr/local/sbin/certbot-auto certonly \
--manual \
--agree-tos \
--preferred-challenges=dns \
--server https://acme-v02.api.letsencrypt.org/directory \
--email huupv@devopsroles.com \
--domains devopsroles.com

certificated will be available under folder: /etc/letsencrypt/live/devopsroles.com

/etc/letsencrypt/live/devopsroles.com/fullchain.pem
/etc/letsencrypt/live/devopsroles.com/privkey.pem

Setup a cron job for Let’s Encrypt SSL

# Setting up crontab
crontab -e

# Append the below line to the end of crontab
0 0 * * * /usr/local/sbin/certbot-auto renew --renew-hook "/sbin/service nginx reload" --quiet --agree-tos

HOW TO SETUP NGINX TO USE SSL WITH LETSENCRYPT

For example as follow

server {
 listen 443;
 ssl on;
 server_name devopsroles.com;
 ssl_certificate /etc/letsencrypt/live/devopsroles.com/fullchain.pem;
 ssl_certificate_key /etc/letsencrypt/live/devopsroles.com/privkey.pem;
 root /etc/nginx/html;
 
}

Conclusion

You have installed Let’s Encrypt SSL on CentOS 6. I hope will this your helpful. Thank you for reading the DevopsRoles page!

, , ,

About HuuPV

My name is Huu. I love technology and especially Devops Skill such as Docker, vagrant, git so forth. I likes open-sources. so I created DevopsRoles.com site to share the knowledge that I have learned. My Job: IT system administrator. Hobbies: summoners war game, gossip.
View all posts by HuuPV →

Leave a Reply

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

Comment moderation is enabled. Your comment may take some time to appear.

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