본문 바로가기
공부/프로그래밍

[Linux-centos7] letsencrypt 갱신 실패시 대처법

by demonic_ 2019. 7. 2.
반응형

무료인증은 이전글 참조:

https://lemontia.tistory.com/697

 

[Linux-centos7] HTTPS 무료 인증서 설치 및 설정 방법(certbot 사용, apache)

### certbot 을 다운로드 및 실행. wget https://dl.eff.org/certbot-auto # certbot-auto 가 설치된 디렉토리에서 아래의 명령어를 실행합니다. 실행 후에는 /etc 폴더내에 letsencrypt 파일이 생성되므로 root..

lemontia.tistory.com

본문 마지막에 있는 자동갱신이 안될경우 다음을 참조하면 되겠다

 

아래 명령어를 실행한다

/bin/certbot-auto certonly --manual -d 'booknme.co.kr'

 

실패문구

Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator manual, Installer None
Cert is due for renewal, auto-renewing...
Renewing an existing certificate
Performing the following challenges:
http-01 challenge for booknme.co.kr

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NOTE: The IP of this machine will be publicly logged as having requested this
certificate. If you're running certbot in manual mode on a machine that is not
your server, please ensure you're okay with that.

Are you OK with your IP being logged?
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
(Y)es/(N)o: y

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Create a file containing just this data:

nKKN0NgDNtnSxqUXF5WgzrAxrakROa7iVb53svEHyjw.lLIPvOSu22UsRTUocW42u_4Nw4e1n4etHwV71QK3foc

And make it available on your web server at this URL:

http://booknme.co.kr/.well-known/acme-challenge/nKKN0NgDNtnSxqUXF5WgzrAxrakROa7iVb53svEHyjw

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Press Enter to Continue
Waiting for verification...
Challenge failed for domain booknme.co.kr
http-01 challenge for booknme.co.kr
Cleaning up challenges
Some challenges have failed.

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

   Domain: booknme.co.kr
   Type:   unauthorized
   Detail: Invalid response from
   http://booknme.co.kr/.well-known/acme-challenge/nKKN0NgDNtnSxqUXF5WgzrAxrakROa7iVb53svEHyjw
   [218.39.65.170]: "<html>\r\n<head><title>404 Not
   Found</title></head>\r\n<body>\r\n<center><h1>404 Not
   Found</h1></center>\r\n<hr><center>nginx/1.15.8</ce"

   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.

 

토큰파일을 생성하고 파일안에 내용을 브라우저 url로 찍었을때 나와야하는데 내 경우는 특정사유로 인해 파일이 생성되지 않았다.

 

그래서 단계별로 진행하면서 유용성을 체크하는 토큰파일을 만들어 인증을 받았다.

 

Press Enter to Continue 문구가 나오기 전까지 진행하자

# /bin/certbot-auto certonly --manual -d 'booknme.co.kr'


Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator manual, Installer None
Cert is due for renewal, auto-renewing...
Renewing an existing certificate
Performing the following challenges:
http-01 challenge for booknme.co.kr

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NOTE: The IP of this machine will be publicly logged as having requested this
certificate. If you're running certbot in manual mode on a machine that is not
your server, please ensure you're okay with that.

Are you OK with your IP being logged?
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
(Y)es/(N)o: y

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Create a file containing just this data:

ARjSt6N3NaO-4hoTosh9eed6WWpYJoa6DTEbTUjKWTc.lLIPvOSu22UsRTUocW42u_4Nw4e1n4etHwV71QK3foc

And make it available on your web server at this URL:

http://booknme.co.kr/.well-known/acme-challenge/

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Press Enter to Continue

위에 표시된 이름 그대로 파일명을 생성한다 => 'ARjSt6N3NaO-4hoTosh9eed6WWpYJoa6DTEbTUjKWTc'

경로는 [도메인 root 위치]/.well-known/acme-challenge 에다 넣는다.

그리고 파일 안에는 위에 표시된 문구를 넣는다.

정리하자면 다음과 같다.

cd [도메인 root 위치]/.well-known/acme-challenge
vi ARjSt6N3NaO-4hoTosh9eed6WWpYJoa6DTEbTUjKWTc

# vi 안애 내용을 아래대로 넣고 저장
ARjSt6N3NaO-4hoTosh9eed6WWpYJoa6DTEbTUjKWTc.lLIPvOSu22UsRTUocW42u_4Nw4e1n4etHwV71QK3foc

 

이제 브라우저에서 접속이 되는지 확인한다

[도메인]/.well-known/acme-challenge/ARjSt6N3NaO-4hoTosh9eed6WWpYJoa6DTEbTUjKWTc

 

토큰파일 안에 나오는 내용이 그대로 나오면 된다.

이제 터미널 에서 엔터를 눌러 마무리

Press Enter to Continue
Waiting for verification...
Cleaning up challenges

IMPORTANT NOTES:
 - Congratulations! Your certificate and chain have been saved at:
   /etc/letsencrypt/live/booknme.co.kr/fullchain.pem
   Your key file has been saved at:
   /etc/letsencrypt/live/booknme.co.kr/privkey.pem
   Your cert will expire on 2019-09-28. To obtain a new or tweaked
   version of this certificate in the future, simply run certbot-auto
   again. To non-interactively renew *all* of your certificates, run
   "certbot-auto renew"
 - If you like Certbot, please consider supporting our work by:

   Donating to ISRG / Let's Encrypt:   https://letsencrypt.org/donate
   Donating to EFF:                    https://eff.org/donate-le

끝.

반응형

댓글