I'm trying to get two (or more) Django applications set up at subdirectories under the same domain, e.g.:
http://example.com/site1/
http://example.com/site2/
I know that normally this works fine by setting up an apache virtualhost like this:
<VirtualHost *:80>
...
WSGIScriptAlias /site1 /path/to/site1.wsgi
WSGIScriptAlias /site2 /path/to/site2.wsgi
</VirtualHost>
Now, I've verified that each site works individually. But when I try to run both side-by-side, apache sends me to whichever site the worker process loaded first. Example:
- Restart apache configured to serve 6 threads
- Load example.com/site1/, get the correct page
- Load example.com/site2/, get the correct page
- Repeat 2 and 3 2 more times.
- Refresh example.com/site1/ repeatedly, watch it cycle from site to site.
Effectively, for any given number of worker processes, it cycles through the total number of them sending the request to whichever one it hit first regardless of the WSGIScriptAlias directive. No matter what I do (setting WSGIProcessGroup, daemon mode vs. embedded mode, or directives) it continues to exhibit this behavior.
If anyone can point out what I'm doing wrong here, that would be phenomenal!
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…