Geoffrey Young wrote:
My PerlResponseHandler works fine on files in the /tools directory for
pages that are specified, for example:
/tools/environment.page
/tools/index.page
If I use just the directory URI:
/tools/
the DirectoryIndex specification works but I don't get any configuration
data inside the PerlResponseHandler from any variant of
Apache2::Module::get_config. So my response handler doesn't work right.
Everything's fine when I specify index.page, and when I don't the URI
comes back as index.page, but in the case where DirectoryIndex makes
this happen I don't get any configuration data item.
I have constructed a PerlTransHandler which can be attached to the
VirtualHost. In it I do what DirectoryIndex would do, I check for a
trailing slash and append index.page. When I do this the subsequent
response handler has appropriate configuration data.
I find this odd. Can anyone explain why DirectoryIndex doesn't work the
same as an "equivalent" PerlTransHandler?
please take a look here
http://marc.info/?l=apache-modperl&m=112805393100758&w=2
--GEoff
I read most of that a couple of nights ago while trying to fix the
problem. It seemed to slightly miss the mark at the time, though it
makes more sense now (much other doc reading in the interim).
When I tried implementing Apache2::DirectoryFixup just now it did not
solve the problem. I can see it working via trace statements but I
still don't have configuration objects when I get to the response handler.
It took a while to get it to set the magic value anyway. I had to set
the handler to 'perl-script' in my <directory> block. That isn't
necessary with my PerlTransHandler for some reason.
I do find it interesting that $r->filename is <undef> in my
PerlTransHandler. That would seem to indicate that the trans handler is
called kind of early in the process compared to the fixup handler (quite
obvious from http://perl.apache.org/docs/2.0/user/handlers/http.html).
Maybe that's a clue, maybe a red herring. I just don't know at what
point in the cycle the configuration objects get, um, configured.
It seems like using a <Directory> configuration block as I do the
associated configuration items could not possibly be set until the map
to storage step, so I have to fix things before there, not after. Which
might explain why I get results using a trans handler but not a fixup
handler. But shouldn't mod_dir be part of the trans handler? I should
perhaps look up that code.
I'm not unhappy with my solution, mostly curious. Trying to understand
"why" often helps me solve other problems later. I should probably buy
a copy of the mod_perl cookbook. ;)