Node. js Development Environment deployment

Source: Internet
Author: User
Tags install node

Node. js Development Environment deployment

Node. js is a platform based on Chrome JavaScript runtime. It is used to conveniently build fast and scalable network applications. With the help of event-driven Node. js, the non-blocking I/O model becomes lightweight and efficient, and is very suitable for data-intensive real-time applications running on distributed devices.

The company needs to implement a message PUSH Service, and then the developer decides to use nodejs to implement the basic service, and then provides APIs for third parties to implement the message push function. Then, I need to provide them with the nodejs development environment, and then I will write an article to record it...

1. Node. js deployment

[Root @ lh01 src] # wget http://nodejs.org/dist/v0.10.36/node-v0.10.36-linux-x64.tar.gz
-- 09:11:23 -- http://nodejs.org/dist/v0.10.36/node-v0.10.36-linux-x64.tar.gz
Resolving nodejs.org... 165.225.133.150
Connecting to nodejs.org | 165.225.133.150 |: 80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 5676610 (5.4 M) [application/octet-stream]
Saving to: slave node-v0.10.36-linux-x64.tar.gz"

100% [============================================== ===========>] 5,676,610 65.6 K/s in 74 s

09:12:37 (74.8 KB/s)-slave node-v0.10.36-linux-x64.tar.gz "saved [5676610/5676610]

[Root @ lh01 src] # tar zxf node-v0.10.36-linux-x64.tar.gz
[Root @ lh01 src] # mv node-v0.10.36-linux-x64/usr/local/
[Root @ lh01 src] # cd/usr/local/
[Root @ lh01 local] # ln-s node-v0.10.36-linux-x64 nodejs
[Root @ lh01 local] # echo 'path = $ PATH:/usr/local/nodejs/bin'>/etc/profile
[Root @ lh01 local] # tail-1/etc/profile
PATH = $ PATH:/usr/local/node/bin
[Root @ lh01 local] # source/etc/profile
[Root @ lh01 local] # echo $ PATH
/Usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin: /usr/local/nodejs/bin
[Root @ lh01 local] # node-v
V0.10.36
[Root @ lh01 local] # npm-v # npm is the nodejs Package Manager.
1.4.28

Ii. Test

[Root @ lh01 local] # mkdir/data/web-p
[Root @ lh01 local] # cat>/data/web/index. js <EOF
> Var http = require ("http ");
> Http. createServer (function (request, response ){
> Response. writeHead (200 ,{
> "Content-Type": "text/plain" // output Type
> });
> Response. write ("Hello World \ n"); // page output
> Response. end ();
>}). Listen (8100); // listening port number
> Console. log ("nodejs start listen 8100 port! ");
> EOF
[Root @ lh01 local] # node/data/web/index. js &
[1] 21454
[Root @ lh01 local] # nodejs start listen 8102 port!
[Root @ lh01 local] # lsof-I TCP/IP: 8100
Command pid user fd type device size/OFF NODE NAME
Node 21454 root 10u IPv4 1772992 0t0 TCP *: xprint-server (LISTEN)
[Root @ lh01 local] # curl http: // 120.27.45.109: 8100/index. js
Hello World
[Root @ lh01 local] #

OK

The following content is more exciting:

Build a Node. js development environment in Ubuntu 14.04

Install and configure the Node. js development environment in javasru 12.04

Getting started with Node. Js [PDF + related Code]

Node. js Development Guide hd pdf Chinese version + source code

Node. js getting started Development Guide

Install and configure Node. js

Compile and install Node. js in Ubuntu

Node. js details: click here
Node. js: click here

This article permanently updates the link address:

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.