証明書だけ欲しかったので、certonly かつstandaloneでやった時のです。

certonly なLet's Encryptのやり方は、当ブログの以下の記事を参照してください。

  1. Amazon Linux support is very experimental at present...
  2. Problem binding to port 80
  3. unknownHost
  4. Timeout during connect (likely firewall problem)

Amazon Linux support is very experimental at present...

Requesting to rerun ./certbot-auto with root privileges...
FATAL: Amazon Linux support is very experimental at present...
if you would like to work on improving it, please ensure you have backups
and then run this script again with the --debug flag!
Alternatively, you can install OS dependencies yourself and run this script
again with --no-bootstrap.

Amazon Linuxでは、--debug オプションつけないとLet's Encryptできないらしい。

つける
./certbot-auto certonly --debug

Problem binding to port 80

Problem binding to port 80: Could not bind to IPv4 or IPv6.

ポート80が塞がってる!

うっかりhttpd上げっぱなしだったのが原因だったので、止めた。

unknownHost

 - The following errors were reported by the server:

   Domain: mydomain.piyo
   Type:   connection
   Detail: unknownHost :: No valid IP addresses found for mydomain.piyo

ドメインの名前解決ができない! nslookup で引けない状態だった。

お名前ドットコムで買ったドメイン名を、Amazon Route 53にホストゾーン作って使おうとした時に出た。Route 53のNSレコードに従ってお名前ドットコムでネームサーバーの設定をしたけど、Route 53にAレコードも作る必要があった。

Route 53にAレコードを作って、値にLet's EncryptするマシンのIPを設定したら名前解決できるようになり、このエラーも出なくなった。証明書だけ欲しかったので、全部うまくいった後、Aレコードは消した。

Timeout during connect (likely firewall problem)

 - The following errors were reported by the server:

   Domain: mydomain.piyo
   Type:   connection
   Detail: Fetching
   http://mydomain.piyo/.well-known/acme-challenge/7yjvEEV0K_3yKB1z7KR2jcMaeQHAGTJZjBoAJalrtXc:
   Timeout during connect (likely firewall problem)

ファイアウォールとかがだめ!

EC2のセキュリティグループで、インバウンドにポート80で穴を空ける必要があった。