我收到的完整错误信息是:
Attempting to renew cert from /etc/letsencrypt/renewal/somedomain.com.conf produced an unexpected error: Problem binding to port 443: Could not bind to IPv4 or IPv6.. Skipping.
这是在AWS ubuntu 14.04实例上运行。所有端口都是开放的,出站和443入站也是开放的。
我收到的完整错误信息是:
Attempting to renew cert from /etc/letsencrypt/renewal/somedomain.com.conf produced an unexpected error: Problem binding to port 443: Could not bind to IPv4 or IPv6.. Skipping.
这是在AWS ubuntu 14.04实例上运行。所有端口都是开放的,出站和443入站也是开放的。
在执行此操作之前,您只需要停止所有正在运行的服务器,如Apache、nginx或OpenShift。
停止 Nginx
sudo systemctl stop nginx
停止 Apache2
sudo systemctl stop apache2
当你的服务器已经在端口443运行时,你可能会使用(预配置的)--standalone
选项来运行脚本。
在更新证书之前,您可以停止服务器,然后在更新完成后重新启动服务器。
man手册上说:
--apache Use the Apache plugin for authentication & installation
--standalone Run a standalone webserver for authentication
--nginx Use the Nginx plugin for authentication & installation
--webroot Place files in a server's webroot folder for authentication
--manual Obtain certificates interactively, or using shell script hooks
如果我使用--apache
运行续订,我将无法获得任何错误。
./certbot-auto renew --apache
命令非常顺利。 - gthuo--apache
需要安装 Apache 插件。如果您没有安装该插件,则需要在任何自动更新周围添加停止/启动服务器钩子。 - eis正如其他答案所暗示的那样,您需要为正在运行的Web服务器传递选项,例如:
没有Web服务器参数:
sudo certbot renew
证书即将到期,自动续订...
续订现有证书
执行以下挑战:针对 example.com 的 tls-sni-01 挑战。
清理挑战
尝试从 /etc/letsencrypt/renewal/example.com.conf 更新证书 (example.com),但出现了意外错误:
绑定443端口的问题:无法绑定IPv4或IPv6。
跳过。sudo certbot renew --nginx
证书即将过期,自动续订中...[这是专门针对ubuntu的]
以root用户身份登录到您的服务器
使用以下命令停止您的服务器 (如果使用nginx)
service nginx stop
然后更新您的证书
certbot renew
启动您的服务器
service nginx start
[提示] 要检查您更新后的证书过期日期,请输入以下命令
ssl-cert-check -c [Path_to_your_certificate]/fullchain.pem
例如ssl-cert-check -c /etc/letsencrypt/live/[your_domain_name]/fullchain.pem
或者
ssl-cert-check -c /etc/letsencrypt/live/[your_domain_name]/cert.pem
如果您的服务器上尚未安装ssl-cert-check,请使用以下命令进行安装:
apt install ssl-cert-check
注意: 只有在证书未过期时才能进行续签。如果已过期,则必须创建新的证书。
对于 nginx
sudo certbot renew --nginx
pm2 stop all
sudo certbot renew
pm2 start all
首先需要安装NGiNX的Let's Encrypt插件(如果你使用的是 NGiNX):
sudo apt install python-certbot-nginx
然后,您可以安全地运行:
sudo certbot renew --nginx
并且它将会运作。
注意:certbot 应该已经安装好了。
/etc/letsencrypt/letsencrypt-auto renew --apache >> /var/log/letsencrypt/renew.log
更新 SSL 证书
在同一实例上运行两个网站(主机)时,我遇到了类似的问题。我停止了Nginx,然后运行了sudo certbot certonly --standalone --preferred-challenges http -d domain.com -d www.domain.com
。重启Nginx后,一切都开始正常工作。