View Categories

Hướng dẫn cài đặt ACME cho Apache/Nginx

2 phút đọc

ACME SSL là việc ứng dụng giao thức ACME (Automated Certificate Management Environment) để tự động hóa quy trình cấp phát, xác thực, gia hạn và thu hồi chứng chỉ SSL/TLS cho tên miền website mà không cần can thiệp thủ công, bài viết này sẽ hướng dẫn cài đặt ACME cho website sử dụng Apache hoặc Nginx.

1. Tải certbot #

1.1 Debian OS

  • Update package
sudo apt update
  • Tải certbot
#Apache
sudo apt install certbot python3-certbot-apache

#Nginx
sudo apt install certbot python3-certbot-nginx  

1.2 Red Hat OS

  • Tải EPEL repository
sudo dnf install epel-release
  •  Refresh danh sách repository
sudo dnf clean all
sudo dnf update
  • Tải certbot
#Apache
sudo dnf install certbot python3-certbot-apache

#Nginx
sudo dnf install certbot python3-certbot-nginx

2. Cấu hình certbot (automatic mode) #

  • Apache
sudo certbot --apache --non-interactive --agree-tos --server <acme-directory> --email <your-email> --eab-kid <your-eab-kid> --eab-hmac-key <your-hmac-key> --domain <your-domain> --cert-name <your-certificate-name>

  • Nginx
sudo certbot --nginx --non-interactive --agree-tos --server <acme-directory> --email <your-email> --eab-kid <your-eab-kid> --eab-hmac-key <your-hmac-key> --domain <your-domain> --cert-name <your-certificate-name>

Giải thích:

--nginx / --apache: loại web server sử dụng.

--non-interactive, --agree-tos: Cho phép chạy tự động (không cần xác nhận thủ công), đồng thời tự động chấp nhận điều khoản sử dụng dịch vụ.

--server: Địa chỉ hệ thống cấp phát chứng chỉ (ACME directory) tương ứng với gói SSL đã mua.

--email: Email nhận thông báo khi chứng chỉ sắp hết hạn.

--eab-kid: Mã định danh tài khoản chứng chỉ.

--eab-hmac-key: Khóa bí mật đi kèm, dùng để xác thực tài khoản khi cấp chứng chỉ.

--domain: tên domain cần cài SSL.

--cert-name: Tên gợi nhớ để quản lý chứng chỉ trên server.

Ví dụ:

sudo certbot --nginx --non-interactive --agree-tos --email admin@vhost.vn --server https://acme.sectigo.com/v2/DV --eab-kid <your-eab-kid> --eab-hmac-key <your-hmac-key> --domain vhost.vn --domain www.vhost.vn --domain api.vhost.vn --cert-name vHost-certificate

Leave a Reply

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

Are you human? Please solve:Captcha


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

Scroll to Top
Đăng ký dùng thử Email Server
vHost sẽ ưu tiên xử lý và sắp xếp theo thứ tự đăng ký
Đăng ký ngay
Gửi ngay cho tôi
vHost có quà cho bạn
ĐỪNG ĐI
Chỉ ưu tiên cho 10 khách hàng nhanh tay nhất
Day 3: High Availability WordPress website
Thời gian: 10:00 - 11:30 30/10/2025
Đăng ký ngay