How to deploy the node environment under CentOS

Source: Internet
Author: User
Tags install node

From this year onwards, the home of the car to the PC and M-end of the site, the server from Tomcat all changed to node, regardless of the test environment, quasi-production, formal environment, we need to deploy node in the server, here I give you a detailed description of the next node in the Linux environment is how to deploy.

1. Installation of Nodejs compilation and dependency related software

CURL-SL Https://rpm.nodesource.com/setup | Bash-

2. Install node

Yum Install-y Nodejs

3. Install git

NPM Install Git-g

4. Install NVM

For different scenarios, we often switch to different node versions to facilitate our development

wget https://

or clone it to a local via git.

git clone https://github.com/cnpm/nvm.git

Tar-XZVF file.tar.gz after decompression into the directory and then execute.  ~/.bash_profile input nvm, display command interface, on behalf of successful installation

5. Manage node via NVM installation

List all the node versions that can be installed

NVM list-remote

Install the appropriate node version

NVM Install v4.3.0

Check out the version you are currently installing

NVM ls

Toggle the corresponding node version

NVM use v4.4.0

Set the default node version

default v6.2.0

6. Install and configure Nginx

Yum Install Nginx

Open Nginx configuration file

Vim/etc/nginx/nginx.conf the Nginx Proxy to node's 8080 port server {    / {        proxy_pass http:// localhost:8080;     }}

Re-start Nginx

sudo nginx-s reload

Now everyone should be able to access their node service via IP.


How to deploy the node environment under CentOS

Related Article

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.