Re: httpd chroot 3.2 mod_perl

2003-02-09 Thread [EMAIL PROTECTED]
On Sun, Feb 09, 2003 at 03:30:09PM +1100, Stas Bekman wrote:
 [EMAIL PROTECTED] wrote:
Hi,

  use lib Apache-server_root_relative('/lib/perl');
  in the chrooting of mod_perl the server_root_relative() is 
  absolute to the new chroot '/' not relative as in ('lib/perl)
  
Best Regards,
[EMAIL PROTECTED]



Re: httpd chroot 3.2 mod_perl

2003-02-08 Thread Stas Bekman
[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.

[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


Because there is Apache::Test from the test suite (which doesn't have a 
function called 'handler') installed under @INC, and it probably happens to 
get loaded before your Apache::Test. Rename your package and it'll probably 
just work.

[p.s. it's a good practice not to hit reply on another thread's message, but 
to start a new mail when you start a new thread, otherwise you mess up the 
previous thread and the current one.]

__
Stas BekmanJAm_pH -- Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide --- http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com



Re: httpd chroot 3.2 mod_perl

2003-02-08 Thread David Nicely
[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_modulelib/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  daemon512 Feb  7 16:41 .
drwxr-xr-x  12 root  daemon512 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]