A chance to know that there is nodejs this thing, it is really interested in it. Just started to know that it can let JavaScript write backstage, and then the front and back of the platform are written by JavaScript, really feel very cool, after all, people always like to work in their own familiar areas. Then on the virtual machine installed a Linux centos6.5, forget how to install the Nodejs, and then on top of a simple server, really is quite fun, and gradually like the Nodejs. Since the reload system, a lot of things to be re-installed, Linux is no exception, the inside of the nodejs of course, looked for a long time to install Nodejs, finally found a good stackoverflow to find a better description of how to install on the CentOS nodejs! But still want to write down the installation process, forget it!
Perpare (Preparation)
There should be three tools before you compile and install Nodejs
1 C + + compilers such as GCC
Reason: Because C + + compilation is required at Nodejs compile time
Detection: The command can be knocked on Linux terminal gcc-v
My situation:
2 Python2.6 or more
Cause: Python environment is also required for Nodejs compilation
Detection: The command can be knocked on Linux terminal python–version
My situation: Python 2.6.6
No python download, version less than 2.6 to upgrade
3 Openssl-devel
Reason: Provide SSL/TLS encryption verification to ensure communication security
Detection: You can knock commands on Linux endpoints OpenSSL version
My situation: OpenSSL 1.0.1e-fips 2013
No, download is not difficult, just knock on the command line yum install Openssl-devel
Procedure (STEP)
1 Entering the/usr/local/src folder
Reason: In fact, you can choose to download the directory, but we want to classify. /usr/local This folder is a program that you install manually on behalf of
Command: CD/USR/LOCAL/SRC
2 getting the Nodejs package from the network
Reason: Paddle, to play Nodejs must have Nodejs bag.
Command: wget http://nodejs.org/dist/node-latest.tar.gz
Off-topic: 13M or so, or relatively few
3 Unzip the node-latest.tar.gz in the/usr/local/src folder
Command: Tar zxvf node-latest.tar.gz
Personal situation: After decompression in the/usr/local/src appear a folder is node-v0.10.28 (different words, should be version different, nothing)
4 into the Unpacked folder node-v0.10.28
Command: CD node-v0.10.28
5 Compiling and installing the trilogy
Command:
./configure
Make && make install
Off-topic: it seems to be installed for a long time, at least 10 minutes, and there is my on this./configure command is not very familiar, it should be possible to configure some parameters
6 Check for installation success
4, configure Node_home, enter the profile edit environment variable
Vim/etc/profile
Set the NODEJS environment variable to add the following on the export PATH USER LOGNAME MAIL HOSTNAME histsize Histcontrol Line:
#set for Nodejs
Export node_home=/usr/local/node/0.10.24
Export path= $NODE _home/bin: $PATH
: Wq Save and exit, compile/etc/profile make configuration effective
Source/etc/profile
Verify that the installation configuration is successful
Node-v
Output v0.10.24 indicates a successful configuration
centos6.5 installing node. js