Skip to content

Instantly share code, notes, and snippets.

@davidvanvickle
Last active December 14, 2015 18:48
Show Gist options
  • Save davidvanvickle/5131749 to your computer and use it in GitHub Desktop.
Save davidvanvickle/5131749 to your computer and use it in GitHub Desktop.
install node.js on ubuntu
# node: http://stackoverflow.com/questions/5009324/node-js-nginx-and-now
sudo apt-get install python-software-properties python g++ make
sudo add-apt-repository ppa:chris-lea/node.js
sudo apt-get update
sudo apt-get install nodejs npm
# http://kvz.io/blog/2009/12/15/run-nodejs-as-a-service-on-ubuntu-karmic/
in /etc/init.d/nodeapp.conf (chmod u+x)
......
description "napi/test.js launcher"
author "kvz"
# used to be: start on startup
# until we found some mounts weren't ready yet while booting:
start on started mountall
stop on shutdown
# Automatically Respawn:
respawn
respawn limit 99 5
script
# Not sure why $HOME is needed, but we found that it is:
export HOME="/root"
exec /usr/local/bin/node /usr/share/nginx/www/napi/test.js >> /var/log/node.log 2>&1
end script
post-start script
# Optionally put a script here that will notifiy you node has (re)started
# /root/bin/hoptoad.sh "node.js has started!"
end script
.......
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment