From 0a4236052cc3fb8bb1a2b9eee7e5373733e9e628 Mon Sep 17 00:00:00 2001 From: Luca Toscano Date: Tue, 16 Feb 2016 12:32:08 +0000 Subject: [PATCH] Expanding sections.xml to address Bug: 58789 git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1730673 13f79535-47bb-0310-9956-ffa450edef68 --- docs/manual/sections.xml | 42 ++++++++++++++++++++++++++++++++++++---- 1 file changed, 38 insertions(+), 4 deletions(-) diff --git a/docs/manual/sections.xml b/docs/manual/sections.xml index f8aa84183bf..e77961c18f5 100644 --- a/docs/manual/sections.xml +++ b/docs/manual/sections.xml @@ -405,13 +405,13 @@ see the Virtual Host Documentation.

and ProxyMatch containers apply enclosed configuration directives only to sites accessed through mod_proxy's proxy server -that match the specified URL. For example, the following configuration -will prevent the proxy server from being used to access the -www.example.com website.

+that match the specified URL. For example, the following configuration +will allow only a subset of clients to access the +www.example.com website using the proxy server:

<Proxy http://www.example.com/*> - Require all granted + Require host yournetwork.example.com </Proxy> @@ -510,12 +510,17 @@ are interpreted, it is important to understand how this works.

type="section">Directory container in the processing order.

+Merge is not always Override

Later sections override earlier ones, however each module is responsible for interpreting what form this override takes. A later configuration section with directives from a given module might cause a conceptual "merge" of some directives, all directives, or a complete replacement of the modules configuration with the module defaults and directives explicitly listed in the later context.

+

Directory, FilesMatch, + Location and the other directives discussed in this section + implement the same merging strategy, namely "override" when applied to the same target.

+
Technical Note There is actually a @@ -559,6 +564,35 @@ E.

+

Another interesting example is the following one. As described above, +FilesMatch is merged after Directory, +therefore a request for /var/www/index.html will eventually get the "foo" Header set to +the value "two", not "three" as somebody might expect from a first look. +

+ + +<Directory "/"> + Header set foo one + <FilesMatch ".*"> + Header set foo two + </FilesMatch> +</Directory> + +<Directory "/var/www"> + Header set foo three +</Directory> + + + +

The chain of values that the "foo" header will get is: "one", "three" and "two". +It is important to notice that Directory and FilesMatch +implement the same merging strategy, namely "override" when +applied to the same path. In this example it means that the last directive applied in the merging order, +FilesMatch, sets the final value for the "foo" header. +

+

This is true for .htaccess too, since they have the same priority as Directory +in the merging order.

+

For a more concrete example, consider the following. Regardless of any access restrictions placed in Directory sections, the