[PATCH] Improve WSGI configuration snippet

martin f. krafft madduck at madduck.net
Tue Feb 2 19:46:53 EST 2010


This supplements <1264902001-30643-4-git-send-email-madduck at madduck.net>

It turns the WSGI configuration snippet into a leaner version thereof
and removes some cruft.

Among other things, it removes the mod_proxy configuration that
previously allowed one to access the 'manage.py runserver' HTTP server
at /dev/. This was useful for testing, since the Django HTTP server
reloads the settings and modules after they changed, thus not requiring
an apache restart every time something was changed. That's useful for
development, but doesn't belong in the "official" config file.

Signed-off-by: martin f. krafft <madduck at madduck.net>
---
 lib/apache2/patchwork.wsgi.conf |   52 +++++++++++---------------------------
 1 files changed, 15 insertions(+), 37 deletions(-)

diff --git a/lib/apache2/patchwork.wsgi.conf b/lib/apache2/patchwork.wsgi.conf
index 64d3f78..3e81435 100644
--- a/lib/apache2/patchwork.wsgi.conf
+++ b/lib/apache2/patchwork.wsgi.conf
@@ -1,40 +1,18 @@
-Alias /media/ "/srv/patchwork/htdocs/media/"
-<Directory "/srv/patchwork/htdocs/media">
-  Order allow,deny
-  Allow from all
-</Directory>
+<IfModule mod_alias.c>
+  Alias /images/ "/srv/patchwork/htdocs/images/"
+  Alias /css/ "/srv/patchwork/htdocs/css/"
+  Alias /js/ "/srv/patchwork/htdocs/js/"
+  Alias /robots.txt "/srv/patchwork/htdocs/robots.txt"
+  <Directory "/srv/patchwork/htdocs">
+    Order allow,deny
+    Allow from all
+  </Directory>
 
-Alias /css/ "/srv/patchwork/htdocs/css/"
-<Directory "/srv/patchwork/htdocs/css">
-  Order allow,deny
-  Allow from all
-</Directory>
-
-Alias /js/ "/srv/patchwork/htdocs/js/"
-<Directory "/srv/patchwork/htdocs/js">
-  Order allow,deny
-  Allow from all
-</Directory>
-
-Alias /admin/media/ "/usr/share/python-support/python-django/django/contrib/admin/media/"
-<Directory "/usr/share/python-support/python-django/django/contrib/admin/media/">
-  Order allow,deny
-  Allow from all
-</Directory>
-
-<Directory "/srv/patchwork/">
-  Order allow,deny
-  Allow from all
-  Options SymlinksIfOwnerMatch
-</Directory>
+  Alias /media/ "/usr/share/python-support/python-django/django/contrib/admin/media/"
+  <Directory "/usr/share/python-support/python-django/django/contrib/admin/media/">
+    Order allow,deny
+    Allow from all
+  </Directory>
+</IfModule>
 
 WSGIScriptAlias / "/srv/patchwork/patchwork.wsgi"
-
-ProxyPass /dev/ http://localhost:8000/
-ProxyPassReverse /dev/ http://localhost:8000/
-
-ProxyVia On
-<ProxyMatch http://localhost:8000/.*>
-  Order deny,allow
-  Allow from all
-</ProxyMatch>
-- 
1.5.6.5



More information about the Patchwork mailing list