・当ブログはアフィリエイト広告を利用しています。

Let’sEncrypt 証明書の自動更新

CentOS
この記事は約1分で読めます。
記事内には広告が含まれています。
CentOS7 appach2.4 インストール済み、初回証明者は取得済みの場合

Let’sEncryptで作成したSSL証明書を自動更新するには、クローンで証明書取得コマンド cerbotを自動実行する。

設定は次のようにした。

#vi /etc/cron.d/letsencrypt で設定ファイルを作成

00 04 10 * * root /bin/certbot renew --force-renew --webroot-path /var/www/html/ --post-hook "systemctl reload httpd"

設定ファイルの詳細

左から5項目     分、時、日、月、曜日 の順に実行時期を指定する。

*は全ての意味。今回の例では毎月10日4:00に実行される。

–webroot-path pathを指定し、webサーバーを停止することなく、SSL証明書の更新ができる。

–post-hook   処理後に実行するコマンド。今回はwebサーバーを再起動する。

後は、正常に実行されるか、待つのみ。朝起きたころには結果がわかるはず。

 

コメント

This website stores cookies on your computer. These cookies are used to provide a more personalized experience and to track your whereabouts around our website in compliance with the European General Data Protection Regulation. If you decide to to opt-out of any future tracking, a cookie will be setup in your browser to remember this choice for one year.Accept or Deny
タイトルとURLをコピーしました