打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
怎样续期Let’s Encrypt免费证书?

SSH进服务器,执行如下命令:

root@itkylin:~# /webdirectory/letsencrypt/certbot-auto renew --quiet --no-self-upgrade

这时,若提示如下错误信息:

Attempting to renew cert (www.itkylin.com) from /etc/letsencrypt/renewal/www.itkylin.com.conf produced an unexpected error: Problem binding to port 443: Could not bind to IPv4 or IPv6.. Skipping. All renewal attempts failed. The following certs could not be renewed: /etc/letsencrypt/live/www.itkylin.com/fullchain.pem (failure) 1 renew failure(s), 0 parse failure(s)

暂时停止nginx监听80、443端口:

root@itkylin:~# service nginx stop

重新执行更新命令:

root@itkylin:~# /webdirectory/letsencrypt/certbot-auto renew --quiet --no-self-upgrade

重新启动nginx服务:

root@itkylin:~# service nginx start

OK,打开浏览器输入网址打开网页,小绿伞又出来了,查看信息三个月后到期,为了防止下次又忘记续期,可以写个小脚本定时执行:

三个月早忘了这事了,所以还是写个脚本放crontab让它自动更新吧:

root@itkylin:~#chmod +x /webdirectory/letsencrypt/certbot-auto root@itkylin:~#vi /webdirectory/letsencrypt/sslrenew.sh #!/bin/sh /webdirectory/letsencrypt/certbot-auto renew --quiet --no-self-upgrade :wq! root@itkylin:~#chmod +x /webdirectory/letsencrypt/sslrenew.sh

Certbot只有在证书到期前一个月才会进行更新,如果证书还没到期,它是不会进行更新的。所以设定让服务器每周日凌晨01:05分开始自动更新。

root@itkylin:~#vi /etc/crontab 05 1 * * 0 /webdirectory/letsencrypt/sslrenew.sh :wq!
本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
【热】打开小程序,算一算2024你的财运
 获取免费的ssl证书并部署到nginx上面
nginx配置免费SSL证书及证书定时更新
Nginx配置,文件夹权限和let-encrypt
一个命令,让你的网站支持https
https 证书工具 Letsencrypt 简单教程
如何免费的让网站启用HTTPS
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服