LetsEncrypt サーバ証明書を自動更新する
2282 ワード
これはなに
サーバ証明書を自動更新するようにした際のメモ。
1. certbot-auto 版
1-1. 更新バッチ
/root/certbot/
に certbot-auto
が置いてある前提。
/root/certbot/renew.sh
#!/bin/bash
/root/certbot/certbot-auto renew --post-hook "systemctl restart nginx"
mail -s "`hostname` executed certbot-auto renew, status: $?" <to-mail_address> < /dev/null
1-2. crontab
毎週月曜 5:01 に実行。
1 5 * * 1 /root/certbot/renew.sh >/dev/null 2>&1
2. certbot 版
2-1. 更新バッチ
/root/letsencrypt/renew.sh
#!/bin/bash
certbot renew --post-hook "systemctl restart nginx"
mail -s "`hostname` executed certbot renew, status: $?" <to-mail_address> < /dev/null
2-2. crontab
1 5 * * 1 /root/letsencrypt/renew.sh >/dev/null 2>&1
/root/letsencrypt/renew.sh
#!/bin/bash
certbot renew --post-hook "systemctl restart nginx"
mail -s "`hostname` executed certbot renew, status: $?" <to-mail_address> < /dev/null
1 5 * * 1 /root/letsencrypt/renew.sh >/dev/null 2>&1
Author And Source
この問題について(LetsEncrypt サーバ証明書を自動更新する), 我々は、より多くの情報をここで見つけました https://qiita.com/minoru_nagasaka/items/51755657463370d68c6f著者帰属:元の著者の情報は、元のURLに含まれています。著作権は原作者に属する。
Content is automatically searched and collected through network algorithms . If there is a violation . Please contact us . We will adjust (correct author information ,or delete content ) as soon as possible .