Skip to content

Instantly share code, notes, and snippets.

@lohithn4
Last active December 20, 2022 15:19
Show Gist options
  • Save lohithn4/cc3c86c23b5c70a9ede4a75488913cf0 to your computer and use it in GitHub Desktop.
Save lohithn4/cc3c86c23b5c70a9ede4a75488913cf0 to your computer and use it in GitHub Desktop.

Revisions

  1. lohithn4 revised this gist May 30, 2022. 1 changed file with 33 additions and 0 deletions.
    33 changes: 33 additions & 0 deletions certbot
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,36 @@
    https://tecadmin.net/install-lets-encrypt-create-ssl-ubuntu/

    $ apt-get update
    $ sudo apt-get install certbot
    $ apt-get install python3-certbot-nginx

    $ sudo certbot --nginx -d example.com -d www.example.com

    server {
    listen 80 default_server;
    listen [::]:80 default_server;
    root /var/www/html;
    server_name example.com www.example.com;

    listen 443 ssl; # managed by Certbot

    # RSA certificate
    ssl_certificate /etc/letsencrypt/live/example.com/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem; # managed by Certbot

    include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot

    # Redirect non-https traffic to https
    if ($scheme != "https") {
    return 301 https://$host$request_uri;
    } # managed by Certbot
    }




    $crontab -e
    0 12 * * * sudo /usr/bin/certbot renew --quiet --standalone --pre-hook "service nginx stop" --post-hook "service nginx restart"


    https://www.digitalocean.com/community/tutorials/how-to-secure-apache-with-let-s-encrypt-on-ubuntu-20-04
  2. lohithn4 revised this gist Jan 29, 2022. 1 changed file with 3 additions and 1 deletion.
    4 changes: 3 additions & 1 deletion certbot
    Original file line number Diff line number Diff line change
    @@ -1 +1,3 @@
    https://tecadmin.net/install-lets-encrypt-create-ssl-ubuntu/
    https://tecadmin.net/install-lets-encrypt-create-ssl-ubuntu/

    https://www.digitalocean.com/community/tutorials/how-to-secure-apache-with-let-s-encrypt-on-ubuntu-20-04
  3. lohithn4 created this gist Jul 1, 2021.
    1 change: 1 addition & 0 deletions certbot
    Original file line number Diff line number Diff line change
    @@ -0,0 +1 @@
    https://tecadmin.net/install-lets-encrypt-create-ssl-ubuntu/