Skip to content

Instantly share code, notes, and snippets.

@coolaj86
Created July 25, 2013 18:22
Show Gist options
  • Save coolaj86/6082381 to your computer and use it in GitHub Desktop.
Save coolaj86/6082381 to your computer and use it in GitHub Desktop.
# cat /etc/init/webapps.conf
description "vhosts via NodeJS, Spark, and Connect"
version "1.1"
author "AJ ONeal"
# 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 [2345]
# Start the server using spark and redirect output to log files
script
DATE=`date '+%F_%H-%M-%S'`
cd /var/webapps
mkdir -p logs
exec node app.js > "./logs/access.${DATE}.log" 2> "./logs/error.${DATE}.log"
end script
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment