これは私のVirtualHost
構成です:
<VirtualHost *:80>
ServerName example.com
DocumentRoot /var/www/example.com/public
<Directory /var/www/example.com/public>
Options +FollowSymLinks
AllowOverride All
Require user user1 user2
</Directory>
<Location /error/401>
Require all granted
</Location>
ErrorLog ${APACHE_LOG_DIR}/example.com.error.log
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/example.com.access.log combined
ErrorDocument 500 /error/500
ErrorDocument 404 /error/404
ErrorDocument 401 /error/401
</VirtualHost>
それでも、意図的に認証に失敗した場合 (または /error/401 を直接開いた場合)、次のようになります。
Unauthorized
This server could not verify that you are authorized to access the document requested. Either you supplied the wrong credentials (e.g., bad password), or your browser doesn't understand how to supply the credentials required.
Additionally, a 401 Unauthorized error was encountered while trying to use an ErrorDocument to handle the request.
私は何を間違っていますか?以下にリンクされているドキュメントによると、後でLocation
処理する必要があるDirectory
ため、これは機能するはずです。
http://httpd.apache.org/docs/current/sections.html#merging
編集:
明らかなように、これが問題の部分です。
Additionally, a 401 Unauthorized error was encountered while trying to use an ErrorDocument to handle the request.