1.安装软件
yum install certbot python-certbot-nginx2.申请证书并自动配置Nginx
certbot --nginx -d yourdomain.com3.设置自动续期(每月1日执行)
0 0 1 * * certbot renew --quiet --renew-hook 'systemctl reload nginx'具体设置方法
$ which certbot # 查找cerbot具体设置路径
$ /usr/bin/certbot
# 2. 编辑 Cron 任务
$ sudo crontab -e
# 3. 添加以下内容并保存
0 0 1 * * /usr/bin/certbot renew --quiet --renew-hook 'systemctl reload nginx'
# 4. 查看任务是否添加成功
$ sudo crontab -l