2017-02-16 4 views
2

certbotを使用してLet's Encrypt証明書、 を適用しています。私のサーバーはcentos 7.2とnginx 1.11.9です。 これはどういう意味ですか?certbotを使用して証明書を暗号化しよう:承認手続きが無効

[[email protected] ~]# certbot certonly --webroot -w /var/www/www.example.com -d example.com -d www.example.com 

Failed authorization procedure. example.com (http-01): urn:acme:error:unauthorized :: The client lacks sufficient authorization :: Invalid response from http://example.com/.well-known/acme-ch 
<head><title>404 Not Found</title></head> 
<body bgcolor="white"> 
<center><h1>404 Not Found</h1></center> 
<hr><center>", www.example.com (http-01): urn:acme:error:unauthorized :: The client lacks sufficient authorization :: Invalid response from http://www.example.com/.well-known/acme-challenge/k 
<head><title>404 Not Found</title></head> 
<body bgcolor="white"> 
<center><h1>404 Not Found</h1></center> 
<hr><center>" 

IMPORTANT NOTES: 
- If you lose your account credentials, you can recover through 
    e-mails sent to [email protected] 
- The following errors were reported by the server: 

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

    Domain: www.example.com 
    Type: unauthorized 
    Detail: Invalid response from 
    http://www.example.com/.well-known/acme-challenge/kFJ0CSuKOdgcT2xmciB4GGNCcnUPoIbpQmA9jOII_Bk: 
    "<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 record(s) for that domain 
    contain(s) the right IP address. 
- Your account credentials have been saved in your Certbot 
    configuration directory at /etc/letsencrypt. You should make a 
    secure backup of this folder now. This configuration directory will 
    also contain certificates and private keys obtained by Certbot so 
    making regular backups of this folder is ideal. 

私はexample.comwww.example.comにアクセスすることができ、およびドキュメント内のノートがあります:https://certbot.eff.org/#centosrhel7-nginx

注: は、ウェブルートのプラグインを使用するには、サーバは隠しディレクトリからファイルを提供するように設定する必要があります。 /.well-knownがウェブサーバーの設定によって特別に扱われた場合は、/.well-known/acme-challenge内のファイルがWebサーバーによって提供されるように設定を変更する必要があります。

その理由はありますか? 設定を変更するにはどうすればよいですか?

答えて

2

これはかなり一般的な問題ですが、幸いなことに、簡単な修正が必要です。 Encryptで.well-knownディレクトリから読み取って、サーバーが実際に証明書を要求するドメインをホストしていることを確認できる必要があります。

まず、ウェブサイトのルートに.well-knownディレクトリがあることを確認します。外部からの読み取りが可能になるようにアクセス許可を設定します。 775は完璧でなければなりません。その後

、nginxの中に仮想ホストファイルにこのスニペットを追加します。これは、先ほど作成した.well知られているディレクトリへの要求を許可します

location ~ /.well-known { 
      allow all; 
    } 

。今度は、証明書を再度要求して、動作するかどうか確認してください。

+0

この回答は%100です。 –

関連する問題