Skip to content

Instantly share code, notes, and snippets.

@steve-chavez
Created August 1, 2014 19:54
Show Gist options
  • Save steve-chavez/d46c5ad8ed73c0a884dd to your computer and use it in GitHub Desktop.
Save steve-chavez/d46c5ad8ed73c0a884dd to your computer and use it in GitHub Desktop.
#!/bin/bash
set -e
LOGFILE=/usr/local/virtualenvs/ks_env/ks.webapp2/kswebapp2.log
ERRORFILE=/usr/local/virtualenvs/ks_env/ks.webapp2/error.log
LOGDIR=$(dirname $LOGFILE)
NUM_WORKERS=3
#The below address:port info will be used later to configure Nginx with Gunicorn
ADDRESS=127.0.0.1:8002
# user/group to run as
#USER=your_unix_user
#GROUP=your_unix_group
cd /usr/local/virtualenvs/ks_env/ks.webapp2/
source ../bin/activate
test -d $LOGDIR || mkdir -p $LOGDIR
exec ../bin/gunicorn_django -w $NUM_WORKERS --bind=$ADDRESS \
--log-level=debug \
--log-file=$LOGFILE 2>>$LOGFILE 1>>$ERRORFILE &
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment