Last active
December 14, 2015 18:48
-
-
Save davidvanvickle/5131749 to your computer and use it in GitHub Desktop.
install node.js on ubuntu
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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