Skip to content

Instantly share code, notes, and snippets.

@charly-vega
Last active December 13, 2016 19:54
Show Gist options
  • Save charly-vega/46f9c11d82d2f2402b989fb68a78ecb8 to your computer and use it in GitHub Desktop.
Save charly-vega/46f9c11d82d2f2402b989fb68a78ecb8 to your computer and use it in GitHub Desktop.
wget https://dl.eff.org/certbot-auto
chmod a+x certbot-auto
sudo mkdir -p /var/www/pokemon-go-chat-production.beta.uy
sudo vim /etc/nginx/sites-available/pgc_api_production.conf
# server {
# ...
# location /.well-known/acme-challenge {
# root /var/www/pokemon-go-chat-production.beta.uy;
# }
# }
sudo service nginx reload
./certbot-auto certonly --webroot -w /var/www/pokemon-go-chat-production.beta.uy -d pokemon-go-chat-production.beta.uy
# Check renewal
./certbot-auto renew --dry-run
# Schedule twice per day
crontab -e
# ********* NEEDS PASSWORDLESS SUDO *********
# 0 0,12 * * * /home/deploy-user/certbot-auto renew --quiet --no-self-upgrade
# tail /var/log/letsencrypt/letsencrypt.log
# Standalone mode (checked less frequently because of nginx interruption)
# ********* NEEDS PASSWORDLESS SUDO *********
# 0 6 1/2 * * /home/deploy-user/certbot-auto renew --standalone --pre-hook "service nginx stop" --post-hook "service nginx start"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment