Turns out the solution to my problem was quite simple.  I replaced:

<Directory ${WEB_07_ROOT}/tools>
     DataSources     Environment
</Directory>

with:

<Location /tools/environment.page>
    DataSources     Environment
</Location>

and all of my problems resolved. I am no longer using any PerlTransHandler or PerlFixupHandler (as described in other emails), just DirectoryIndex and Alias. Works like a charm.

Apparently the problem was twofold. First, <directory> was the wrong tag to use. Second, even with <location>, I had to be very specific. Specifying the directory didn't work as it was too general. I had to attach the configuration to the specific file, which was more correct anyway. Never use a shotgun when you need a target rifle. ;)

Along the way I did some testing to determine at what phase of the response cycle the configuration objects are set. It looks like they are done in the Fixup phase after any PerlFixupHandler is run. In case anyone needs to know.

Thanks for all the various suggestions.  This has all been very informative.

Marc M. Adkins

I define a generalized output filter for any .page file:

<FilesMatch "\.page">
     SetHandler              perl-script
     PerlOutputFilterHandler Layout
</FilesMatch>

I have a <Directory> block:

<Directory ${WEB_07_ROOT}/tools>
     DataSources     Environment
</Directory>

which I'm referencing via an Alias from a VirtualHost:

<VirtualHost *:${WEB_07_PORT}>
     ServerName      home.Dimension.org
     DocumentRoot    ${WEB_07_ROOT}/dimension
     DirectoryIndex  index.page

     Alias           /tools ${WEB_07_ROOT}/tools

     <FilesMatch "\.page">
         SetHandler              perl-script
         PerlResponseHandler     Data
     </FilesMatch>
</VirtualHost>

(never mind the macro expansion strings, I'm pre-processing the
configuration file because it's just easier that way).

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?

Reply via email to