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