【发布时间】:2014-06-16 02:36:32
【问题描述】:
我在使用 Apache 2.2 配置 mod_wsgi 时遇到问题。我需要 mod_wsgi 来处理虚拟服务器根目录下的所有内容,除了某些路径。对于那些路径,我希望普通的 Apache 目录列表能够正常工作。以下虚拟服务器配置一半有效。 mod_wsgi 不会直接用于文件的路径,但会用于目录。我想不通。在这里查看文档 - https://code.google.com/p/modwsgi/wiki/QuickConfigurationGuide。它以我必须禁用 mod_wsgi 的方式显示使用别名,但未提及此问题。 (请注意,这并不重要,但 foo.wsgi 端点只是 hello world 示例)。
<VirtualHost *:80>
ServerAdmin webmaster@test.wsgi.sethandler.localdomain
ServerName test.wsgi.sethandler.localdomain
DocumentRoot /var/www/test.wsgi.sethandler.localdomain
<Directory /var/www/test.wsgi.sethandler.localdomain>
Options Indexes FollowSymLinks MultiViews
AllowOverride FileInfo Options Indexes
Order allow,deny
allow from all
</Directory>
Alias /static /var/www/test.wsgi.sethandler.localdomain/static
WSGIScriptAlias / /var/www/test.wsgi.sethandler.localdomain/cgi-bin/foo.wsgi
<Directory /var/www/test.wsgi.sethandler.localdomain/cgi-bin>
WSGIApplicationGroup %{GLOBAL}
Order deny,allow
Allow from all
</Directory>
</VirtualHost>
我尝试使用以下方法禁用任何处理程序,但它不起作用:
<Location "/static">
SetHandler None
</Location>
<LocationMatch ^/static>
SetHandler None
</LocationMatch>
【问题讨论】: