PC & IT SUPPORT MADE EASY FORUM
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Easy SSL Script For Secure Linux Web Server

Go down

Easy SSL Script For Secure Linux Web Server Empty Easy SSL Script For Secure Linux Web Server

Post by jamied_uk 4th January 2020, 14:21

Vid



Code:
#!/bin/bash
# (c) J~Net 2020
# https://jnet.forumotion.com/t1680-easy-ssl-script-for-secure-linux-web-server#2594
#
# Usage Instructions:
#
#  ./setup.sh  (for 1 domain)
#
#  ./setup.sh  primary_domain second_domain      (for 2 domains).
#                                       
# More info @
# https://certbot.eff.org/all-instructions
#
if [ "$#" -eq  "0" ]
  then
    echo "Setting up ssl secure web server for Ubuntu Other"
    wget https://dl.eff.org/certbot-auto
    sudo mv certbot-auto /usr/local/bin/certbot-auto
    sudo chown root /usr/local/bin/certbot-auto
    sudo chmod 0755 /usr/local/bin/certbot-auto
    sudo /usr/local/bin/certbot-auto --apache
    echo "Adding Auto Renewal!"
    echo "0 0,12 * * * root python -c 'import random; import time; time.sleep(random.random() * 3600)' && /usr/local/bin/certbot-auto renew" | sudo tee -a /etc/crontab > /dev/null
    echo "All Done!"
else
    echo "Setting up ssl secure web server for Ubuntu Other"
    wget https://dl.eff.org/certbot-auto
    sudo mv certbot-auto /usr/local/bin/certbot-auto
    sudo chown root /usr/local/bin/certbot-auto
    sudo chmod 0755 /usr/local/bin/certbot-auto
    sudo /usr/local/bin/certbot-auto --apache -d $1 -d $2
    echo "Adding Auto Renewal!"
    echo "0 0,12 * * * root python -c 'import random; import time; time.sleep(random.random() * 3600)' && /usr/local/bin/certbot-auto renew" | sudo tee -a /etc/crontab > /dev/null
    echo "All Done!"
fi


Last edited by jamied_uk on 4th January 2020, 15:02; edited 3 times in total
jamied_uk
jamied_uk
Admin

Posts : 2943
Join date : 2010-05-09
Age : 41
Location : UK

https://jnet.sytes.net

Back to top Go down

Easy SSL Script For Secure Linux Web Server Empty Re: Easy SSL Script For Secure Linux Web Server

Post by jamied_uk 4th January 2020, 14:31

There is an option to redirect to secure (all traffic) option 2 i choose this to force security!
all the info you need:

your email and domain name for me its jnet.sytes.net
always say yes to continue a to agree terms and no to public your email!
jamied_uk
jamied_uk
Admin

Posts : 2943
Join date : 2010-05-09
Age : 41
Location : UK

https://jnet.sytes.net

Back to top Go down

Easy SSL Script For Secure Linux Web Server Empty Re: Easy SSL Script For Secure Linux Web Server

Post by jamied_uk 4th January 2020, 14:43

To setup for multiple domains

digitalocean.com/community/tutorials/how-to-secure-apache-with-let-s-encrypt-on-ubuntu-18-04

Code:
sudo certbot --apache -d your_domain -d www.your_domain
jamied_uk
jamied_uk
Admin

Posts : 2943
Join date : 2010-05-09
Age : 41
Location : UK

https://jnet.sytes.net

Back to top Go down

Easy SSL Script For Secure Linux Web Server Empty Re: Easy SSL Script For Secure Linux Web Server

Post by jamied_uk 4th January 2020, 15:19

This script is for public domains not internal private certs!
so locally you may get warnings but public side you wont get warnings!
jamied_uk
jamied_uk
Admin

Posts : 2943
Join date : 2010-05-09
Age : 41
Location : UK

https://jnet.sytes.net

Back to top Go down

Easy SSL Script For Secure Linux Web Server Empty Re: Easy SSL Script For Secure Linux Web Server

Post by Sponsored content


Sponsored content


Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum