certbot 갱신 명령 사용 시 에러 해결

Let’s Encrypt를 사용해서 SSL 인증서 등록을 했는데 만료일이 얼마 안 남았다는 메일을 받았다. 그동안 자동으로 갱신 해놓게 만들어서 한 번도 받은적이 없던 메일인데 어쩐일인가 싶었다.

먼저 cron으로 등록해둔 갱신 명령을 확인했다. certbot 명령으로 갱신을 하는데 아래와 같은 오류 메시지가 출력됐다.

$ certbot -q renew
Attempting to renew cert (vlee.kr) from /etc/letsencrypt/renewal/vlee.kr.conf produced an unexpected error: The requested nginx plugin does not appear to be installed. Skipping.
All renewal attempts failed. The following certs could not be renewed:
  /etc/letsencrypt/live/vlee.kr/fullchain.pem (failure)

플러그인이 없다는 문제인 것 같아 해결 방법을 찾아봤다.

$ sudo add-apt-repository ppa:certbot/certbot
$ sudo apt-get update
$ sudo apt-get install certbot
$ sudo apt install python-certbot-nginx

위와 같이 certbot 관련 패키지 저장소를 등록하고 패키지 업데이트를 했다. 그리고 python-certbot-nginx를 설치해주었더니 certbot renew 명령어가 정상 실행됐다.

$ certbot -q renew
$ certbot certificates
Saving debug log to /var/log/letsencrypt/letsencrypt.log

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Found the following certs:
  Certificate Name: vlee.kr
    Domains: vlee.kr gitlab.vlee.kr nc.vlee.kr wedding.vlee.kr wiki.vlee.kr www.vlee.kr
    Expiry Date: 2020-05-17 04:49:45+00:00 (VALID: 89 days)
    Certificate Path: /etc/letsencrypt/live/vlee.kr/fullchain.pem
    Private Key Path: /etc/letsencrypt/live/vlee.kr/privkey.pem
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

갱신 후 certbot certificates 명령으로 갱신된 결과를 확인하니 정상적으로 기간이 연장 됐다.

참고

Leave a Reply