20171102.png

certbot 을 설치해서 다음 명령어를 치니깐 위와 같은 오류가 떴습니다.

설치는 아래 방법대로 했습니다.

https://certbot.eff.org/#ubuntuxenial-nginx

 

# certbot certonly --webroot --webroot-path=/etc/nginx/ssl -d zibhapso.com -d www.zibhapso.com

 

certbot 설치해서 ssl 작업중인데 이런 오류는 왜 뜨는건지 혹시 아시나요^^;


root@linode:~# certbot certonly --webroot --webroot-path=/etc/nginx/ssl -d zibhapso.com -d www.zibhapso.com
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator webroot, Installer None
Obtaining a new certificate
Performing the following challenges:
http-01 challenge for zibhapso.com
http-01 challenge for www.zibhapso.com
Using the webroot path /etc/nginx/ssl for all unmatched domains.
Waiting for verification...
Cleaning up challenges
Failed authorization procedure. www.zibhapso.com (http-01): urn:acme:error:unauthorized :: The client lacks sufficient authorization :: Invalid response from http://www.zibhapso.com/.well-known/acme-challenge/2QwByR3pZr_X5fb7jZiyMlrGXw4k9tf1fqNIqWKkONM: "<html>
<head><title>404 Not Found</title></head>
<body bgcolor="white">
<center><h1>404 Not Found</h1></center>
<hr><center>", zibhapso.com (http-01): urn:acme:error:unauthorized :: The client lacks sufficient authorization :: Invalid response from http://zibhapso.com/.well-known/acme-challenge/o866JP-X7ZSqaD94lq6qSrHG7u4v9pLqCJWokw4Ujbo: "<html>
<head><title>404 Not Found</title></head>
<body bgcolor="white">
<center><h1>404 Not Found</h1></center>
<hr><center>"

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

   Domain: www.zibhapso.com
   Type:   unauthorized
   Detail: Invalid response from
   http://www.zibhapso.com/.well-known/acme-challenge/2QwByR3pZr_X5fb7jZiyMlrGXw4k9tf1fqNIqWKkONM:
   "<html>
   <head><title>404 Not Found</title></head>
   <body bgcolor="white">
   <center><h1>404 Not Found</h1></center>
   <hr><center>"

   Domain: zibhapso.com
   Type:   unauthorized
   Detail: Invalid response from
   http://zibhapso.com/.well-known/acme-challenge/o866JP-X7ZSqaD94lq6qSrHG7u4v9pLqCJWokw4Ujbo:
   "<html>
   <head><title>404 Not Found</title></head>
   <body bgcolor="white">
   <center><h1>404 Not Found</h1></center>
   <hr><center>"

   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.
 


수정하려면, 도메인 네임서버의 DNS A레코드값이랑 아이피랑 맞는지 체크해봐라고 하는데,

제가 다른 서버에도 동일하게 설정했거든요. @_@;

 

Certbot을 잘못 설치했는지 @_@;

  • profile

    webroot path가 맞나요?

     

    nginx에서 따로 설정을 해주지 않으면 /etc/nginx/ssl이 아니라 해당 계정 폴더 내에서

    .well-known/acme-challenge/랜덤파일명을 찾습니다.

    잘 보이지도 않는 .well-known 폴더를 여기저기 흘리고 다니게 되지요.

    certbot이 전체적으로 좀 지저분한 프로그램입니다 ㅠㅠ

  • profile profile
    1. 파일 : /etc/nginx/snippets/well-known.conf
    location /.well-known/acme-challenge {
    alias /etc/nginx/ssl/.well-known/acme-challenge;
    }
    ---------------------------------------------------------------------------
    2. 파일 : /etc/nginx/conf.d/domain.conf
    server {
    listen 80;
    server_name www.domain.com;

    location / {
    return 301 https://domain.com$request_uri;
    expires epoch;
    }

    include snippets/well-known.conf;
    }

    ---------------------------------------------------------------------------
    1. 엔진엑스에서 snippets 디렉토리를 생성해서, well-known.con 파일을 만들어서 1과 같이 작성해놓았습니다.
    2. 사이트의 conf 파일에서 해당 snippets/well-known.conf 파일을 불러오도록 설정했습니다.

    제가 초반에 뭘 잘못해서 다 잘 안되는거 같네요 @_@;
  • profile profile
    1. /etc/nginx/ssl 폴더는 있나요? 저 설정 적용 후 nginx 재시작하셨나요?
    2. 설정은 저것뿐인가요? 리다이렉트 대상 (www 없는) 도메인도 제대로 설정되어 있나요?
    3. /etc/letsencrypt 폴더를 삭제하거나 이름을 바꿔서 certbot 설정을 초기화한 후에 다시 시도해 보세요.
  • profile profile
    네, 계속 삽질하다 실패하고 오늘 또 몇시간 삽질했는데
    ssl 은 설치된거 같은데 https 로 접속이 안되네요.
    nginx 설정에서 tls 보안 설정 부분이 잘못된 건지, @_@