安装node npm git。
- 1.安装node.js环境
sudo apt-get install g++ curl libssl-dev apache2-utils
要确保安装了git
sudo apt-get -y install git-core
- 2.通过git下载源代码:
git clone git://github.com/joyent/node.git
- 3.进入到node目录下,编译安装
./configure
make
sudo make install
需要先安装
make sudo apt-get install make
- 4.编译成功后,通过node -v查看当前版本号
- 5.安装npm
curl -k http://npmjs.org/install.sh | sudo sh
安装mongodb
- 1.配置Package Management System
sudo apt-key adv —keyserver hkp://keyserver.ubuntu.com:80 —recv 7F0CEB10
- 2.使用下面的命令创建mongodb的源
echo ‘deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen’ | sudo tee /etc/apt/sources.list.d/mongodb.list
- 3.更新ubuntu的版本库
sudo apt-get update
- 4.安装mongodb
sudo apt-get install mongodb-10gen
- 5.启动mongodb
sudo service mongodb start
- 6.停止mongodb
sudo service mongodb stop
- 7.重启mongodb
sudo service mongodb restart
安装forever
- 1.输入命名来安装forever:
sudo npm install forever -g
- 2.开启进程
sudo forever start -o 13SQSynchronous/log/out.log -e 13SQSynchronous/log/err.log 13SQSynchronous/app.js
- 3.关闭进程
sudo forever stop 13SQSynchronous/app.js
- 4.重启进程
sudo forever restart 13SQSynchronous/app.js