##Ubuntu Server
sudo apt-get install g++ curl libssl-dev apache2-utils git-core make
cd /usr/local/src
wget http://nodejs.org/dist/v0.10.28/node-v0.10.28.tar.gz
tar -xvzf node-v0.10.28.tar.gz
cd node-v0.10.28
./configure
make
sudo make install Now check for NodeJS and NPM versions
node --version
npm --versionsudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10
echo 'deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen' | sudo tee /etc/apt/sources.list.d/mongodb.list
sudo apt-get update
sudo apt-get install mongodb-orgThen Start Mondgo DB Service
sudo /etc/init.d/mongod startCheck if it has executed correctly
vim /var/log/mongodb/mongod.logit could take a while .. mongo preallocates 3.0gb so wait for message like:
2014-05-24T03:12:17.599+0000 [initandlisten] waiting for connections on port 27017To Run a client of mongodb and see current DBs
$ mongo
> show dbsmkdir -p /var/www/
cd /var/www/
git clone https://github.com/user/project-name.git
cd project-name/
npm install --productionNow copy the template config.json and configure
cp config.env.json.sample config.prod.json
vim config.prod.jsonInstall Forever Globally to run nodejs
npm install -g foreverRun NodeJS Process at production environment on port 5000
NODE_ENV=production PORT=5000 forever start ./bin/wwwCheck if process is runing and log
forever list
forever logs 0sudo apt-get install nginx
sudo service nginx startConfigure the NodeJS Process
vim /etc/nginx/sites-enabled/defaultAdd the following lines after location / {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header X-NginX-Proxy true;
proxy_pass http://localhost:5000/;
proxy_redirect off;
Then restart NGINX:
sudo service nginx restartNow go to your browser and put the http://SERVER-IP
I'm having this error:
sudo: /etc/init.d/mongod: command not foundAny ideas?