Node JS Installation in Ubuntu
by Francis[ Edit ] 2014-07-25 17:44:27
Node Installation in Ubuntu
cd /usr/local/src/
ls
wget http://nodejs.org/dist/v0.10.29/node-v0.10.29-linux-x64.tar.gz
tar -xzvf node-v0.10.29-linux-x64.tar.gz node-v0.10.29-linux-x64/
ls
cd node-v0.10.29-linux-x64/
ls
cd bin/
ls
node
cd ..
chown -R user:user node-v0.10.29-linux-x64
su user
IF 32 bit replace this code
wget http://nodejs.org/dist/v0.10.29/node-v0.10.29-linux-x86.tar.gz &
Create JS for Request Handling
cd /local/path/nodetest/
vim test.js
In test.js
var http = require('http');
http.createServer(function (req, res) {
res.writeHead(200, {'Content-Type': 'text/plain'});
res.end('Hello World
');
}).listen(1337, '127.0.0.1');
console.log('Server running at http://127.0.0.1:1337/');
Node Server Run Command
cd /local/path/nodetest/
/usr/local/src/node-v0.10.29-linux-x86/bin/node test.js &
More Information :
http://nodejs.org/