2024-03-29 12:06:44 +00:00
|
|
|
export MY_DOMAIN="my_domain"
|
|
|
|
|
2024-03-13 09:09:02 +00:00
|
|
|
apt install nginx
|
|
|
|
|
|
|
|
ufw allow 'Nginx HTTP'
|
|
|
|
|
2024-03-29 12:06:44 +00:00
|
|
|
mkdir -p /var/www/$MY_DOMAIN/html
|
|
|
|
chown -R $USER:$USER /var/www/$MY_DOMAIN/html
|
|
|
|
chmod -R 755 /var/www/$MY_DOMAIN
|
2024-03-13 09:09:02 +00:00
|
|
|
|
2024-03-29 12:06:44 +00:00
|
|
|
echo "Hello world" | /var/www/$MY_DOMAIN/html/index.html
|
2024-03-13 09:09:02 +00:00
|
|
|
|
2024-03-29 12:06:44 +00:00
|
|
|
cp basic_serverblock.txt /etc/nginx/sites-available/$MY_DOMAIN
|
2024-03-13 09:09:02 +00:00
|
|
|
|
2024-03-29 12:06:44 +00:00
|
|
|
ln -s /etc/nginx/sites-available/$MY_DOMAIN /etc/nginx/sites-enabled/
|
2024-03-13 09:09:02 +00:00
|
|
|
|
|
|
|
# sudo nano /etc/nginx/nginx.conf
|
|
|
|
server_names_hash_bucket_size 64;
|