set server timezone to Asia/Tehran:
dpkg-reconfigure tzdata
update server:
apt update -y
apt upgrade -y
apt dist-upgrade -y
apt autoremove -y
install the required tools:
apt install curl rsync screen cron supervisor iputils-ping dnsutils telnet net-tools ufw htop vim nano git tree bash-completion build-essential unzip apg -y
curl -sL https://deb.nodesource.com/setup_18.x | sudo -E bash -
apt install nodejs
node -v
npm -v
npm install pm2 -g
apt install nginx
sudo nano /etc/nginx/sites-available/default
server {
listen 80;
server_name example.com www.example.com;
root /var/www/html;
index index.html index.htm;
location / {
proxy_pass http://127.0.0.1:3000;
proxy_read_timeout 60;
proxy_connect_timeout 60;
proxy_redirect off;
# Allow the use of websockets
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
}
ssh-keygen -t rsa
cat /root/.ssh/id_rsa.pub