PhDLeToanThang / guacamole

script guacamole 1.5.x
https://hol.cloud.edu.vn
Apache License 2.0
2 stars 0 forks source link

Tổng kết các nhóm lệnh certbot để tạo mới certificates with current public IP tcp 80, 443 #8

Open PhDLeToanThang opened 1 month ago

PhDLeToanThang commented 1 month ago

In Ubuntu 2x LTS server need install Certbot:

sudo snap install certbot --classic

certbot 2.11.0 from Certbot Project (certbot-eff v ) installed

Run certbot to create and associate certificates with current public IP (must have tcp 80 and 443 open to work!)

nginx: certbot --nginx -n -d $LE_DNS_NAME --email $LE_EMAIL --agree-tos --redirect --hsts

Run certbot to create and associate certificates with current public IP (must have tcp 80 and 443 open to work!)

apache: certbot --apache -n -d $LE_DNS_NAME --email $LE_EMAIL --agree-tos --redirect --hsts

PhDLeToanThang commented 1 month ago

nhóm lệnh renew lại chữa ký số SSL Let's encrypt:

nginx:

/usr/bin/certbot renew --quiet --pre-hook 'systemctl stop nginx' --post-hook 'systemctl start nginx'

nhóm lệnh renew lại chữa ký số SSL Let's encrypt:

apache2:

/usr/bin/certbot renew --quiet --pre-hook 'systemctl stop apache2' --post-hook 'systemctl start apache2'

PhDLeToanThang commented 1 month ago

Trong nhóm lệnh tạo mới chữ ký số của apache2 :

sudo certbot --apache --agree-tos --redirect--hsts --staple-ocsp --email <> -d

PhDLeToanThang commented 1 month ago

Trường hợp lỗi khi đã quá hạn re-new chữ ký số public do let's encrypt Certbot cấp cho domains thì:

mặc dù đã dùng cả những lệnh cơ bản, đơn giản: sudo certbot renew --dry-run

vẫn hiển thị lỗi:

image

Trên DNS server cấu hình thêm CNAME record: Hostname value: _acme-challenge Value: _acme-challenge.yourdomain.com

PhDLeToanThang commented 1 month ago

sudo certbot --apache

sudo certbot renew --dry-run

PhDLeToanThang commented 1 month ago

Hãy xoá hoặc comment # các thông tin giả lập FQDN trong file /etc/hosts

image

Sau đó dùng lại lệnh : ping FQDN để kiểm tra việc test thông tên miền

Cuối cùng là dùng lệnh: sudo certbot --apache --agree-tos --redirect--hsts --staple-ocsp --email <> -d