Two separate django sites in WSGI (root and /two)

此生再无相见时 提交于 2019-12-03 16:05:51

Try add the options "process-group" and "application-group" in the WSGIScriptAlias directive:

WSGIScriptAlias / /usr/local/projects/project_one/project_one/wsgi.py process-group=test1 application-group=%{GLOBAL}

...

WSGIScriptAlias /two /usr/local/projects/project_two/project_two/wsgi.py process-group=test2 application-group=%{GLOBAL}

Maybe a bit late but you can change the order of these wsgi and it should work fine (worked for my two wsgi flask apps). When you first use root it just recognize all addresses as root subdomains, and ignore second Alias. Just make /two your first address and than root:

WSGIDaemonProcess test2 python-path=/usr/local/projects/project_two:/usr/local/virtualenvs/project/lib/python2.7/site-packages
WSGIScriptAlias /two /usr/local/projects/project_two/project_two/wsgi.py
<Location /two>
        WSGIProcessGroup test2
</Location>

WSGIDaemonProcess test1 python-path=/usr/local/projects/project_one:/usr/local/virtualenvs/project/lib/python2.    7/site-packages
WSGIScriptAlias / /usr/local/projects/project_one/project_one/wsgi.py
<Location />
        WSGIProcessGroup test1
</Location>

Maybe someone will find it helpful

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!