1、安装 Certbot 客户端

# Ubuntu/Debian
sudo apt update
sudo apt install certbot python3-certbot-nginx

# CentOS/RHEL
sudo yum install epel-release
sudo yum install certbot python3-certbot-nginx

2、申请证书

# 自动配置Web服务器,nginx.conf也会配置好
sudo certbot --nginx -d yourdomain.com -d www.yourdomain.com

# 仅获取证书不安装
sudo certbot certonly --standalone -d yourdomain.com

3、测试自动续期

sudo certbot renew --dry-run

4、自动续期设置

(crontab -l 2>/dev/null; echo "0 0 1 * * /usr/bin/certbot renew") | crontab -
liubin的头像

liubin

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注