System: CENTOS7
Tools: Xshell, Xftp
Because the client server switched from the Windows system to the Linux system, the node servers that were originally deployed on Windows need to be migrated to a Linux server.
1. Node installation
Node website (http://nodejs.cn/download/) downloads the latest Linux version of the NODEJS program.
Use xftp to put the node compression package on Linux and unzip ...
Https://www.cnblogs.com/liuqi/p/6483317.html refer to someone else's written installation tutorial to complete the installation.
2. Set the node server to boot from
Various methods such as "Modify/etc/rc.local file", "Add node file to/etc/init.d/" have not worked. Helpless under open Google input English search, sure enough to find the answer on the StackOverflow https://stackoverflow.com/questions/35704294/ How-to-start-node-js-service-automatically-on-centos-6-7
Specific steps:
Installing the PM2 tool
# NPM Install Pm2-g
Set the node server as a service
PM2 start app.js--name="ourwayapp"
Set PM2 to boot
PM2 Startup
Telnet the server, port on the other server. Done!
Note: Be sure to create a service with the root user, or the program may encounter a "Permission denied" error.
Linux setup Nodejs boot from boot