Linux setup Nodejs boot from boot

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.