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.