前提・実現したいこと
サーバは初心者ですが、VPSを使ってショッピングサイトを作成することとなりました。
周りに質問できる人もおらず、ネットで調べるばかりでしたが、今回どうしてもわからなかったため、
ご質問させていただきます。
やったこと
- さくらインターネットのVPSにてcentos7をインストール
- httpd(apache)インストール
- 下記ページを参考にlet's encryptでSSL化
https://centossrv.com/apache-certbot.shtml
- 80,443ポートは開放
- EC-CUBE4.0.3をインストール
このSSLが更新期限が近付いており、更新したいのが
実現したいこととなります。
発生している問題・エラーメッセージ
手動にて
certbot renew --dry-run
のコマンドをしたところ下記のようなエラーになります。
IMPORTANT NOTES:
The following errors were reported by the server:
Domain: 〇〇〇〇〇.com
Type: unauthorized
Detail: Invalid response from
http://〇〇〇〇〇.com/.well-known/acme-challenge/nCiT5mmOC_PxQKCItWx21v-q7_iW5Tv_q4VQiWA35yo
[〇〇〇.〇〇.〇〇.〇〇〇]: "<!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.
また、エラーログを見ると下記のようなログがありました。
2020-01-20 15:48:23,693:DEBUG:acme.client:JWS payload:
2020-01-20 15:48:23,695:DEBUG:acme.client:Sending POST request to https://acme-staging-v02.api.letsencrypt.org/acme/authz-v3/33853098:
{
"protected": "eyJub25jZSI6ICIwMDAyQ0g5ZndvNkM0RUZFYVUtSWs4VVlkMThRY3VrdkFPYmpsRVFPcDkwMCIsICJ1cmwiOiAiaHR0cHM6Ly9hY21lLXN0YWdpbmctdjAyLmFwaS5sZXRzZW5jcnlwdC5vcmcvYWNtZS9hdXRei1y8zMzg1MzA5OCIsICJraWQiOiAiaHR0cHM6Ly9hY21lLXN0YWdpbmctdjAyLmFwaS5sZXRzZW5jcnlwdC5vcmcvYWNtZS9hY2N0LzEyMTQ4NzU0IiwgImFsZyI6ICJSUzI1NiJ9",
"payload": "",
"signature": "RemLZK7c5IeTLufxRaVD_vZexwXCJqHUhiNBl8um3oXa4Z0m3C4ltz_YmXVPk5M_IOhYi-sSkr4MZbKFXHrgrKRxGgBjO4tovQoKLbQQ8nFCrW7g52SC7G8Jmk3-qMHeK8lXrnWSNeN3iE5wDts87LzGKesuWZaE2VU_VCEicHyaknhODujs50rtv1iL2OAlhQsPKyL3sGpAxD8krrOMvyJ2vcspNMk_9uBfhrNezQC8cG_IxR7zg7i5cuwhZeL9Kx6w93ZXyFi9NzYYUqwNbZUsI75Ih9YywgqX_hawQ9-nz0GgkwVB1RWH4SThl02e824nNWkv6RkR9OQ"
}
2020-01-20 15:48:23,848:DEBUG:requests.packages.urllib3.connectionpool:"POST /acme/authz-v3/33853098 HTTP/1.1" 200 1222
2020-01-20 15:48:23,849:DEBUG:acme.client:Received response:
HTTP 200
content-length: 1222
cache-control: public, max-age=0, no-cache
strict-transport-security: max-age=604800
server: nginx
connection: keep-alive
link: https://acme-staging-v02.api.letsencrypt.org/directory;rel="index"
boulder-requester: 12148754
date: Mon, 20 Jan 2020 06:48:23 GMT
x-frame-options: DENY
content-type: application/json
replay-nonce: 0002HhNqVYZGLM5ECh72cmqO-nbAdi_YJamL7Vpwcdm8Tdo{
"identifier": {
"type": "dns",
"value": "〇〇〇〇〇.com"
},
"status": "invalid",
"expires": "2020-01-27T06:48:22Z",
"challenges": [
{
"type": "http-01",
"status": "invalid",
"error": {
"type": "urn:ietf:params:acme:error:unauthorized",
"detail": "Invalid response from http://〇〇〇〇〇.com/.well-known/acme-challenge/nCiT5mmOC_PxQKCItWx21v-q7_iW5Tv_q4VQiWA35yo [〇〇〇.〇〇.〇〇.〇〇〇]: "\u003c!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML 2.0//EN\"\u003e\n\u003chtml\u003e\u003chead\u003e\n\u003ctitle\u003e404 Not Found\u003c/title\u003e\n\u003c/head\u003e\u003cbody\u003e\n\u003ch1\u003eNot Found\u003c/h1\u003e\n\u003cp"",
"status": 403
},
"url": "https://acme-staging-v02.api.letsencrypt.org/acme/chall-v3/33853098/q0tq3w",
"token": "nCiT5mmOC_PxQKCItWx21v-q7_iW5Tv_q4VQiWA35yo",
"validationRecord": [
{
"url": "http://〇〇〇〇〇.com/.well-known/acme-challenge/nCiT5mmOC_PxQKCItWx21v-q7_iW5Tv_q4VQiWA35yo",
"hostname": "〇〇〇〇〇.com",
"port": "80",
"addressesResolved": [
"〇〇〇.〇〇.〇〇.〇〇〇"
],
"addressUsed": "〇〇〇.〇〇.〇〇.〇〇〇"
}
]
}
]
}
2020-01-20 15:48:23,849:DEBUG:acme.client:Storing nonce: 0002HhNqVYZGLM5ECh72cmqO-nbAdi_YJamL7Vpwcdm8Tdo
2020-01-20 15:48:23,850:WARNING:certbot.auth_handler:Challenge failed for domain 〇〇〇〇〇.com
2020-01-20 15:48:23,850:INFO:certbot.auth_handler:http-01 challenge for 〇〇〇〇〇.com
2020-01-20 15:48:23,850:DEBUG:certbot.reporter:Reporting to user: The following errors were reported by the server:Domain: 〇〇〇〇〇.com
Type: unauthorized
Detail: Invalid response from http://〇〇〇〇〇.com/.well-known/acme-challenge/nCiT5mmOC_PxQKCItWx21v-q7_iW5Tv_q4VQiWA35yo [〇〇〇.〇〇.〇〇.〇〇〇]: "<!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.
2020-01-20 15:48:23,851:DEBUG:certbot.error_handler:Encountered exception:
Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/certbot/auth_handler.py", line 90, in handle_authorizations
self._poll_authorizations(authzrs, max_retries, best_effort)
File "/usr/lib/python2.7/site-packages/certbot/auth_handler.py", line 154, in _poll_authorizations
raise errors.AuthorizationError('Some challenges have failed.')
AuthorizationError: Some challenges have failed.2020-01-20 15:48:23,851:DEBUG:certbot.error_handler:Calling registered functions
2020-01-20 15:48:23,851:INFO:certbot.auth_handler:Cleaning up challenges
2020-01-20 15:48:23,851:DEBUG:certbot.plugins.webroot:Removing /var/www/html/.well-known/acme-challenge/nCiT5mmOC_PxQKCItWx21v-q7_iW5Tv_q4VQiWA35yo
2020-01-20 15:48:23,852:DEBUG:certbot.plugins.webroot:All challenges cleaned up
2020-01-20 15:48:23,852:WARNING:certbot.renewal:Attempting to renew cert (〇〇〇〇〇.com) from /etc/letsencrypt/renewal/〇〇〇〇〇.com.conf produced an unexpected error: Some challenges have failed.. Skipping.
2020-01-20 15:48:23,853:DEBUG:certbot.renewal:Traceback was:
Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/certbot/renewal.py", line 449, in handle_renewal_request
main.renew_cert(lineage_config, plugins, renewal_candidate)
File "/usr/lib/python2.7/site-packages/certbot/main.py", line 1208, in renew_cert
renewed_lineage = _get_and_save_cert(le_client, config, lineage=lineage)
File "/usr/lib/python2.7/site-packages/certbot/main.py", line 116, in _get_and_save_cert
renewal.renew_cert(config, domains, le_client, lineage)
File "/usr/lib/python2.7/site-packages/certbot/renewal.py", line 307, in renew_cert
new_cert, new_chain, new_key, _ = le_client.obtain_certificate(domains, new_key)
File "/usr/lib/python2.7/site-packages/certbot/client.py", line 348, in obtain_certificate
orderr = self._get_order_and_authorizations(csr.data, self.config.allow_subset_of_names)
File "/usr/lib/python2.7/site-packages/certbot/client.py", line 384, in _get_order_and_authorizations
authzr = self.auth_handler.handle_authorizations(orderr, best_effort)
File "/usr/lib/python2.7/site-packages/certbot/auth_handler.py", line 90, in handle_authorizations
self._poll_authorizations(authzrs, max_retries, best_effort)
File "/usr/lib/python2.7/site-packages/certbot/auth_handler.py", line 154, in _poll_authorizations
raise errors.AuthorizationError('Some challenges have failed.')
AuthorizationError: Some challenges have failed.2020-01-20 15:48:23,854:ERROR:certbot.renewal:The following certs could not be renewed:
2020-01-20 15:48:23,854:ERROR:certbot.renewal: /etc/letsencrypt/live/〇〇〇〇〇.com/fullchain.pem (failure)
2020-01-20 15:48:23,855:DEBUG:certbot.log:Exiting abnormally:
Traceback (most recent call last):
File "/bin/certbot", line 9, in <module>
load_entry_point('certbot==0.38.0', 'console_scripts', 'certbot')()
File "/usr/lib/python2.7/site-packages/certbot/main.py", line 1378, in main
return config.func(config, plugins)
File "/usr/lib/python2.7/site-packages/certbot/main.py", line 1287, in renew
renewal.handle_renewal_request(config)
File "/usr/lib/python2.7/site-packages/certbot/renewal.py", line 474, in handle_renewal_request
len(renew_failures), len(parse_failures)))
Error: 1 renew failure(s), 0 parse failure(s)
試したこと
ネットで調べてみると.well-known/acme-challenge/にアクセスできないことが原因 ということなんだろうとは思うのですが、
下記を試してみましたが、すべて同じエラーとなってしまいます。
・.well-known/acme-challenge/を作成してみて試した。
・httpdをstopして試した。
・ECCUBEのリダイレクト等が原因かと思い、index.phpとhtaccessを一度削除して試した。
・certbot renew --dry-run ではなく、もともと打ち込んだコマンドを使って試した。
certbot certonly --webroot -w /var/www/html -m アドレス -d ドメイン --agree-tos
ショッピングサイトですが、本格始動していないのもあり、サーバとめたり等も今ならできます。
ただ、2/7がlet's encryptの更新期限となっており、それまでになんとかしたいもので、焦っております。。
どなたかご助力いただけると助かります。
情報として足りないものがあれば開示します。
よろしくお願いします。
追記
その後、調べてみた追記となります。
httpへアクセスするとhttpsにリダイレクトしてしまう設定が問題を起こしているのかもしれないと思い、
httpd.conf内に書いてあった
<VirtualHost *:80>
ServerAdmin root@〇〇〇〇〇.com
DocumentRoot /var/www/html
ServerName 〇〇〇〇〇.com
RewriteEngine on
RewriteCond %{SERVER_NAME} =〇〇〇〇〇.com
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>
のRewrite関連の部分を
#RewriteEngine on
#RewriteCond %{SERVER_NAME} =〇〇〇〇〇.com
#RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanen
にしてみて
certbot certonly --webroot -w /var/www/html -m アドレス -d ドメイン --agree-tos
を試してみたのですが
ダメでした・・
なお、httpでアクセスするとinternalservererrorになり、well-known/も同様にinternalservererrorとなりました。
let's encryptのwel-knownの部分のエラーも「404Not Found」から「500 Internal Server」に変わったのですが、
このあたりは関係してきますでしょうか。
何もわからずすみません。
回答1件
あなたの回答
tips
プレビュー