Skip to content

Instantly share code, notes, and snippets.

@modeverv
Last active January 29, 2019 09:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save modeverv/2d761261a8c6f45d724d453b33d567bd to your computer and use it in GitHub Desktop.
Save modeverv/2d761261a8c6f45d724d453b33d567bd to your computer and use it in GitHub Desktop.
Let's Encryptのワイルドカード証明書の取得と自動更新について(MyDNS)(2018/08現在) ref: https://qiita.com/lovesaemi/items/ed4db2be5eebae69202d
# Ubuntu
sudo apt install certbot
# AmazonLinux2
sudo yum install certbot
sudo su
cd /etc/letsencrypt
rm -frv ./*
sudo su
mkdir -p /var/www/letsencrypt
cd /var/www/letsencrypt
git clone https://github.com/disco-v8/DirectEdit.git
sudo su
certbot certonly --manual \
--preferred-challenges=dns \
--manual-auth-hook /var/www/letsencrypt/DirectEdit/txtregist.php \
--manual-cleanup-hook /var/www/letsencrypt/DirectEdit/txtdelete.php \
-d lovesaemi.daemon.asia -d *.lovesaemi.daemon.asia \
--server https://acme-v02.api.letsencrypt.org/directory \
--agree-tos -m あなたのメールアドレス \
--manual-public-ip-logging-ok
# Apacheの場合
certbot renew --force-renew --dry-run --webroot-path /var/www/html/ --post-hook "systemctl reload httpd"
# H2Oの場合
certbot renew --force-renew --dry-run --webroot-path /var/www/html/ --post-hook "systemctl reload h2o"
# Ubuntu
0 0 */5 * * /usr/bin/certbot renew --webroot-path /var/www/html/ --post-hook "/bin/systemctl reload h2o" >> /var/www/letsencrypt/update.log 2>&1
# とか
# AmazonLinux2
0 0 */10 * * /bin/certbot renew renew--webroot-path /var/www/html/ --post-hook "/bin/systemctl reload httpd" /dev/null 2>&1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment