Let's Encrypt and Nginx – State of the art secure web deployment
21–30 of 85 posts
Re: Let's Encrypt and Nginx – State of the art secure web deployment
#22Just using caddy server seems a lot simpler...
Neat, I like that when started with no arguments/config it just serves the files in the current directory, but then you can customize it from there. I have "alias webserver='python -m SimpleHTTPServer'" in my shell config, but I think I'll switch to Caddy.
Re: Let's Encrypt and Nginx – State of the art secure web deployment
#23Earlier quoted context omitted.
http://www.cyberciti.biz/faq/linux-unix-crontab-change-mailt...
So the default behavior is to only email root unless crontab is edited, therefore most people would never receive an email (in case of renew failure), if they only followed the instructions given. Otherwise mail is sent to the owner of the crontab.
Re: Let's Encrypt and Nginx – State of the art secure web deployment
#24Here's the modified script using certonly and the --force-renew flag.
#!/bin/bash
# Force-renew the "Let's Encrypt" certificates for a given domain
# Run this as root as a BI-MONTHLY cron job
export DOMAINS="yourdomain.com,www.yourdomain.com"
export LOGFILE="/var/log/letsencrypt/renewal_yourdomain.log"
echo "Stopping nginx temporarily to renvew certificates for $DOMAINS ..."
service nginx stop
echo "Calling /opt/letsencrypt/letsencrypt-auto certonly --standalone --force-renew -d $DOMAINS"
if ! /opt/letsencrypt/letsencrypt-auto certonly --standalone --force-renew -d $DOMAINS > $LOGFILE 2>&1 ; then
echo "certonly call failed, restarting nginx"
service nginx start
echo "LOG info:"
cat $LOGFILE
# TODO: email administrator...
exit 1
fi
echo "certonly call succeeded, restarting nginx"
service nginx start
Note: don't run this as a daily cron job since this has --force-renew...Re: Let's Encrypt and Nginx – State of the art secure web deployment
#25 curl http://nginx.org/keys/nginx_signing.key | sudo apt-key add -
(This adds a key or keys downloaded over an unauthenticated http connection to one's Debian keyring, allowing whatever keys the network sends back to authenticate any future package updates.) I wrote to the author with a note expressing my concern.Re: Let's Encrypt and Nginx – State of the art secure web deployment
#26Just using caddy server seems a lot simpler...
Re: Let's Encrypt and Nginx – State of the art secure web deployment
#27I just use https://github.com/lukas2511/letsencrypt.sh/ single bash script. Add a config.sh and setup nginx alias. Then just add domains to the domains.txt and have the script run via cron daily. Finished
Re: Let's Encrypt and Nginx – State of the art secure web deployment
#28Just using caddy server seems a lot simpler...
You do need to restart Caddy in order to renew your cert, FWIW
Re: Let's Encrypt and Nginx – State of the art secure web deployment
#29Re: Let's Encrypt and Nginx – State of the art secure web deployment
#30The --webroot option doesn't work for my setup, so I need to shutdown nginx for 2-3 seconds and use the --standalone option. I set this as a CRON job that will run every two months. It's not elegant, but it's done. Here's the modified script using certonly and the --force-renew flag. #!/bin/bash # Force-renew the "Let's Encrypt" certificates for a given domain # Run this as root as a BI-MONTHLY cron job export DOMAIN…