我有两个独立的 Django 项目,一个在 /,另一个在 /foo。间歇性地,如果我尝试访问 / 处的项目,它将引发 PageNotFound 异常并显示 /foo 项目中的 URL 文件,反之亦然。我假设与 Apache 或 mod_wsgi 存在某种冲突,但我真的找不到它是什么。有没有办法避免这种情况?我真的不想在单独的域上运行每个项目,这似乎可行。
编辑:我的 django/wsgi 配置(我的 httpd.conf 与安装基本没有变化)
WSGIPythonPath /var/django/bumppoman:/var/django/roads:/var/django/hawthorn:/var/django/wiffleball
<VirtualHost *:8081>
ServerName site1.com
WSGIScriptAlias /hawthorn /var/django/hawthorn/apache-files/wsgi.py
WSGIScriptAlias /roads /var/django/roads/apache/wsgi.py
WSGIScriptAlias / /var/django/bumppoman/apache/wsgi.py
<Directory "/var/django/roads/apache">
Require all granted
</Directory>
<Directory "/var/django/bumppoman/apache">
Require all granted
</Directory>
<Directory "/var/django/hawthorn/apache-files">
Require all granted
</Directory>
</VirtualHost>
<VirtualHost *:8081>
ServerName site2.com
WSGIScriptAlias / /var/django/wiffleball/apache/django.wsgi
<Directory "/var/django/wiffleball/apache">
Require all granted
</Directory>
</VirtualHost>