Let’s Encrypt
いつもはcronで自動更新してるんだけど、なんでかできなくなった。
Unable to find a virtual host listening on port 80 which is currently needed for Certbot to prove to the CA that you control your domain. Please add a virtual host for port 80.. Skipping.
最初のエラー。port80が見つかんないよ~って言われてる気がする。サーバの構成がnginxでリバースプロキシ使ってApacheに振ってるせいかなーって思った。
なので、/etc/httpd/conf/httpd.conf に行って、virtual hostのセクションのポートを8080から80に戻した。
Some challenges have failed.. Skipping.
次のエラー。これの他に
Challenge failed for domain dalomo.net Error while running apachectl graceful. Job for httpd.service invalid.
とか
IMPORTANT NOTES: - The following errors were reported by the server: Domain: dalomo.net Type: unauthorized Detail: Invalid response from http://dalomo.net/.well-known/acme-challenge/W************************************ [140.227.173.32]: "<html>\r\n<head><title>502 Bad Gateway</title></head>\r\n <body>\r\n <center><h1>502 Bad Gateway</h1></center>\r\n <hr><center>nginx</cente" 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.
こんなのも。
https://qiita.com/ekzemplaro/items/523ba6026bce6d2a1846
とかなのかなーと思って、ディレクトリ作って
vi /etc/nginx/conf.d/reverse_proxy.confを
location ^~ /.well-known/acme-challenge/ { default_type "text/plain"; root /var/www/html/le/; }
てした。でもダメだった。
nginxを止めて更新
https://jijigrammer.info/programming/1115
こちらの記事を見つけたので
# systemctl stop nginx # certbot renew
てしたらいけた。うーむ 。
今後更新の際はこれやんないといけなくなるんだろか。