我正在通过OS X Server Beta 3.5 (14S171z)以PHP 5.5.9运行Apache 2.4.9 。
我有我的.htaccess中的以下configuration驻留在我想要使用基本身份validation保护的目录中:
AuthType Basic AuthName "restricted area" AuthUserFile /absolute/path/to/.htpasswd Require valid-user IndexIgnore *
VirtualHost conf(由OS X Serverpipe理):
<VirtualHost *:80> ServerName REDACTED ServerAdmin [email protected] DocumentRoot "/absolute/path/to/document/root" DirectoryIndex index.html index.php /wiki/ /xcode/ default.html CustomLog /var/log/apache2/access_log combinedvhost ErrorLog /var/log/apache2/error_log <IfModule mod_ssl.c> SSLEngine Off SSLCipherSuite "ALL:!aNULL:!ADH:!eNULL:!LOW:!EXP:RC4+RSA:+HIGH:+MEDIUM" SSLProtocol -ALL +SSLv3 +TLSv1 SSLProxyEngine On SSLProxyProtocol -ALL +SSLv3 +TLSv1 </IfModule> <Directory "/absolute/path/to/document/root"> Options All -Indexes -ExecCGI -Includes +MultiViews AllowOverride All <IfModule mod_dav.c> DAV Off </IfModule> <IfDefine !WEBSERVICE_ON> Deny from all ErrorDocument 403 /customerror/websitesoff403.html </IfDefine> </Directory> ServerAlias REDACTED </VirtualHost>
以下模块已启用(这是部分列表):
authn_file_module (shared) authn_core_module (shared) authz_host_module (shared) authz_groupfile_module (shared) authz_user_module (shared) authz_core_module (shared) access_compat_module (shared) auth_basic_module (shared)
当我尝试访问具有.htaccess的目录中的任何文件时,我得到403 Forbidden并在错误日志中logging以下内容:
[Thu Jun 05 14:09:55.598801 2014] [authz_core:error] [pid 59601] [client REDACTED] AH01630: client denied by server configuration: /absolute/path/to/a/file/in/the/folder/with/htaccess
我不应该被提示进行身份validation,而不是403错误?
这很可疑:
<IfDefine !WEBSERVICE_ON> Deny from all ErrorDocument 403 /customerror/websitesoff403.html </IfDefine>
如果在某个地方没有定义,那么所有请求都会在到达.htaccess文件之前被拒绝。