Last active
August 29, 2015 14:21
-
-
Save muffl0n/1097615adaf6e65fb22b to your computer and use it in GitHub Desktop.
Apache 2.4 File-/Location-Directive glitch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<VirtualHost *:80> | |
ServerName test_file | |
DocumentRoot /tmp/test/htdocs | |
<Location "/"> | |
Require all granted | |
</Location> | |
<Files "test.html"> | |
AuthType Basic | |
AuthName "Test" | |
AuthUserFile /tmp/test/htpasswd | |
Require user test | |
</Files> | |
</VirtualHost> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<VirtualHost *:80> | |
ServerName test_location | |
DocumentRoot /tmp/test/htdocs | |
<Location "/"> | |
Require all granted | |
</Location> | |
<Location "/test.html"> | |
AuthType Basic | |
AuthName "Test" | |
AuthUserFile /tmp/test/htpasswd | |
Require user test | |
</Location> | |
</VirtualHost> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
According to http://httpd.apache.org/docs/2.4/sections.html#merging Location is evaluated after File and therefore overrides
<Files "test.html">
. So if I useinstead of
everything works as expected.
Result:
Surprisingly according to http://httpd.apache.org/docs/2.2/sections.html#merging this behaviour didn't change from 2.2 to 2.4. But this clearly behaves different after upgrading to 2.4. Maybe there was a bug in 2.2?