From 18ae1068e653f2adc5be983c8cca83e7a7cfa75d Mon Sep 17 00:00:00 2001 From: Noah Petherbridge Date: Thu, 10 Apr 2014 05:37:12 +0000 Subject: [PATCH] Add mod_uwsgi instructions --- Apache.md | 52 +++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 51 insertions(+), 1 deletion(-) diff --git a/Apache.md b/Apache.md index 765fb04..85b4511 100644 --- a/Apache.md +++ b/Apache.md @@ -2,9 +2,59 @@ Here's some tips on getting Rophako set up on Apache. +# mod\_uwsgi + +For simple sites you can set it up with `mod_uwsgi` in Apache. + +## Apache configuration: + +```apache + + ServerName www.example.com + WSGIDaemonProcess rophako user=www-data group=www-data threads=5 home=/home/www-data/git/rophako + WSGIScriptAlias / /home/www-data/git/rophako/app.wsgi + WSGIScriptReloading On + CustomLog /home/www-data/logs/access_log combined + ErrorLog /home/www-data/logs/error_log + + + WSGIProcessGroup rophako + WSGIApplicationGroup %{GLOBAL} + Order allow,deny + Allow from all + + +``` + +## app.wsgi + +A copy of `app.wsgi` is included in the git repo's root. Here it is though for reference. This assumes you're +using a Python virtualenv named "rophako": + +```python +#!/usr/bin/env python + +"""WSGI runner script for the Rophako CMS.""" + +import sys +import os + +# Add the CWD to the path. +sys.path.append(".") + +# Use the 'rophako' virtualenv. +activate_this = os.environ['HOME']+'/.virtualenv/rophako/bin/activate_this.py' +execfile(activate_this, dict(__file__=activate_this)) + +from rophako import app as application + +# vim:ft=python +``` + + # mod\_fcgid and mod\_rewrite -For kirsle.net I needed to set it up using `mod_fcgid` because my site has a lot +For kirsle.net I needed to set it up using `mod\_fcgid` because my site has a lot of legacy URLs to old static files, so Rophako needs to serve the main website pages and Apache needs to serve everything else.