Let’s Encrypt†[edit]
- Let's ncrypt のサーバ証明書の自動発行・更新用スクリプト
# yum install epel-release
# yum install certbot
- certbot certonly --webroot -w /home/apache/htdocs -d www.nsl.tuis.ac.jp
- DocumentRoot にファイルを作って,サーバでそれをチェックしているみたい(サーバの存在確認)
- サーバ証明書と秘密鍵が以下にできる.(シンボリックリンク)
- 証明書:/etc/letsencrypt/live/www.nsl.tuis.ac.jp/fullchain.pem
- 秘密鍵:/etc/letsencrypt/live/www.nsl.tuis.ac.jp/privkey.pem
月一または週一 毎日で以下の cronを流す.
00 3 * * * /usr/bin/certbot renew 1>/dev/null 2>&1 && /etc/init.d/httpd restart 1>/dev/null 2>&1
- これだと 更新が無い場合も httpd が再起動する.
for Jupyterhub†[edit]
05 4 * * * /usr/bin/certbot renew --post-hook "touch /tmp/certs_changed" 1>/dev/null 2>&1 && /usr/local/bin/restart-network-service 1>/dev/null 2>&1