我在Debian unstable上运行Apache 2.4.7。 当我尝试使用mod_wsgi模块运行supysonic时,出现了403错误。 我把日志级别为wsgi和authz_core达到trace6 ,但我仍然没有得到任何有用的消息。 请注意,我正在使用mod_access_compat ,因此Order … Allow组合是有效的。
我想特别看到什么configuration文件(例如某个.htaccess文件,或者标准的apache或debianconfiguration文件之一),以及哪一行包含生成403错误的规则。
我已经手动走树,检查在每个级别的Web服务器正在运行的用户已经读取权限的文件,并阅读和执行的目录。
我的/etc/apache2/apache.conf文件包括行:
LogLevel info authz_core:trace6 wsgi:trace6
supysonic的/etc/apache2/conf-enabled/supysonic.conf的apacheconfiguration文件是:
WSGIScriptAlias /supysonic /mnt/large_vol/home/bminton/public_html/programs/supysonic <Directory /mnt/large_vol/home/bminton/public_html/programs/supysonic> WSGIApplicationGroup %{GLOBAL} Order deny,allow Allow from all </Directory>
错误日志包含以下行:
[Wed Jan 15 08:40:34.106119 2014] [authz_core:debug] [pid 13558] mod_authz_core.c(802): [client 127.0.0.1:58438] AH01626: authorization result of Require all denied: denied [Wed Jan 15 08:40:34.106197 2014] [authz_core:debug] [pid 13558] mod_authz_core.c(802): [client 127.0.0.1:58438] AH01626: authorization result of <RequireAny>: denied [Wed Jan 15 08:40:34.106208 2014] [authz_core:error] [pid 13558] [client 127.0.0.1:58438] AH01630: client denied by server configuration: /mnt/large_vol/home/bminton/public_html/programs/supysonic [Wed Jan 15 08:40:34.113336 2014] [:info] [pid 13571] mod_wsgi (pid=13571): Initializing Python. [Wed Jan 15 08:40:34.154407 2014] [:info] [pid 13571] mod_wsgi (pid=13571): Attach interpreter ''.
403错误与用户授权有关,它不是真的关于你的应用程序代码。
你说你使用的是Apache 2.4版,那么这肯定是错误的:
Order deny,allow Allow from all
现在应该这样写(仅限于1行):
Require all granted