All reference steps for setting up VPS in Azure

0. Keep system updated

sudo apt-get update        # Fetches the list of available updates
sudo apt-get upgrade       # Strictly upgrades the current packages
sudo apt-get dist-upgrade  # Installs updates (new ones)
sudo apt-get autoremove
sudo reboot

1. How to enable root?

sudo passwd root

2. Enable SSH for root?

sudo nano /etc/ssh/sshd_config

Add a line in the Authentication section of the file that says PermitRootLogin yes.

# Authentication:
#LoginGraceTime 2m
PermitRootLogin yes
#StrictModes yes
#MaxAuthTries 6
#MaxSessions 10

Save the updated /etc/ssh/sshd_config file.

Restart the SSH server

service sshd restart

3. Install Nginx.

sudo apt update
sudo apt install nginx

4. Create a link site

ln -s /etc/nginx/sites-available/ /etc/nginx/sites-enabled/

Restart nginx

service nginx restart

4. Install .Net Core Runtime

wget -O packages-microsoft-prod.deb

sudo dpkg -i packages-microsoft-prod.deb

sudo apt-get update

sudo apt-get install -y apt-transport-https

sudo apt-get update

sudo apt-get install -y aspnetcore-runtime-3.1

5. Install Certbot

sudo apt install certbot python3-certbot-nginx

sudo certbot --nginx -d

6. Install supervisor

sudo apt-get install supervisor
sudo nano /etc/supervisor/conf.d/hwapp.conf
command=/usr/bin/dotnet /var/www/

Restart supervisor

sudo service supervisor restart
sudo tail -f /var/log/supervisor/supervisord.log

10. Install unzip

sudo apt-get install -y unzip

11. Change owner of a folder

sudo chown -R www-data:www-data

Leave a Reply

Your email address will not be published. Required fields are marked *