mod_perl and chroot

mod_perl and chroot

am 10.02.2008 04:28:46 von James Breat

--_d7ff2d4b-b772-4371-9367-8ebade92f8f1_
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable





Hi,

I am trying to get mod_perl to work in chroot using mod_chroot. It works fi=
ne 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/ModPe rl/Registry.pm

strace
reports:
stat64("/usr/lib/perl5/site_perl/5.8.8/i486-linux-thread-mul ti/ModPerl/Regi=
stry.pm",
0xbfbf20ac) =3D -1 ENOENT (No such file or directory)

I know php_mod works fine with mod_chroot without having to copy any libs i=
nto 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=3Dhttp%3A%2F%2Fninemsn%2E seek%2Ecom%2Eau=
%2F%3Ftracking%3Dsk%3Ahet%3Ask%3Anine%3A0%3Ahot%3Atext&_t=3D 764565661&_r=3D=
OCT07_endtext_Future&_m=3DEXT=

--_d7ff2d4b-b772-4371-9367-8ebade92f8f1_
Content-Type: text/html; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable









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:

"fail=
ed
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 re=
turns:
/usr/lib/perl5/site_perl/5.8.8/i486-linux-thread-multi/ModPe rl/Re=
gistry.pm

strace
reports:
stat64("/usr/lib/perl5/site_perl/5.8.8/i486-linux-thread-mul ti/ModPerl/Regi=
stry.pm",
0xbfbf20ac) =3D -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


Find it a=
t www.seek.com.au F%2Fninemsn%2Eseek%2Ecom%2Eau%2F%3Ftracking%3Dsk%3Ahet%3Ask% 3Anine%3A0%3Aho=
t%3Atext&_t=3D764565661&_r=3DOCT07_endtext_Future&_m=3DEXT' target=3D'_new'=
>Your Future Starts Here. Dream it? Then be it!

=

--_d7ff2d4b-b772-4371-9367-8ebade92f8f1_--

Re: mod_perl and chroot

am 10.02.2008 11:35:16 von torsten.foertsch

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/ModPe rl/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#Se rver_Life_Cycle

Torsten