Node.js applications are written in JavaScript, and can be run within the Node.js runtime on Windows, Mac OS X and Linux with no changes.
[~]# rpm -qa | grep bzip2-devel
[~]# which python
/usr/bin/python
[~]# python -V
Python 2.4.3
[~]# wget https://www.python.org/ftp/python/2.6.7/Python-2.6.7.tgz --no-check-certificate
[~]# make
[~]# make install
[~]# cd ~
[~]#vi .bashrc
[~]#Add ,
export LD_LIBRARY_PATH=~/lib:$LD_LIBRARY_PATH
[~]#source .bashrc
[~]#vi .bashrc
[~]#export LD_LIBRARY_PATH=~/lib:$LD_LIBRARY_PATH
[~]#source ~/.bashrc
save and quit
Execute ,
python -V Python 2.6.7
[~]# wget http://nodejs.org/dist/v0.8.2/node-v0.8.2.tar.gz --> For i686
http://nodejs.org/dist/v0.10.26/node-v0.10.26.tar.gz --> For x64
[~]# tar xzf node-v0.8.2.tar.gz
[~]# cd node-v0.8.2
[~]# ./configure --prefix=$HOME
[~]# make
[~]# make install
Optionally, install setuptools to make python module management easier later.
[~]# wget 'http://pypi.python.org/packages/2.6/s/setuptools/setuptools-0.6c11-py2.6.egg#md5=bfa92100bd772d5a213eedd356d64086'
[~]# sh setuptools-0.6c11-py2.6.egg
Here is an example of a simple TCP server which listens on port 12345 (port number assigned by support and open in firewall, shared or dedicated IP) and echoes whatever you send it:
[~]# cat > socket_server.js<<EOF
var net = require('net');
var server = net.createServer(function (socket) {
socket.write('Echo server\r\n');
socket.pipe(socket);
});
server.listen(12345, '10.10.10.10');
console.log('Server running at http://10.10.10.10:12345/');
EOF
[~]# node socket_server.js
Server running at http://10.10.10.10:14243/
node version can be checked from the command,
node --version.
Done
[~]# rpm -qa | grep bzip2-devel
[~]# which python
/usr/bin/python
[~]# python -V
Python 2.4.3
[~]# wget https://www.python.org/ftp/python/2.6.7/Python-2.6.7.tgz --no-check-certificate
[~]# make
[~]# make install
[~]# cd ~
[~]#vi .bashrc
[~]#Add ,
export LD_LIBRARY_PATH=~/lib:$LD_LIBRARY_PATH
[~]#source .bashrc
[~]#vi .bashrc
[~]#export LD_LIBRARY_PATH=~/lib:$LD_LIBRARY_PATH
[~]#source ~/.bashrc
save and quit
Execute ,
python -V Python 2.6.7
[~]# wget http://nodejs.org/dist/v0.8.2/node-v0.8.2.tar.gz --> For i686
http://nodejs.org/dist/v0.10.26/node-v0.10.26.tar.gz --> For x64
[~]# tar xzf node-v0.8.2.tar.gz
[~]# cd node-v0.8.2
[~]# ./configure --prefix=$HOME
[~]# make
[~]# make install
Optionally, install setuptools to make python module management easier later.
[~]# wget 'http://pypi.python.org/packages/2.6/s/setuptools/setuptools-0.6c11-py2.6.egg#md5=bfa92100bd772d5a213eedd356d64086'
[~]# sh setuptools-0.6c11-py2.6.egg
Here is an example of a simple TCP server which listens on port 12345 (port number assigned by support and open in firewall, shared or dedicated IP) and echoes whatever you send it:
[~]# cat > socket_server.js<<EOF
var net = require('net');
var server = net.createServer(function (socket) {
socket.write('Echo server\r\n');
socket.pipe(socket);
});
server.listen(12345, '10.10.10.10');
console.log('Server running at http://10.10.10.10:12345/');
EOF
[~]# node socket_server.js
Server running at http://10.10.10.10:14243/
node version can be checked from the command,
node --version.
Done