You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Jason W May <jm...@majalin.com> on 2002/08/07 19:14:15 UTC

PerlChildInitHandler doesn't work inside VirtualHost?

Running mod_perl 1.26 on Apache 1.3.24.

I've found that if I place my PerlChildInitHandler inside a VirtualHost
block, it is never called.

This works:

...

PerlModule              Foo
PerlChildInitHandler    Foo::handler

<VirtualHost *:80>

...
PerlHandler		MyModule
...

</VirtualHost>



but this doesn't:


<VirtualHost *:80>

PerlModule              Foo
PerlChildInitHandler    Foo::handler
...
PerlHandler		MyModule

</VirtualHost>


I don't see why VirtualHost would make a difference for child-init 
handlers.  What else could I be doing wrong?

Thanks,
-Jason



Re: PerlChildInitHandler doesn't work inside VirtualHost?

Posted by Ed Grimm <ed...@tgape.org>.
On Thu, 8 Aug 2002, Rick Myers wrote:

> On Aug 09, 2002 at 12:16:45 +1000, Cees Hek wrote:
>> Quoting Jason W May <jm...@majalin.com>:
>>> Running mod_perl 1.26 on Apache 1.3.24.
>>> 
>>> I've found that if I place my PerlChildInitHandler inside a VirtualHost
>>> block, it is never called.
>> 
>> It doesn't really make sense to put a PerlChildInitHandler
>> inside a VirtualHost directive.
> 
> Why? The Eagle book says this is a perfectly valid concept.

Well, for one thing, it would only call the handler if a request to that
virtual host was the first request for that child.  Assuming it works;
I'd think this would be a good canidate for a case that's never been
tested before, due to the fact that it would not call the handler if the
request that initiated the child was not to that virtual host...

It would fail to work in all cases if Apache does not recognize what
triggered the child until after child init.  Looking over pages 59
through 61, 72 and 73, this appears to me to be the case.  Yes, it does
explicitly say that it's ok in virtual host blocks, but it doesn't say
it works.

Ed


Re: PerlChildInitHandler doesn't work inside VirtualHost?

Posted by Rick Myers <ri...@sumthin.nu>.
On Aug 09, 2002 at 12:16:45 +1000, Cees Hek wrote:
> Quoting Jason W May <jm...@majalin.com>:
> > Running mod_perl 1.26 on Apache 1.3.24.
> > 
> > I've found that if I place my PerlChildInitHandler inside a VirtualHost
> > block, it is never called.
> 
> It doesn't really make sense to put a PerlChildInitHandler
> inside a VirtualHost directive.

Why? The Eagle book says this is a perfectly valid concept.

--rick


Re: PerlChildInitHandler doesn't work inside VirtualHost?

Posted by "Jason W. May" <jm...@pobox.com>.
(I found a better way to do what I wanted, avoiding PerlChildInitHandler 
completely, but still...)

My reason for wanting PerlChildInitHandler (and PerlChildExitHandler) 
inside VirtualHost is
to be able to keep these declarations close to the PerlHandlers that 
rely on them.  I like to
put my VirtualHost conf sections inside separate Include config files so 
that I can leave the
main httpd.conf fairly static.

If ChildInitHandler is not allowed inside VirtualHost, it should 
generate an exception when
the config file is parsed.  Instead, it silently ignores the declaration.

-Jason


Cees Hek wrote:

>Quoting Jason W May <jm...@majalin.com>:
>
>  
>
>>Running mod_perl 1.26 on Apache 1.3.24.
>>
>>I've found that if I place my PerlChildInitHandler inside a VirtualHost
>>block, it is never called.
>>    
>>
>
>It doesn't really make sense to put a PerlChildInitHandler inside a VirtualHost
>directive.  It is only called when the Apache Child process is created, not when
>a new request comes in.
>
>If you explain what you are trying to accomplish, maybe we can recommend a
>better Handler to tie into.
>
>Cees
>  
>


Re: PerlChildInitHandler doesn't work inside VirtualHost?

Posted by Cees Hek <ce...@sitesuite.com.au>.
Quoting Jason W May <jm...@majalin.com>:

> 
> Running mod_perl 1.26 on Apache 1.3.24.
> 
> I've found that if I place my PerlChildInitHandler inside a VirtualHost
> block, it is never called.

It doesn't really make sense to put a PerlChildInitHandler inside a VirtualHost
directive.  It is only called when the Apache Child process is created, not when
a new request comes in.

If you explain what you are trying to accomplish, maybe we can recommend a
better Handler to tie into.

Cees