1. Install vpsmate
Run the following code in sequence:
Cd/usr/src/
Wget http://www.vpsmate.org/tools/install.py
Python install. py
You need the username and password to log on to the vpsmate administrator background.
The reason for choosing vpsmate is that it does not automatically install PHP, apache, and mysql, although it supports one-click installation of these server programs. Currently, vpsmate is mainly used to edit files and modify file permissions. These operations are visualized and easy to use.
After installation, you can use http: // your IP address: 8888 to open the vpsmate background.
2. Install nodejs
Download and install nodejs in the directory just now, and execute the following code in sequence:
Wget http://nodejs.org/dist/v0.10.25/node-v0.10.25.tar.gz
Yum install gcc openssl-devel gcc-c ++ compat-gcc-34 ++
Tar-xf node-v0.10.25.tar.gz
Cd node-v0.10.25
./Configure -- prefix =/usr/local/node
Make & make install
Ln-s/usr/local/node/bin/*/usr/sbin/
It takes a little longer to install nodejs v0.10.25.
After the installation is complete, npm is automatically installed.
Run the following command to test whether nodejs and npm are successfully installed:
Node-v
Npm-v
Use npm to install the global module cnpm (reference:/post/nodejs-learning-10-cnpm-supervisor.html ):
Npm install-g cnpm
After the installation is complete, enter the following command in the console:
Cnpm-v
>-Bash: cnpm: command not found
Apparently, the global module fails to be installed. Delete the global module and configure npm.
3. Configure npm
Run the following commands in sequence to configure npm:
Npm set prefix/usr/local
Echo-e '\ nexport PATH =/usr/local/lib/node_modules: $ PATH'> ~ /. Bashrc
Source ~ /. Bashrc
After installing the global module cnpm, complete the installation:
Cnpm-v
> 0.0.26
After the global module is successfully installed, you can use cnpm to install various global or local modules.
Now, the installation and configuration of npm in vpsmate and nodejs are very simple, and there are no problems in the installation process.