On 12 Jul 2019, at 13:05, Eric Covener <[email protected]> wrote: >> For a start it means that this part of our manual is invalidated the moment >> you add an If statement: >> http://httpd.apache.org/docs/current/sections.html > > I agree it's not intuitive (either way), but which part of the above > invalidated? > It already says <if> is merged last. > > When it's not nested, the <if> is part of the configuration and wins. > When it's nested, it's conditionally part of the configuration, and if > it's part of the configuration it wins.
Saying “if is merged last” is meaningless as a statement. Sure, if you’re
describing the internals of the config walk process, that statement makes
sense, but to an end user who is trying to write an httpd config to achieve a
specific objective, the statement means nothing at all.
Most specifically, in the document above, "Some useful examples” shows this:
"the directives in this example will be applied in the order A > B > C > D > E”
<Location "/">
E
</Location>
<Files "f.html">
D
</Files>
<VirtualHost *>
<Directory "/a/b">
B
</Directory>
</VirtualHost>
<DirectoryMatch "^.*b$">
C
</DirectoryMatch>
<Directory "/a/b">
A
</Directory>
Add an If to the above what changes happen to A > B > C > D > E, and do these
make any coherent sense to an end user?
>> I am trying to get my head around how we can make If work like the docs
>> above. Is If broken, or is require broken?
>
> I don't agree that either is broken. Neither <if> nesting semantic is
> very intuitive but what we have seems pretty consistent to me -- it
> acts the similar to how it would act if the enclosing scope is part of
> your expression.
>
> I don't really like the idea of an directive to reset the list of <if>
> sections that have been accumulated by walking the config so far.
>
> The most I can personally see here is providing more examples in
> sections.html and the directive info for <if> to clarify that nesting
> is complicated.
If we cannot sensibly and accurately describe the behaviour in our docs that an
ordinary end user can understand in a reasonable length of time, then it’s
definitely broken and we need to fix it.
Regards,
Graham
—
smime.p7s
Description: S/MIME cryptographic signature
