
ショコラ
certbotコマンドで証明書を更新するには?
ポート80を使っている nginx を止めて、
「certbot renew –dry-run」でテストして「certbot renew」でキメマス。

もっさん先輩
手順
- nginx を止めます。
service nginx stop
- サーバー証明書の更新テストをします。
certbot renew --dry-run
- サーバー証明書の更新します。
certbot renew
更新できなかった場合は↓こちらのコマンドで証明書を取得できます。
certbot certonly -d {ホスト名} -m {メールアドレス}
- nginx を開始します。
service nginx start
以上
30日の更新期限を切っていないくて証明書を更新するには –force-renew を付けます。
certbot renew --force-renew
証明書を取得後、リロードで証明書を更新できます。
service reload nginx
–post-hook で更新後にコマンドを実行することができます。
certbot renew --post-hook "systemctl reload nginx"
–cert-name で特定のサーバー証明書だけを更新することができます。
certbot renew --cert-name answorz.com