Connect SSH as root user
ssh root@your-ip-address Password: enter-password
Login as site user
sudo su - <site-username>
Install Node Modules and Run the PM2 server
Change dir
Step 1: >> cd htdocs/<website name without protocol and www>
eg:
website: https://guidealolympiads.org/
website name: guidealolympiads.org
Remove file
>> rm -r <folder name>
Move file
>> mv path/ path/other/
Rename folder
>> mv path/ pathchanged/
In NGINX Server if we want to hide .php
.htaccess will not work in NGINX Server
if (!-e $request_filename) {
rewrite ^/(.*)$ /$1.php last;
}
Add this code inside Vhost
Example:
location / {
{{varnish_proxy_pass}}
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_hide_header X-Varnish;
proxy_redirect off;
proxy_max_temp_file_size 0;
proxy_connect_timeout 720;
proxy_send_timeout 720;
proxy_read_timeout 720;
proxy_buffer_size 128k;
proxy_buffers 4 256k;
proxy_busy_buffers_size 256k;
proxy_temp_file_write_size 256k;
# Adding your rewrite rules here
if (!-e $request_filename) {
rewrite ^/(.*)$ /$1.php last;
}
}
For ReactJS
First complete the steps
- Connect SSH
- Login to site user
- Change dir
- Delete site folder
Manual Transfer
- Create a folder with the website name ‘guidealolympiads.org’
- Upload zip file and unzip it
GitHub Clone
- >> git clone https://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@github.com/wododigital/Guideal_Olympiads.git
- rename
>> mv Guideal_Olympiads guidealolympiads.org
Create New Project
- npx create-react-app guidealolympiads.org
Or other commands to create projects
- cd guidealolympiads.org
- npm start or build
Add Subdomain in VPS
—-
Git
- git init .
- git remote add origin https://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@github.com/wododigital/wodo-digital-backend.git
- git remote set-url origin https://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@github.com/wododigital/wodo-digital-backend.git (Optional)
- git add .
- git commit -m “Initial commit”
Pm2
pm2 start app.js
Pm2 stop 0
Pm2 restart 0
Pm2 ls
git clone https://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@github.com/abhilash-malkar/ecommerce-panel-backend.git
https://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@github.com/abhilash-malkar/socket-connect-server.git
https://github.com/abhilash-malkar/socket-connect-server.git
git clone https://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@github.com/abhilash-malkar/hasiruagro-crm.git
- git remote add origin https://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@github.com/abhilash-malkar/hasiruagro-crm.git