【发布时间】:2011-04-05 17:25:26
【问题描述】:
我有一台运行 Ubuntu Lucid 10.04.1 LTS 服务器版的服务器,我想在使用 Apache + mod_wsgi 上部署一个 Django 应用程序。目前 Apache 做一个目录索引而不是使用我的 WSGIScriptAlias 命令。
任何提示为什么将不胜感激。我通过 aptitude 安装了 mod_wsgi,并假设下面的“模块配置”会加载它。
/etc/apache2/apache2.conf
#....
# Include module configuration:
Include /etc/apache2/mods-enabled/*.load
Include /etc/apache2/mods-enabled/*.conf
# Include all the user configurations:
Include /etc/apache2/httpd.conf
# Include ports listing
Include /etc/apache2/ports.conf
#....
# Include generic snippets of statements
Include /etc/apache2/conf.d/
# Include the virtual host configurations:
Include /etc/apache2/sites-enabled/
在站点启用中有两个文件,000-default-backup 和我的。
000-默认备份
<VirtualHost *:80>
DocumentRoot /var/www/
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>
</VirtualHost>
我的
<VirtualHost *:80>
WSGIDaemonProcess project-production user=me group=me threads=10 python-path=/home/me/virtualenvs/project/lib/python2.6/site-packages
WSGIScriptAlias /project /home/me/projects/project/releases/current/feedback/apache/feedback.wsgi
<Directory /home/me/projects/project/releases/current/project/apache>
WSGIProcessGroup project-production
Order deny,allow
Allow from all
</Directory>
</VirtualHost>
查看错误日志,没有错误。所以我认为 000-default-backup 或 apach2.conf 中的某些内容是说“将其作为目录提供”,并且 WSGI 命令永远没有机会运行。路径都是正确的。
Apache 有服务器版本:Apache/2.2.14 (Ubuntu)。
ETA:我希望我的网站在子目录上运行,即 foo.com/project。 (我不能轻易地创建一个新的子域。)所以基本上我希望 *:80 的 VirtualHost 指令被拆分为多个文件。这可能吗?
【问题讨论】: