This setup assumes you're using the server through ssh
For a new server go through the following steps:
- Create a user, the scripts are made for a 'dev' user, unless a certain reason i suggest just going along with that
- Once the dev user is created, sign out of root and ssh back in with the dev user (
ssh dev@IP-ADDRESS
) - Set up nginx for hosting your websites
- Add a domain
Start with:
curl -s -L https://raw.githubusercontent.com/Storken/webhost-setup/main/install.sh -o install.sh && bash install.sh && rm install.sh
This will ask if you want to create a user and then you'll be prompted for a password and user info.
Install nginx and set up firewall
curl -s -L https://raw.githubusercontent.com/Storken/webhost-setup/main/install-nginx.sh -o install-nginx.sh && bash install-nginx.sh && rm install-nginx.sh
Create nginx configurations for a new domain and create a directory to add html and other website files.
curl -s -L https://raw.githubusercontent.com/Storken/webhost-setup/main/add-domain.sh -o add-domain.sh && bash add-domain.sh && rm add-domain.sh
After this you can add your website files in /var/www/DOMAIN/html/