1

I am using mod_wsgi express in a virtualenv with Apache 2.2 and I want to serve multiple Django sites from the same server. This post mentions an approach I would like to use, but the httpd.conf generated for mod_wsgi express doesn't have WSGIScriptAlias, but instead uses WSGIHandlerScript

To generate my httpd.conf I ran this command:

python manage.py runmodwsgi --setup-only --port=80 \
    --user apache --group apache \
    --server-root=/etc/mod_wsgi-express-80 \
    --server-name=eco_test

which results in this being added at the end of the httpd script:

<IfDefine !ONE_PROCESS>
WSGIHandlerScript wsgi-handler '/etc/mod_wsgi-express-80-test1/handler.wsgi' \
    process-group='localhost:80' application-group=%{GLOBAL}
WSGIImportScript '/etc/mod_wsgi-express-80-test1/handler.wsgi' \
    process-group='localhost:80' application-group=%{GLOBAL}
</IfDefine>

<IfDefine ONE_PROCESS>
WSGIHandlerScript wsgi-handler '/etc/mod_wsgi-express-80-test1/handler.wsgi' \
    process-group='%{GLOBAL}' application-group=%{GLOBAL}
WSGIImportScript '/etc/mod_wsgi-express-80-test1/handler.wsgi' \
    process-group='%{GLOBAL}' application-group=%{GLOBAL}
</IfDefine>

How would I set up aliases for more than one site when using WSGIHandlerScript and WSGIImportScript? I am after /eco routes to django_eco.wsgi and /pop routes to django_pop.wsgi

I am willing to have each Django site run their own port (e.g. 8080, 8081, etc...) if that is necessary.

Community
  • 1
  • 1
Flash
  • 543
  • 2
  • 7
  • 21
  • This might be helpful: http://stackoverflow.com/questions/1553165/multiple-django-sites-with-apache-mod-wsgi – jmunsch Nov 05 '14 at 20:15
  • I had seen that. My question is more regarding me not understanding what parts of the `httpd.conf` file auto-generated by mod_wsgi express should be altered in conjunction with `WSGIHandlerScript` & `WSGIImportScript`. – Flash Nov 05 '14 at 20:35
  • I ended up using NGINX as a reverse proxy for my Django sites, each running locally on their own ports. – Flash Nov 13 '14 at 13:52

0 Answers0