https 网络协议 http certbot证书自动续签 - /dev/null 2>
一、安装
检查证书有效期 curl -vvI https://www.xxx.top 安装certbot apt install certbot 安装证书 certbot certonly --webroot --email xxx@gmail.com -w /home/wwwroot/xxx -d www.xxx.top
二、 续期
ssl手动续期 certbot的证书有效期为90天,手动续期
certbot renew 手动续期需要注意两点: 拼多多帮助力入口
1.80端口没有被占用,因为更新证书需要用到80端口。 2.在到期前30天之内才能续期,否则certbot会判断没有必要进行续期。
自动续期:
vi /sh/renew_ssl.sh #!/bin/bash nginx -s quit certbot renew --force-renewal --renew-hook "nginx" > /sh/ssl_update.log 2>&1 & –force-renewal:强制更新证书,无视30天之内限制 –renew-hook:证书更新完毕后,将关闭的nginx启动。(没有加入系统路径的要带上路径,如:/usr/local/nginx/sbin/nginx) 脚本执行会有一段时间延迟:
0 0 1 * * sh /sh/renew_ssl.sh > /dev/null 2>&1 &
好文阅读