You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by James Breat <ko...@hotmail.com> on 2008/02/10 04:28:46 UTC

mod_perl and chroot




Hi,

I am trying to get mod_perl to work in chroot using mod_chroot. It works fine without chroot.
This is the error am getting:

"failed
to resolve handler `ModPerl::Registry': Can't locate
ModPerl/Registry.pm in @INC (@INC contains:
/usr/lib/perl5/5.8.8/i486-linux-thread-multi /usr/lib/perl5/5.8.8
/usr/lib/perl5/site_perl/5.8.8/i486-linux-thread-multi
/usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl .
/usr/local/srv/apache2) at (eval 2) line 3.\n"

locate Registry.pm returns:
/usr/lib/perl5/site_perl/5.8.8/i486-linux-thread-multi/ModPerl/Registry.pm

strace
reports:
stat64("/usr/lib/perl5/site_perl/5.8.8/i486-linux-thread-multi/ModPerl/Registry.pm",
0xbfbf20ac) = -1 ENOENT (No such file or directory)

I know php_mod works fine with mod_chroot without having to copy any libs into the jail, is mod_perl different?

Thanks.

James

_________________________________________________________________
Your Future Starts Here. Dream it? Then be it! Find it at www.seek.com.au
http://a.ninemsn.com.au/b.aspx?URL=http%3A%2F%2Fninemsn%2Eseek%2Ecom%2Eau%2F%3Ftracking%3Dsk%3Ahet%3Ask%3Anine%3A0%3Ahot%3Atext&_t=764565661&_r=OCT07_endtext_Future&_m=EXT

Re: mod_perl and chroot

Posted by Torsten Foertsch <to...@gmx.net>.
On Sun 10 Feb 2008, James Breat wrote:
> to resolve handler `ModPerl::Registry': Can't locate
> ModPerl/Registry.pm in @INC (@INC contains:
> /usr/lib/perl5/5.8.8/i486-linux-thread-multi /usr/lib/perl5/5.8.8
> /usr/lib/perl5/site_perl/5.8.8/i486-linux-thread-multi
> /usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl .
> /usr/local/srv/apache2) at (eval 2) line 3.\n"
>
> locate Registry.pm returns:
> /usr/lib/perl5/site_perl/5.8.8/i486-linux-thread-multi/ModPerl/Registry.pm

I don't think that is true for your new root. So either copy all needed 
modules to it or load them *before* the chroot call. AFAIK mod_chroot 
installs a PostConfig handler at APR_HOOK_REALLY_LAST+10, that means 
really_really_last. Anything before that runs in the original root and hence 
can load modules, see

 http://perl.apache.org/docs/2.0/user/handlers/server.html#Server_Life_Cycle

Torsten