Skip to content

Instantly share code, notes, and snippets.

@VasylShevchenko
Last active November 24, 2018 09:10
Show Gist options
  • Save VasylShevchenko/d5421f45fd2c8916c3f4168742ff72df to your computer and use it in GitHub Desktop.
Save VasylShevchenko/d5421f45fd2c8916c3f4168742ff72df to your computer and use it in GitHub Desktop.

Certbot

Working

  1. For get

    server {
      listen 80;
       location ^~ /.well-known {
        allow all;
        default_type "text/plain";
        root /etc/letsencrypt/live/;
      }
    }
  2. Create folder

    mkdir /etc/letsencrypt/live/.well-known
  3. Cron task https://stackoverflow.com/questions/41535546/how-do-i-schedule-the-lets-encrypt-certbot-to-automatically-renew-my-certificat

    sudo touch  /var/log/letsencrypt/renew.log
    cd /var/lib/letsencrypt
    sudo chmod 777 .
     crontab -e

    add in head

    # Certbot Let's Encrypt automatically renew  “Every week At 03:00 on Monday".
    0 3 * * 1 letsencrypt renew >> /var/log/letsencrypt/renew.log

    or with nginx reload

    # Certbot Let's Encrypt automatically renew  “Every week At 03:00 on Monday".
    0 3 * * 1 letsencrypt renew --renew-hook 'service nginx reload' >> /var/log/letsencrypt/renew.log
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment