letsencrypt的免費SSL證書續簽及解決辦法


正常letsencrypt的免費SSL證書續簽, 常常需要停止nginx

步驟:

就是先停nginx服務,然后續簽操作,在服務器上即:


1. 直接續簽證書
find / -name "certbot-auto"
/root/letsencrypt/certbot-auto
/root/certbot-auto

/root/letsencrypt/certbot-auto/certbot-auto renew --force-renew --no-self-upgrade

--force-renew 強制更新
--no-self-upgrade 不更新 letsencrypt

2. 續簽證書失敗(重新注冊證書)

執行: /root/letsencrypt/certbot-auto certonly --standalone --no-self-upgrade -d xxxxx.com

若執行報以下錯

Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator standalone, Installer None
Obtaining a new certificate
Performing the following challenges:
http-01 challenge for xxxx.com
Cleaning up challenges
Problem binding to port 80: Could not bind to IPv4 or IPv6.


停止nginx
sudo /usr/sbin/nginx -s stop

啟動nginx
nginx -c /etc/nginx/nginx.conf
nginx -s reload

最后  用2生成的新的 fullchain.pem 和privkey.pem 替換原來舊的,即可

cp /etc/letsencrypt/live/xxx.com-0001/fullchain.pem /etc/letsencrypt/live/xxx.com/fullchain.pem

cp /etc/letsencrypt/live/xxx.com-0001/privkey.pem /etc/letsencrypt/live/xxx.com/privkey.pem 


sudo /usr/sbin/nginx -t
sudo /usr/sbin/nginx -s reload

訪問網站, 可以看到證書已續簽 !!

 

letsencrypt配置https 相關網址:

https://www.jianshu.com/p/0d455c7a9326

https://www.jianshu.com/p/e4def1f789c1

https://www.liaosam.com/use-cron-service-and-certbot-for-renewal-of-letsencrypt-ssl-certificates.html

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM