DNS 유효성 검사 모드를 사용하여 Nginx 구성으로 암호화하도록 설치했습니다. 자동 갱신 설명서의 지시에 따라 아래 항목을 추가했습니다.
15 3 * * * /usr/bin/certbot renew --quiet
그러나 이것이 작동하지 않았기 때문에 명령줄에서 실행하여 무슨 일이 일어났는지 확인했습니다. 아래 오류가 발생합니다. 포트 80/443이 Nginx에서 사용 중이고 수동으로 갱신할 때 이를 중지해야 한다는 것을 이해합니다. AUTO RENEW 모드에서 어떻게 설정하는지 궁금합니다. 즉, 이 전에 stop Nginx를 추가하세요. cronjob을 실행하고 그 후에 다시 시작하시겠습니까? 그러나 Nginx가 실패하면 가동 중지 시간이 많이 발생하므로 cronjob에서 이 작업을 수행하는 것은 약간 위험합니다.
[centos]# /usr/bin/certbot renew --quiet
Attempting to renew cert (example.com) from /etc/letsencrypt/renewal/example.com.conf produced an
unexpected error:
Problem binding to port 80: Could not bind to IPv4 or IPv6.. Skipping.
All renewal attempts failed. The following certs could not be renewed:
/etc/letsencrypt/live/example.com/fullchain.pem (failure)
1 renew failure(s), 0 parse failure(s)
어떤 아이디어?
답변1
certbot을 실행하세요.--nginx
또는--webroot
문서에 설명된 대로 매개변수를 사용하면 열린 웹 서버를 시작하는 대신 실행 중인 nginx를 사용하게 됩니다.
certbot renew --quiet --nginx
또는
certbot renew --quiet --webroot --webroot-path /var/www/html
--deploy-hook
성공적인 갱신 후에는 매개변수를 사용하여 nginx를 다시 로드하는 것도 잊지 마세요 .
참고: 아직 설치하지 않은 경우 아래 명령을 사용하여 nginx 플러그인을 설치해야 합니다.
yum install python-certbot-nginx