nodejs 处理高并发场景性能高。
目前用来承担项目的chat系统
进入 https://nodejs.org/download/ 选择最新版本
wget http://nodejs.org/dist/v0.12.0/node-v0.12.0.tar.gz
tar - xf node*
安装支持库
yum install gcc openssl-devel gcc-c++ compat-gcc-34 compat-gcc-34-c++
cd no*
./ configure -- prefix = /usr/ local / node
make
make install
ln -s /usr/local/node/bin/* /usr/sbin/
test code
var http = require ( 'http' ); http. createServer ( function (req, res) { res. writeHead ( 200 , { 'Content-Type' : 'text/plain' } ); res. end ( 'Hello World 3588.us n ' ); } ). listen (3588 , '127.0.0.1' ); console. log ( 'Server running at http://127.0.0.1:3588/' );
文章评论
which node cd /pathThis is all that is added by Node.JS.rm -r bin/node bin/node-waf include/node lib/node lib/pkgconfig/nodejs.pc share/man/man1/node.1
which node cd /pathThis is all that is added by Node.JS.rm -r bin/node bin/node-waf include/node lib/node lib/pkgconfig/nodejs.pc share/man/man1/node.1
NPMnpm 升级非常方便, 直接使用 npm 就可以1$ npm update -g npmnpm 卸载方法如下1$ sudo npm uninstall npm -g如果该方法失败, 可以先获取 npm 源代码, 然后$ sudo make uninstall
NPMnpm 升级非常方便, 直接使用 npm 就可以1$ npm update -g npmnpm 卸载方法如下1$ sudo npm uninstall npm -g如果该方法失败, 可以先获取 npm 源代码, 然后$ sudo make uninstall