ubuntu 下安装nodejs以及pm2

5100阅读 0评论2014-05-08 xu2428847702
分类:网络与安全

ubuntu 12.04服务器可以使用apt-get方式安装Node JS,但是,安装完后的版本为v0.6.12的版本,如果我们想要使用新一点的版本需要做如下配置:

apt-get install python-software-properties
apt-add-repository ppa:chris-lea/node.js
apt-get update
apt-get install nodejs

安装完成后可以检查一下版本,使用如下命令可以查看:
  
root@test:#node -v
v0.10.28

 接下来我们需要安装pm2这个软件

 首先我们需要安装一个npm的软件,具体命令如下:

   
apt-get install npm
npm -v

安装完成,我们就可以安装pm2这个软件,使用如下命令安装:
    
root@test:# npm install -g pm2

在shell中输入pm,使用table补全,如果能出现pm2,说明已经正常安装。

 PM2的主要功能:
Main features

    Built-in load balancer (using the native cluster module)

    Script daemonization

    0s downtime reload for Node apps

    Generate SystemV/SystemD startup scripts (Ubuntu, Centos...)

    Pause unstable process (avoid infinite loop)

    Restart on file change with --watch

    Monitoring in console
上一篇:如何在ubuntu下使snmp支持mibs库字符串形式
下一篇:自动启动Tomcat