You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Stefan Fritsch <sf...@sfritsch.de> on 2012/01/22 19:14:29 UTC

Include strangeness

Apart from the fact that the docs to Include do not match the code and 
IncludeOptional is not documented at all, the way Include interacts 
with directory wildcards is a bit strange:

I have conf/extra/httpd-userdir.conf and a directory conf/original 
(without httpd-userdir.conf in it). This makes


Include conf/*/httpd-userdir.conf

fail with

httpd: Syntax error on line 481 of /usr/local/apache2/conf/httpd.conf: 
Could not open configuration file 
/usr/local/apache2/conf/original/httpd-userdir.conf: No such file or 
directory

even though the whole Include statement does match one file. I think 
this makes directory wildcards a lot less useful with Include. Is this 
intentional or an implementation quirk? Of course, one can always use 
IncludeOptional...


BTW, does anyone have some free cycles to fix the docs?

Re: Include strangeness

Posted by "William A. Rowe Jr." <wr...@rowe-clan.net>.
On 1/22/2012 12:14 PM, Stefan Fritsch wrote:
> Apart from the fact that the docs to Include do not match the code and 
> IncludeOptional is not documented at all, the way Include interacts 
> with directory wildcards is a bit strange:
> 
> I have conf/extra/httpd-userdir.conf and a directory conf/original 
> (without httpd-userdir.conf in it). This makes
> 
> 
> Include conf/*/httpd-userdir.conf
> 
> fail with
> 
> httpd: Syntax error on line 481 of /usr/local/apache2/conf/httpd.conf: 
> Could not open configuration file 
> /usr/local/apache2/conf/original/httpd-userdir.conf: No such file or 
> directory
> 
> even though the whole Include statement does match one file. I think 
> this makes directory wildcards a lot less useful with Include. Is this 
> intentional or an implementation quirk? Of course, one can always use 
> IncludeOptional...

That is a bug.  Any pattern matching at least one file is a success
for either Include or IncludeOptional.  Any pattern matching no files
whatsoever should fail the Include statement, while IncludeOptional
would keep right on truckin with no emits.

That's what the principal of least astonishment would suggest.


Re: Include strangeness

Posted by Stefan Fritsch <sf...@sfritsch.de>.
On Monday 23 January 2012, William A. Rowe Jr. wrote:
> On 1/22/2012 5:25 PM, Tim Bannister wrote:
> > If this triggers a long, unhappy discussion then I would regret
> > posting. On the other hand, if Stefan's question leads to a
> > better experience for httpd users, that's really great.
> 
> +1

OK, I have removed the buggy behavior from the docs and made PR 52505 
out of it. Since fixing the bug won't break anyone's config (it will 
just allow some more configs), this is no blocker for 2.4 GA.


Re: Include strangeness

Posted by "William A. Rowe Jr." <wr...@rowe-clan.net>.
On 1/22/2012 5:25 PM, Tim Bannister wrote:
> 
> If this triggers a long, unhappy discussion then I would regret posting. On the other hand, if Stefan's question leads to a better experience for httpd users, that's really great.

+1


Re: Include strangeness

Posted by Tim Bannister <is...@jellybaby.net>.
On 22 Jan 2012, at 18:14, Stefan Fritsch wrote:

> I have conf/extra/httpd-userdir.conf and a directory conf/original (without httpd-userdir.conf in it). This makes
> 
> Include conf/*/httpd-userdir.conf
> 
> fail
…
> even though the whole Include statement does match one file. I think this makes directory wildcards a lot less useful with Include. Is this intentional or an implementation quirk? Of course, one can always use IncludeOptional...

Can of worms or not, I worry that releasing 2.4.x means setting this behaviour in stone. Until 2.6 comes out, at least.

Without writing a line of code, committers can agree on what the /expected/ behaviour is and document that for the release. Code to implement this can follow later.

If this triggers a long, unhappy discussion then I would regret posting. On the other hand, if Stefan's question leads to a better experience for httpd users, that's really great.

-- 
Tim Bannister – isoma@jellybaby.net


Re: Include strangeness

Posted by Stefan Fritsch <sf...@sfritsch.de>.
On Sunday 22 January 2012, Eric Covener wrote:
> > even though the whole Include statement does match one file. I
> > think this makes directory wildcards a lot less useful with
> > Include. Is this intentional or an implementation quirk? Of
> > course, one can always use IncludeOptional...
> 
> See this relevant thread:
> 
> http://www.gossamer-threads.com/lists/apache/dev/382531?do=post_vie
> w_threaded#382531

Looking at that thread I guess I should not have opened that can of 
worms again. Let's just fix the docs to match the code.

Re: Include strangeness

Posted by Eric Covener <co...@gmail.com>.
> even though the whole Include statement does match one file. I think
> this makes directory wildcards a lot less useful with Include. Is this
> intentional or an implementation quirk? Of course, one can always use
> IncludeOptional...
>

See this relevant thread:

http://www.gossamer-threads.com/lists/apache/dev/382531?do=post_view_threaded#382531