Let's Encryptを使ってHTTPをHTTPSにする
・AmazonLinux2
下記ページを参考に、certbot-auto certonlyを実行する
Amazon Linux2でLet's Encryptを使う方法
しかし、うまくいかない。AuthorizationErrorが起きる。
ログにはunauthorizedDetail: Invalid response from ~と出ていた。
Let's Encrypt 証明書取得時に「Problem binding to port 80: Could not bind to IPv4 or IPv6.」発生時の対処法 | mebee
Apache及びhttpdを起動しているとだめらしいので止める。
systemctl stop httpd
実はいろいろ悩んで試行錯誤したのに、これですんなり行った
( 'ω` 、)もう…
後はhttpをhttpsに転送する設定
httpからhttpsにリダイレクトする方法と注意点について | キーワードファインダー
httpdのconfで、<VirtualHost *:80>に
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
を入れるよ。
はぁ…終わった…サーバと向き合うのつかれぴよ。