Cloud Server Deployment nodejs project

2019 two-eleven was cheated buy someone else with a cloud server, as long as 86 dollars a year, are interested click on the link https://www.aliyun.com/1111/2019/group-buying-share?ptCode=3C05AC6660F8A9085026B2602C1FAD93647C88CF896EF535&share_source = copy_link into buying two-eleven for the first time to buy a discount.

Cloud server deployment nodejs project, I chose to install the system centOS of liunx

1: access to remote connection installed nodejs, due to the local installation fails, I used yum install successfully,

  Installation Commands

yum install -y nodejs 
then installed by default node version is too low, you want to upgrade to a specific version, execute the command
curl --silent --location https://rpm.nodesource.com/setup_10.x | sudo bash
yum -y install nodejs
And then restart the server cloud, reference https://www.jianshu.com/p/e9db0baf781b
2: nodejs project running on a cloud server, for example 1.js documents directly cd to the next folder and execute node 1.js in the cloud open the corresponding port on the server, with specific reference to https://blog.csdn.net/a909301740/article/details/79145146
after you can add your public network ip port access project after your nodejs, but close the command line the corresponding process will disappear, so we use pm2 to guard our process
3: install pm2: npm install pm2 -g
then pm2 start 1.js
you can run your project, even close liunx command line, close the remote connection, the process has been running, the port can also access specific pm2 reference https://www.cnblogs.com/wangcp-2014/p/10874417.html

4
: upload local files to a remote liunx, can be downloaded aids Xftp 6 file transfer, installation and use of specific Baidu Xftp6.

Guess you like

Origin www.cnblogs.com/yck123/p/11829423.html