> Which section you refer to? I can only see nph mentioned in:
> http://perl.apache.org/docs/1.0/guide/config.html#E_lt_LocationE_gt__Configuration
> saying:
>
>   PerlSendHeader On tells the server to send an HTTP headers to the
>   browser on every script invocation. You will want to turn this off
>   for nph (non-parsed-headers) scripts.
>
> it doesn't say anything about files.
>

Mea Culpa. The info about the files directive came from the Porting
and Coding guidelines.
(http://perl.apache.org/docs/1.0/guide/porting.html#NPH__Non_Parsed_Headers__scripts)


> > This caused a bit of a problem, apparently caused by the fact that
> > Location is merged AFTER Files, and overrides the former if the NPH is
> > under the specified directory, effectively cancelling it out.
>
> right,
> >http://perl.apache.org/docs/1.0/guide/config.html#How_Directory__Location_and_Files_Sections_are_Merged

Yeah, that's where I found it when I was digging to try and figure out
WTF was going wrong.

>
> > The best ways to fix this that I came up with are either to:
> > A) have a seperate Location aliased to the same physical location,
> > without the PerlSendHeader On  directive. This makes the Files
> > directive unneccessary.
> >
> > B) Remove the PerlSendHeader directive from the Location block
> > completely, and instead add a Directory block for the location being
> > Aliased (e.g. /usr/local/apache/) with PerlSendHeader set in that.
> > Then the Files directive will correctly override PerlSendHeader and
> > NPH scripts function correctly.
> >
> > It's entirely possible (and even likely) that I missed something
> > obvious and/or made some dumb error, so if there's a cleaner or more
> > efficient way, or something I need to do to make the documented way
> > work right, I'd be grateful for the info.
>
> Patches to improve the explanation(s) will be gladly accepted.
>

My first instinct would be to simply update the NPH section in the
coding guidelines with these two options, and I'm definitely willing
to do so unless someone has an idea of a better way to go about it.

Reply via email to