From 97c66fdcbe71f10e31b9d442dc5c19d9efe84cc1 Mon Sep 17 00:00:00 2001 From: openoms Date: Mon, 25 Oct 2021 18:58:16 +0100 Subject: [PATCH] add certbot commands --- BTCPayServer/certbot.md | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 BTCPayServer/certbot.md diff --git a/BTCPayServer/certbot.md b/BTCPayServer/certbot.md new file mode 100644 index 0000000..3542e8a --- /dev/null +++ b/BTCPayServer/certbot.md @@ -0,0 +1,26 @@ +# Certbot commands + +``` +echo "Input your email:" +read EMAIL + +echo "Input 3 subdomains separated with commas (eg: pay.example.com,tips.example.com,status.example.com)" +read SUBDOMAINS + +firstDomain=$(echo $SUBDOMAINS|cut -d"," -f1) +``` + +* see details of a certificate +``` +sudo openssl x509 -in /etc/letsencrypt/live/$firstDomain/fullchain.pem -text +``` + +* force renewal +``` +sudo certbot certonly --force-renewal -a standalone -m $EMAIL --agree-tos -d $SUBDOMAINS --expand -n --pre-hook "service nginx stop" --post-hook "service nginx start" +``` + +* logs +``` +sudo tail -n100 /var/log/letsencrypt/letsencrypt.log +``` \ No newline at end of file