From cc999a8f2776322f7c3e3d7dc0b68fe95be662cb Mon Sep 17 00:00:00 2001 From: Mathias Behrle Date: Sat, 13 Sep 2014 18:57:42 +0200 Subject: [PATCH 1/3] Adding sample ini file for uwsgi. --- contrib/uwsgi/mayan.ini | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 contrib/uwsgi/mayan.ini diff --git a/contrib/uwsgi/mayan.ini b/contrib/uwsgi/mayan.ini new file mode 100644 index 0000000000..fc641f1f84 --- /dev/null +++ b/contrib/uwsgi/mayan.ini @@ -0,0 +1,14 @@ +# Sample file for uswgi with mayan installed in a virtualenv mayan +# with project directory mayan e.g. for use with nginx connecting via +# local unix socket +[uwsgi] +#socket = 127.0.0.1:3031 +plugin = python +chdir = /srv/mayan/projects/mayan/mayan-edms +virtualenv = /srv/mayan/.virtualenvs/mayan +env = DJANGO_SETTINGS_MODULE=mayan.settings.production +module = django.core.handlers.wsgi:WSGIHandler() +processes = 4 +threads = 2 +stats = :9191 +buffer-size=32768 \ No newline at end of file From 29b5f3660575c3daa5f7ee7c44b6213936673f58 Mon Sep 17 00:00:00 2001 From: Mathias Behrle Date: Sat, 13 Sep 2014 18:59:41 +0200 Subject: [PATCH 2/3] Adding sample ini file for nginx with uwsgi. --- contrib/nginx/mayan_uwsgi.conf | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 contrib/nginx/mayan_uwsgi.conf diff --git a/contrib/nginx/mayan_uwsgi.conf b/contrib/nginx/mayan_uwsgi.conf new file mode 100644 index 0000000000..9d272c9729 --- /dev/null +++ b/contrib/nginx/mayan_uwsgi.conf @@ -0,0 +1,19 @@ +server { + listen 80; + listen [::]:80 ipv6only=on; + server_name mayan; + access_log /var/log/nginx/access_mayan.log; + error_log /var/log/nginx/error_mayan.log; + + location / { + uwsgi_pass unix:///run/uwsgi/app/mayan/socket; + include uwsgi_params; + uwsgi_param UWSGI_SCHEME $scheme; + uwsgi_param SERVER_SOFTWARE nginx/$nginx_version; + } + + location /static/ { + root /srv/mayan/projects/mayan/mayan-edms/mayan/media/; + } + +} From 75e99d62bbde51aff9fb5be43da6d4a844892ef7 Mon Sep 17 00:00:00 2001 From: Mathias Behrle Date: Sat, 13 Sep 2014 19:28:24 +0200 Subject: [PATCH 3/3] Updating apache contrib files. Thanks to Gary Walborn for providing examples. --- contrib/apache/mayan | 33 ++++++++++++++++----------------- contrib/apache/mayan-edms.wsgi | 14 ++++++++++++++ 2 files changed, 30 insertions(+), 17 deletions(-) create mode 100644 contrib/apache/mayan-edms.wsgi diff --git a/contrib/apache/mayan b/contrib/apache/mayan index 01c38ad146..4c880f586e 100644 --- a/contrib/apache/mayan +++ b/contrib/apache/mayan @@ -1,20 +1,19 @@ - # Uncomment if libapache2-mod-xsendfile is installed - # XSendFile On - # XSendFileAllowAbove On + # Uncomment if libapache2-mod-xsendfile is installed + # XSendFile On + # XSendFileAllowAbove On + ServerName mayan.yoursite.com + ServerAdmin admin@yoursite.com + DocumentRoot /var/www/mayan-edms + WSGIScriptAlias / /var/www/mayan-edms/mayan/mayan-edms.wsgi - WSGIScriptAlias / /usr/share/mayan/mayan/wsgi/dispatch.wsgi - - - Order deny,allow - Allow from all - - ErrorLog /var/log/apache2/mayan_error.log - LogLevel warn - CustomLog /var/log/apache2/mayan_access.log combined - - Alias /mayan-static "/usr/share/mayan/mayan/static/" - - SetHandler None - + + Order allow,deny + Allow from all + + + Alias /static /var/www/mayan-edms/media/static + + SetHandler None + diff --git a/contrib/apache/mayan-edms.wsgi b/contrib/apache/mayan-edms.wsgi new file mode 100644 index 0000000000..c917f319df --- /dev/null +++ b/contrib/apache/mayan-edms.wsgi @@ -0,0 +1,14 @@ +# sample wsgi file for usage with apache webserver +# mayan installation in a virtualenv /opt/mayan/venv +# apache deployment in /var/www/mayan-edms +import os +import sys +import site +# set up python path to virtual environment +site.addsitedir(‘/opt/mayan/venv/lib/python2.7/site-packages’) +sys.path.append(‘/var/www/mayan-edms’) +os.environ[‘PYTHON_EGG_CACHE’]=’/var/www/django/cache’ +#django WSGI specifics +From django.core.handlers.wsgi import WSGIHandler +os.environ[‘DJANGO_SETTING_MODULE’] = ‘mayan.settings.production’ +application = WSGIHandler()