Complete script

This commit is contained in:
Robert Partridge 2022-07-14 03:56:32 -04:00
parent 1c03f82a57
commit 212f0c895f
1 changed files with 32 additions and 6 deletions

View File

@ -1,19 +1,45 @@
#!/bin/bash
clear
# *****************************************************************************
# Script: setup-nginx-proxy / setup-nginx-proxy.sh
# Author: Robert Partridge
# URL: https://gitea.techaddressed.com/robert/setup-nginx-proxy
# *****************************************************************************
# Root Permissions Check
# check for root privileges
echo
if [ "$EUID" -ne 0 ]
then echo "PLEASE RUN THIS SCRIPT WITH ROOT PRIVILEGES"
exit
fi
# Update System
# update system
apt update && apt upgrade -y && apt autoremove -y && apt clean
# Install Packages
apt install nginx git
# install packages
apt install ntp nginx certbot ufw -y
# Retrieve Config Files
# copy scripts
mkdir ~/bin
cp scripts/*.sh ~/bin
# Setup Complete
# copy config files
cp config/example* /etc/nginx/sites-available/
cp config/mime.types /etc/nginx/
cp config/nginx.conf /etc/nginx/
cp config/cloudflare-only.conf /etc/nginx/
# restart services
systemctl restart nginx
# configure ufw firewall but do not enable
ufw allow 80/tcp
ufw allow 443/tcp
# complete
echo
echo
echo "SETUP COMPLETE"
echo "UFW SET TO ALLOW PORTS 80/TCP AND 443/TCP"
echo "IF NEEDED - MAKE ADDITIONAL FIREWALL MODIFICATIONS BEFORE ENABLING UFW"