Last active
January 29, 2019 09:57
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Ubuntu | |
sudo apt install certbot | |
# AmazonLinux2 | |
sudo yum install certbot |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo su | |
cd /etc/letsencrypt | |
rm -frv ./* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo su | |
mkdir -p /var/www/letsencrypt | |
cd /var/www/letsencrypt | |
git clone https://github.com/disco-v8/DirectEdit.git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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