我有两个Django实例和两个独立的virtualenvs,我试图在两个郊区:serveraddress / app1和serveraddress / app2。我的Apache虚拟主机设置如下,并使用mod_wsgi。
我在Apache设置中的端口8000处放置的Django实例显示在此URL:
http://serveraddress:8000/app1
而不是http://serveraddress/app1
。端口80上的App2显示在右侧URL - http:/serveraddress/app2
。
如何让http:/serveraddress:8000/app1
显示在http://serveraddress/app1
?
<VirtualHost serveraddress:8000>
ServerName serveraddress
WSGIDaemonProcess app1 python- path=/var/www/app1:/var/www/app1/files:/usr/local/lib/python2.6/dist-packages
WSGIProcessGroup app1
WSGIScriptAlias /app1 /var/www/app1/files/files/wsgi.py
AliasMatch ^/([^/]*\.css) /var/www/app1/files/app1/static/css/$1
Alias /media/ /var/www/app1/files/media/
Alias /static/ /var/www/app1/files/app1/static/
</VirtualHost>
<VirtualHost serveraddress:80>
ServerName serveraddress
WSGIDaemonProcess app2 python-path=/var/www/app2-files:/var/www/app2-files/app2- files:/var/www/app2-files/env2/lib/python2.6/site-packages
WSGIProcessGroup app2
WSGIScriptAlias /app2 /var/www/app2-files/app2-files/wsgi.py
</VirtualHost>
在我的ports.conf中,我有:
NameVirtualHost serveraddress:80
Listen 80
NameVirtualHost serveraddress:8000
Listen 8000