ubuntu 下安裝nodejs以及pm2

來源:互聯網
上載者:User

標籤:ubuntu   nodejs   pm2   

 ubuntu 12.04伺服器可以使用apt-get方式安裝Node JS,但是,安裝完後的版本為v0.6.12的版本,如果我們想要使用新一點的版本需要做如下配置:

 

apt-get install python-software-propertiesapt-add-repository ppa:chris-lea/node.jsapt-get updateapt-get install nodejs

安裝完成後可以檢查一下版本,使用如下命令可以查看:

 

[email protected]:#node -vv0.10.28

 接下來我們需要安裝pm2這個軟體

 首先我們需要安裝一個npm的軟體,具體命令如下:

 

apt-get install npmnpm -v

安裝完成,我們就可以安裝pm2這個軟體,使用如下命令安裝:

 

[email protected]:# 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

PM2地址:https://github.com/Unitech/pm2


本文出自 “風之別鶴” 部落格,請務必保留此出處http://addam.blog.51cto.com/5041993/1407087

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.