certbotで証明書が更新された際に自動でapacheをreload

  • 投稿日:
  • by

まずはインストール

>sudo apt install certbot python3-certbot-apache

続いてcli.iniの修正。赤字を追加

>sudo vi /etc/letsencrypt/cli.ini

# Because we are using logrotate for greater flexibility, disable the
# internal certbot logrotation.
max-log-backups = 0
# Adjust interactive output regarding automated renewal
preconfigured-renewal = True

post-hook = "/usr/bin/sudo /usr/bin/systemctl reload apache2.service"

これでOK!