Skip to content

Instantly share code, notes, and snippets.

@aackerman
Forked from TooTallNate/server.conf
Created August 5, 2012 13:13
Show Gist options
  • Save aackerman/3264697 to your computer and use it in GitHub Desktop.
Save aackerman/3264697 to your computer and use it in GitHub Desktop.
Example of using `upstart` with a NodeJS server.
description "My NodeJS Server"
author "Nathan Rajlich"
# Upstart has nothing in $PATH by default
env PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
# Keep the server running on crash or machine reboot
respawn
start on runlevel [23]
# Start the server and redirect output to log files
script
cd /path/to/node-http-server
exec node server.js >>/var/log/node/http.log 2>&1
end script
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment