alpinelinuxにインストールしたnginxをlet's encryptでssl化する
certbotのインストール
1 |
apk add certbot |
証明書の生成はwebrootを使用しています。
standaloneを利用すると80ポートを使用している場合、証明書が生成されません。
webrootを利用することで稼働中のサーバでも証明書の生成が可能です。
1 |
certbot certonly --webroot -w /usr/share/nginx/html -d example.com -m test@example.com |
/etc/letsencrypt/live/example.com/配下に証明書が生成されます
エラー
There were too many requests of a given type :: Error creating new cert :: too many certificates already issued for: example.com
前回証明書を発行してからすぐに再発行しようとすると上記のエラーが出力されてしまいます。
-dオプションで複数のドメインに申請すれば、再申請可能です。
www.example.comはエラーになるドメインと同じAレコードを参照するように設定する必要があります。
1 |
certbot certonly --webroot -w /usr/share/nginx/html -d example.com -d www.example.com-m test@example.com |