IT/잡다구리

[SSL] Let's Encrypt SSL 인증서 갱신시 오류 404

월공 2021. 2. 1. 11:35
728x90
300x250

Let's Encrypt 를 이용한 무료 SSL 인증서를 발급받아서 3개월동안 잘 사용하다가 오늘이 만료라

부랴부랴 갱신을 했습니다.

certbot renew

위 명령어를 치고 갱신을 하면된다는데, 역시나 아니나다를까 한번에 잘되는 꼬라지를 못봅니다

 

IMPORTANT NOTES:
 - The following errors were reported by the server:

   Domain: test.com
   Type:   unauthorized
   Detail: Invalid response from
   http://test.com/.well-known/acme-challenge/_n_Q5_1Y9DQMeE0-OS3uCMf6xemSwSAxLSQ5W_rzayc
   [222.111.111.111]: "<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML
   2.0//EN\">\n<html><head>\n<title>404 Not
   Found</title>\n</head><body>\n<h1>Not Found</h1>\n<p"

   To fix these errors, please make sure that your domain name was
   entered correctly and the DNS A/AAAA record(s) for that domain
   contain(s) the right IP address.

에러가 위 처럼 나오기 시작했고 여기저기 찾아본 결과 종합하자면

인증서가 바라보는 도메인의 root 경로와, 현재 선언되어있는 경로가 달라서 매칭 실패가되어 못찾는다고 합니다.

 

# 아래 경로 폴더 내부에 해당 도메인 이름으로 되어있는 conf 파일을 열어서 내용 수정을 해주었습니다.
cd /etc/letsencrypt/renewal

====================================
# vi/test.com.conf
====================================

 # renew_before_expiry = 30 days
  version = 1.9.0
  archive_dir = /etc/letsencrypt/archive/test.com
  cert = /etc/letsencrypt/live/test.com/cert.pem
  privkey = /etc/letsencrypt/live/test.com/privkey.pem
  chain = /etc/letsencrypt/live/test.com/chain.pem
  fullchain = /etc/letsencrypt/live/test.com/fullchain.pem
  
# Options used in the renewal process
  [renewalparams]
  account = 74895785812340128374928375892475190871908
  authenticator = webroot
  #webroot_path = /var/www/html, 기존에 되어있던 경로
  webroot_path = /var/www/html/domain_folder,
  server = https://acme-v02.api.letsencrypt.org/directory
  [[webroot_map]]
  test.com = /var/www/html/domain_folder
  

 

webroot_path 가 기존에 /var/www/html 로 되어있어서 해당 도메인 폴더를 향하게 조정해주고 나서 다시 

certbot renew 명령어를 입력하니 내용이 쭉쭉 나오면서 아래 처럼 결국 잘 처리되었다고 뜹니다.

Congratulations, all renewals succeeded. The following certs have been renewed:
  /etc/letsencrypt/live/test.com/fullchain.pem (success)

 

728x90
300x250