Clean structure and update readme to reflect use of python.

This commit is contained in:
James Grogan 2024-03-29 12:49:42 +00:00
parent bda8084172
commit 90b25e600b
5 changed files with 16 additions and 6 deletions

View file

@ -0,0 +1,15 @@
server {
listen 80;
listen [::]:80;
root /var/www/your_domain/html;
index index.html index.htm index.nginx-debian.html;
server_name your_domain www.your_domain;
location / {
try_files $uri $uri/ =404;
}
}

View file

@ -0,0 +1,18 @@
export MY_DOMAIN="my_domain"
apt install nginx
ufw allow 'Nginx HTTP'
mkdir -p /var/www/$MY_DOMAIN/html
chown -R $USER:$USER /var/www/$MY_DOMAIN/html
chmod -R 755 /var/www/$MY_DOMAIN
echo "Hello world" | /var/www/$MY_DOMAIN/html/index.html
cp basic_serverblock.txt /etc/nginx/sites-available/$MY_DOMAIN
ln -s /etc/nginx/sites-available/$MY_DOMAIN /etc/nginx/sites-enabled/
# sudo nano /etc/nginx/nginx.conf
server_names_hash_bucket_size 64;

View file

@ -0,0 +1,23 @@
export MY_USER="my_user"
# Create non-root user
adduser $MY_USER
usermod -aG sudo $MY_USER
# Set up firewall
ufw allow OpenSSH
ufw enable
# Disable ssh password login
# sudo nano /etc/ssh/sshd_config
# PermitRootLogin no
# PasswordAuthentication no
# ChallengeResponseAuthentication no
# UsePAM no
# sudo systemctl restart ssh
# Enable ssh login
rsync --archive --chown=$MY_USER:$MY_USER ~/.ssh /home/$MY_USER
# Fail2ban for SSH
apt install fail2ban