Re: Setting DirectoryIndex to a Location?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



2009/1/12 Michael Ludwig <mlu@xxxxxxxxxxxxx>:
> Bob Ionescu schrieb:
>> http://httpd.apache.org/docs/2.2/sections.html#mergin
>
> Thanks. This helps a bit. But I still don't quite understand the
> meaning of "be applied" and "be evaluated" in this section. Does this
> refer to the merging,

Yes, merging of sections.

> so that late-comers override earlier directives?

In the described order (there can be exceptions when modules bypass
the directory and file walk). There's a merging within that sections,
too, of course (e.g. <Directoty /foo> overrides <Directory /> if the
first path segment is foo).

>> No, just the filename you gave in DirctoryIndex. It won't be served
>> due to your Handler setting but acts as a dummy for the requirement of
>> mod_dir (existing file).
>
> That's surprising. I would have expected the dummy file to be served.

You set a specific handler and unless all registered handlers are
saying "no, I don't take this request" the default handler isn't
invoked.

> http://httpd.apache.org/docs/2.2/mod/mod_dir.html#directoryindex
>
> Given that an existing file has been found, why not serve it up straight
> away? Why continue looking for a handler when the file is found on disk,
> and *not* look for a handler when no file is found? Maybe that's just
> me, but I find this behaviour a little counter-intuitive. But hey, if it
> works.

That's a bit complicated to describe. Very briefly - Apache uses
hooks, e.g. those which perform uri-to-filename translation (mapping
the request to the filsystem), access check, auth check, fixup hook
and a handler hook to name a few. [1] should give you an idea how the
processing works. A module registers hooks for its functions. mod_dir
acts in the fixup hook phase only. A an uri-based subrequest will run
for /indexfile. If the subreq. returned OK and mod_dir's additional
check for an existing file passes, the results from the subrequest are
copied to the main request (basically). Everything else after
mod_dir's fixup hook will look at r->filename /path/to/indexfile and
r->uri /indexfile.
When the handler hook is reached, all registered handlers are
processed until one returned OK "I took it" (after processing). The
handler hook is a run_first hook, which means if one handler returned
OK the handlers after this one won't run anymore. The default handler
which should serve your plain html file runs very last in the handler
hook phase. If you set a handler and your handler takes the request,
the default handler isn't reached, i.e. the plain html file wouldn't
be served (assuming that your handler doesn't do that).

[1] http://www.fmc-modeling.org/category/projects/apache/amp/4_4Request_Response_Loop.html#SECTION00644000000000000000

Bob

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
   "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx


[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux