How to install let's encrypt (certbot) on RHEL 8

How to install let's encrypt (certbot) on RHEL 8

Chuẩn bị môi trường, dụng cụ

  • RHEL 8 đã cài đặt.
  • Subscribed Redhat.
  • Cài đặt tool dnf
  • Có quyền root.
  • Cài đặt Apache web server hoặc Nginx web server.
  • Có 1 tên miền.

Procedure (Choice 1 or 2)

  1. Cập nhật hệ thống và cài đặt NGINX
1
2
3
4
5
sudo dnf update -y
sudo dnf install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
sudo dnf config-manager --set-enabled PowerTools
sudo dnf install certbot python3-certbot-nginx
sudo certbot certonly --nginx
  1. Cập nhật hệ thống và cài đặt Apache
1
2
3
4
5
sudo dnf update -y
sudo dnf install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
sudo dnf config-manager --set-enabled PowerTools
sudo dnf install certbot python3-certbot-apache
sudo certbot certonly --apache

Kiểm tra kết quả cài đặt

  • Check certbot version
1
certbot --version
  • List All Certificates
1
sudo certbot certificates

Renew chứng chỉ SSL

  • Đănng ký thủ công
1
sudo certbot renew
  • Tự động gia hạn
1
sudo echo "0 0,12 * * * root python3 -c 'import random; import time; time.sleep(random.random() * 3600)' && certbot renew -q" | sudo tee -a /etc/crontab > /dev/null
Author

Lam Duc Binh

Posted on

2021-08-31

Updated on

2021-09-04

Licensed under