0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Amazon Linux2のApacheにLet's Encrypt でHTTPS化

0
Posted at

手順

リポジトリとソフトウェアのインストール

amazon-linux-extrasでリポジトリのepel(Extra Package for Enterprise Linux)をインストールしました。
その後、certbot-apacheソフトウェアをインストールしました。

sudo amazon-linux-extras install epel
sudo yum install certbot-apache

参考
https://serverfault.com/questions/903780/how-to-install-certbot-on-amazon-linux-ec2

certbotの実行

sudo certbot --apache #オプションでcertonlyをつけて書き換え自身は自分で行うようにすることもできるみたいです

上記で実行して質問に答えたら終了!!
と思ったら、、、

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. Additionally, please check that your computer has a publicly routable IP address and that no firewalls are preventing the server from communicating with the client. If you're using the webroot plugin, you should also verify that you are serving files from the webroot path you provided.    

エラー発生!!

エラー解決

結論、EC2のインバウンドルールにHTTPのAnywhereを追加して誰でもアクセスできるようにすれば解決できました。

最初見たとき、EC2サーバ自身からドメインに対して問い合わせを行っていると思い、インバウンドルールにEC2のpublic IPを登録したのですが、そうではなく、Let's Encrypt 側からEC2にHTTPアクセスしているみたいです。

結果

image.png
上記のように中間証明書の署名とルート証明書の署名をもらうことができました。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?