[EMAIL PROTECTED] wrote:

 Hi,
   I have the following error while running mod_perl chrooted
which I would appreciate suggestions.
[Sat Feb  8 08:58:30 2003] [error] Can't locate Apache/Test.pm in @INC (@INC contains: /var/www/lib/perl
+/var/www/lib/perl/Apache [...] . /var/www/) at (eval 299) line 3 during global destruction.

I think that becouse of the chroot, /var/www/lib/perl is not a valid path for @INC .
this would make mod_perl look in actual path /var/www/var/www/lib/perl


[Sat Feb 8 08:58:30 2003] [error] Undefined subroutine &Apache::Test::handler called at PerlHandler subroutine
+`Apache::Test' line 1 during global destruction.

ls -la /var/www/lib/perl/Apache
total 10
drwxr-xr-x 2 root daemon 512 Feb 8 09:05 .
drwxr-xr-x 3 root daemon 512 Feb 8 09:05 ..
-r--r--r-- 1 root daemon 7822 Feb 8 08:44 Test.pm

@INC looks fine..
############################################
## httpd.conf changes to test mod_perl chroot
# LoadModule foo_module libexec/mod_foo.so
LoadModule perl_module lib/modules/mod_perl.so
#LoadModule perl_module /usr/lib/apache/modules/mod_perl.so
PerlRequire conf/startup.pl
PerlFreshRestart On
PerlModule Apache
[...]
<Location /hello/test>
SetHandler perl-script
# Options and allow from all will adjust later
Options ExecCGI
allow from all
PerlHandler Apache::Test
</Location>
[...]
EOF

# ok check to make certain chroot has mod_perl dso where it likes it
ls -la /var/www/lib/modules
total 234
drwxr-xr-x 2 root daemon 512 Feb 7 17:53 .
drwxr-xr-x 4 root daemon 512 Feb 7 17:52 ..
-rwxr-xr-x 1 root daemon 227540 Feb 7 17:53 mod_perl.so

# ok make sure conf/startup.pl exists
ls -al /var/www/conf
total 142
drwxr-xr-x 2 root daemon 512 Feb 7 16:41 .
drwxr-xr-x 12 root daemon 512 Feb 8 07:16 ..
-r--r--r-- 1 root bin 34840 Feb 8 09:08 httpd.conf
-r--r--r-- 1 root bin 44119 Oct 3 19:33 httpd.conf-dist
-r--r--r-- 1 root bin 34530 Feb 6 16:39 httpd.conf.bak
-r--r--r-- 1 root bin 12965 Oct 3 19:33 magic
-r--r--r-- 1 root bin 12381 Oct 3 19:33 mime.types
-rw-r--r-- 1 root bin 399 Feb 8 08:39 startup.pl
#used PerlModule Apache to tell httpd to load on startup we always start Fresh with apachectl start
less startup.pl
#!/usr/bin/perl
#modify the include path before we do anything
BEGIN {

# forced insert into @INC to see if this is the problem. nope .. still does not work..
use lib "/var/www/lib/perl/Apache";
use Apache ();
use lib Apache->server_root_relative('lib/perl');

}

#commonly used modules
use Apache::Registry ();
use Apache::Constants ();
use CGI qw(-compile :all);
use CGI::Carp ();

1;

#Well seems like there is something missing. Not sure what. Suggestions?


Best Regards,
[EMAIL PROTECTED]





Reply via email to