Let’s Encrypt証明書「Problem binding to port 80: Could not bind to IPv4 or IPv6」の解決方法

環境
nginx 1.10.2
CentOS Linux release 7.9.2009 (Core)
Let’s Encrypt証明書

実行コマンド

# certbot certonly --standalone -d www.sample.com -m test@sample.com --agree-tos -n

実行結果

Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator standalone, Installer None
Starting new HTTPS connection (1): acme-v02.api.letsencrypt.org
Requesting a certificate for www.sample.com
Performing the following challenges:
http-01 challenge for www.sample.com
Cleaning up challenges
Problem binding to port 80: Could not bind to IPv4 or IPv6.

原因
Let’s Encrypt 証明書を取得するときに、80番ポートを利用するので、webサーバが起動しています。

対策
# systemctl stop nginx.service
再度実行

# certbot certonly --standalone -d www.sample.com -m test@sample.com --agree-tos -n

 

Nginx

Posted by arkgame