mod_perl

Wesley Darlington wesley at yelsew.com
Tue Sep 18 10:37:50 CDT 2001


Hi,

On Tue, Sep 18, 2001 at 03:40:40PM +0100, barry wrote:
> On Tue, Sep 18, 2001 at 03:29:04PM +0100, barry mumbled:
> > > Do you see an environment variable named MOD_PERL?
> > yes

Oh good.

> > > What do you get when you telnet to port 80 and request the file by hand?
> > > Finally, what happens with PerlSendHeader On?
> > Hmmmm, I just turned PerlSendHeader back on, to show this stuff for you, and
> > .. Uh, now it's doing what it should, i.e. the Header is being sent to the
> > browser by something, the one the cgi is sending isn't being shown, and the
> > page looks like what it should ... I'm lost :)

Aye, thought it might. Went away and read up again on PerlSendHeader just
before sent last message. Hence suggestion to try "On". It's quite
unintuitive (IMHO) and not a little bit devious. If you were sending
headers with CGI functions/methods instead of "by hand", you'd probably
have been OK.

AIUI, if Off, apache assumes you're not sending headers by hand and makes
some up for you. With CGI and $r-> methods you can change them. If On,
apache scans your script's output for headers and normalises them and/or
sticks in ones you're missing.

Apache et al seem to have the odd notion that it's *their* responsibility
to ensure correctness of HTTP headers. :-)

> further, pages running with the mod_perl stuff are being excuted as the
> webserver, I assume this is normal under mod_perl, 

Yes. This is normal...

>                                                    but I generally have them
> suexec to run as the owner, this may well be something I come across in my
> reading of docs and stuff while doing actual rewrites of the code to start
> taking proper advantage of things

...and even required. The whole point of mod_perl is that all perl runs
*inside* the apache process handling the HTTP request. If you require 
your code not to run as the apache user, mod_perl is not the api
you're looking for. Move along. :-)

Wesley.



More information about the Belfast-pm mailing list