単一のマシン(単一IP)に対して、複数のDNS(http)で紐付ける(by Let's Encrypt)

https://aaa.com   https://bbb.org  がそれぞれ単一のPC(IP)を参照する方法のメモ

Let's Encrypt の certbot コマンドを使用して、SAN (Subject Alternative Names) を使用して複数のドメイン名を含む証明書を取得することで出来ます。

certbot certonly オプションを使用して、SAN 証明書を取得します。
-d オプションを複数並べるだけです。

$ certbot certonly --webroot -w /var/www/html -d aaa.com bbb.org

The following errors were reported by the server: Domain: xxx.org Type: unauthorized Detail: xxx.xxx.xxx.xxx: Invalid response from http://bbb.org/.well-known/acme-challenge/JSN2HlOo2asQ3DuWEd7DkZ5AKtzs-FJGyy5EXsci2cc: 404 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

もし上記のようなエラーが出た場合、認証局からの http://bbb.org/.well-known/acme-challenge/JSN2HlOo2asQ3DuWEd7DkZ5AKtzs-FJGyy5EXsci2cc   に対するアクセスへレスポンスを返せてない可能性が高いです。その場合は --apache を加えることで回避できます。(apacheが稼働している場合)

証明書を取得できたら、強制的に更新します。

$ certbot renew --force-renew



この記事が気に入ったらサポートをしてみませんか?