Add contrib files

This commit is contained in:
Roberto Rosario
2014-08-18 01:29:50 -04:00
parent e80209117a
commit 397b083381
3 changed files with 88 additions and 0 deletions

View File

@@ -0,0 +1,46 @@
upstream app_server {
server unix:/var/tmp/filesystem.sock fail_timeout=0;
}
server {
listen 80;
access_log off;
error_log /var/log/nginx/mayan-edms_error.log;
gzip on;
gzip_http_version 1.0;
gzip_comp_level 2;
gzip_proxied any;
gzip_min_length 1100;
gzip_buffers 16 8k;
gzip_types text/plain text/css application/x-javascript text/xml
application/xml application/xml+rss text/javascript;
# Some version of IE 6 don't handle compression well on some mime-types, so just disable for them
gzip_disable "MSIE [1-6].(?!.*SV1)";
# Set a vary header so downstream proxies don't send cached gzipped content to IE6
gzip_vary on;
location / {
client_max_body_size 2M;
proxy_read_timeout 600s;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_redirect off;
if (!-f $request_filename) {
proxy_pass http://app_server;
break;
}
}
location /static {
expires 1h;
alias /usr/share/mayan-edms/lib/python2.7/site-packages/mayan/media/static;
}
location /favicon.ico {
alias /usr/share/mayan-edms/lib/python2.7/site-packages/mayan/media/static/core/images/favicon.ico;
}
}

View File

@@ -0,0 +1,35 @@
#!/bin/bash
NAME="mayan-edms"
DJANGODIR=/usr/share/mayan-edms
SOCKFILE=/var/tmp/filesystem.sock
USER=www-data
GROUP=www-data
NUM_WORKERS=3
DJANGO_SETTINGS_MODULE=mayan.settings.production
DJANGO_WSGI_MODULE=mayan.wsgi
TIMEOUT=600
echo "Starting $NAME as `whoami`"
# Activate the virtual environment
cd $DJANGODIR
source bin/activate
export DJANGO_SETTINGS_MODULE=$DJANGO_SETTINGS_MODULE
export PYTHONPATH=$DJANGODIR:$PYTHONPATH
# Create the run directory if it doesn't exist
RUNDIR=$(dirname $SOCKFILE)
test -d $RUNDIR || mkdir -p $RUNDIR
# Start your Django Unicorn
# Programs meant to be run under supervisor should not daemonize themselves (do not use --daemon)
exec bin/gunicorn ${DJANGO_WSGI_MODULE}:application \
--name $NAME \
--workers $NUM_WORKERS \
--user=$USER --group=$GROUP \
--log-level=debug \
--bind=unix:$SOCKFILE \
--timeout=$TIMEOUT

View File

@@ -0,0 +1,7 @@
[program:mayan-edms]
command = /usr/share/mayan-edms/contrib/scripts/gunicorn_start.sh
user = www-data
autostart = true
autorestart = true
redirect_stderr = true