Я бегаю Apache 2.4.9
с участием PHP 5.5.9
через OS X Server Beta 3.5 (14S171z)
.
У меня в моем .htaccess
который находится в каталоге, который я хотел бы защитить с помощью базовой аутентификации:
AuthType Basic
AuthName "restricted area"
AuthUserFile /absolute/path/to/.htpasswd
Require valid-user
IndexIgnore *
VirtualHost conf (управляется OS X Server
):
<VirtualHost *:80>
ServerName REDACTED
ServerAdmin admin@example.com
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
и в журнал ошибок заносится следующее:
[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
Разве мне не следует запрашивать аутентификацию вместо ошибки 403?
Это довольно подозрительно:
<IfDefine !WEBSERVICE_ON>
Deny from all
ErrorDocument 403 /customerror/websitesoff403.html
</IfDefine>
Если это где-то не определено, все запросы будут отклонены задолго до того, как они попадут в ваш файл .htaccess.