node. js

Source: Internet
Author: User

1, create a new directory in the root directory/down, to save the downloaded files

# Mkdir/down

Cd/down

2. Installing node. JS Related Software

First to install GCC gcc-g++ openssl-devel

# yum Install gcc gcc-g++ openssl-devel

Yum Install-y bzip2*

3. Download Python 2.7

#wget http://www.python.org/ftp/python/2.7.3/Python-2.7.3.tgz

Unzip the installation

#tar ZXVF python-2.7.3.tgz

#cd Python-2.7.3

#./configure && make && make install

Restart View version: Python–v for 2.7.3

4. Download node. JS Decompression Installation

# Cd/down

# wget http://nodejs.org/dist/v0.8.14/node-v0.8.14.tar.gz

# tar ZXVF node-v0.8.14.tar.gz

# CD node-v0.8.14

#./configure && make && make install

This could take a few minutes.

Finally see updating shebang of/usr/local/bin/npm To/usr/local/bin/node

It means the installation was successful.

To verify that the installation is successful, you can verify:

Write a script into the/down directory and file named node. js

varhttp = require(‘http‘);

http.createServer(function(req,res){

res.end(‘hello node.js‘);

}).listen(8080,"127.0.0.1");

console.log(‘Server is running at http://127.0.0.1:8080/‘)

Then start with the command line

#node/down/node.js

See Command line output

?

1

Server is running at http://127.0.0.1:8080/

Then use the CentOS-brought Firefox to open http://127.0.0.1:8080/

OK to end O (∩_∩) o haha

node. js

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.