[NodeJS] Install NodeJS and forever package on Ubuntu server
1. Setup Nodejs
Use cd command to project Nodejs folder
- Forever package:
+ Running in silent mode, non stop while press Ctrl-C on terminal
+ Auto restart server when crash.
- Installing:
Use cd command to project Nodejs folder
sudo apt-get install python-software-properties python g++ make2. Run a nodejs project
sudo add-apt-repository ppa:chris-lea/node.js
sudo apt-get update
sudo apt-get install nodejs
Use cd command to project Nodejs folder
cd /data/nodejsand type
node app.jss3. Run nodejs in silent mode with forever package:
- Forever package:
+ Running in silent mode, non stop while press Ctrl-C on terminal
+ Auto restart server when crash.
- Installing:
Use cd command to project Nodejs folder
cd /data/nodejsand type
npm config set registry http://registry.npmjs.org/- Star nodejs project with log file:
npm install forever
cd /data/nodejs
./node_modules/forever/bin/forever start -l /data/nodejs/logs/server.log -a app.js