How to Install nodejs server on EC2 AWS centos 6


Download nodejs server from source
Look for the "Source Code" and copy the link.

cd /usr/src
tar -xzvf node-v0.10.26.tar.gz
Now before compiling , lets install the relevant dependencies.
yum -y groupinstall "Development Tools"
yum -y install screen

Right now let's enable the epel repository 
vim /etc/yum.repos.d/epel.repo
#change to enabled=1
yum install js-devel
yum install curl-devel
yum install autoconf-archive
yum install libicu-devel

Now let's Configure
make install
Now test it with a 'test' nodejs app

cd /root
vim test.js

pase this code

// Load the http module to create an http server.
var http = require('http');

// Configure our HTTP server to respond with Hello World to all requests.
var server = http.createServer(function (request, response) {
  response.writeHead(200, {"Content-Type": "text/plain"});
  response.end("Hello World\n");

// Listen on port 8000, IP defaults to

// Put a friendly message on the terminal
console.log("Server running at");

and now run

nohup node test.js > node.log 2>&1 &

check it with 


and check the node.log 

you can also manage the nodejs process with supervisord

Tagged with: , ,
Posted in NodeJS

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: