AW: PerlSwitches -M and @INC

2003-01-27 Thread Helmut Zeilinger
Hi,

after i recompiled the newest versions of perl, apache and mod_perl on
my home computer with the appropriate debug switches, i cannot reproduce
the Segmentation Faults any more, too.
At my machine at work i found out that the problem had to do with the
DBI module, which i additionally loaded. After installing the newest
version of DBI and/or not loading this module, no Segmentation faults
happened any more.

Concerning the PerlOptions:

From the results below i conclude:

+Parent means everything is new in the virtual host. You have to add the
libs and paths you need all there.

+Clone means everything is cloned from the main configuration. To add
a private lib path you have to call a second startup script with the
lib path you need included. The PerlSwitches -Mlib=.. in the virtual
host section are ignored.

+inherit makes no difference at all (probably i did/do not understand
that option)

So after everything is clear now (i have to sleep one night over it) i
will continue moving from 1.3 to 2.0.

Thanks for your help

Helmut



1) 

httpd.conf:

PerlRequire /tmp/install/apache2/conf/startup.pl
PerlSwitches -Mlib=/test1

NameVirtualHost 127.0.0.1:8080
VirtualHost 127.0.0.1:8080
   ..
PerlOptions +Parent
PerlModule  Apache2
PerlSwitches -Mlib=/test2/lib
  ..
/VirtualHost

startup.pl:

#!/usr/bin/perl
use Apache2;
use ModPerl::Registry;
1;


The result of @INC in a perl script:

/usr/local/lib/perl5/site_perl/5.8.0/i686-linux-thread-multi/Apache2
/test2/lib
/usr/local/lib/perl5/5.8.0/i686-linux-thread-multi
/usr/local/lib/perl5/5.8.0
/usr/local/lib/perl5/site_perl/5.8.0/i686-linux-thread-multi
/usr/local/lib/perl5/site_perl/5.8.0
/usr/local/lib/perl5/site_perl
.


2)

httpd.conf:

PerlRequire /tmp/install/apache2/conf/startup.pl
PerlSwitches -Mlib=/test1

VirtualHost 127.0.0.1:8080
..
PerlOptions +Clone
PerlSwitches -Mlib=/test2/lib
..  
/VirtualHost

startup.pl: see above

@INC:

/usr/local/lib/perl5/site_perl/5.8.0/i686-linux-thread-multi/Apache2
/test1
/usr/local/lib/perl5/5.8.0/i686-linux-thread-multi
/usr/local/lib/perl5/5.8.0
/usr/local/lib/perl5/site_perl/5.8.0/i686-linux-thread-multi
/usr/local/lib/perl5/site_perl/5.8.0
/usr/local/lib/perl5/site_perl
.

3)

+Clone  and +inherit the same result as 2)

4)

httpd.conf:

PerlRequire /tmp/install/apache2/conf/startup.pl
PerlSwitches -Mlib=/test1

VirtualHost 127.0.0.1:8080
..
PerlOptions +Clone
PerlRequire /tmp/install/apache2/conf/addlib.pl
..  
/VirtualHost

startup.pl: see above
addlib.pl:
..
use lib '/addlib';
..

@INC:

/addlib 
/usr/local/lib/perl5/site_perl/5.8.0/i686-linux-thread-multi/Apache2
/test1
/usr/local/lib/perl5/5.8.0/i686-linux-thread-multi
/usr/local/lib/perl5/5.8.0
/usr/local/lib/perl5/site_perl/5.8.0/i686-linux-thread-multi
/usr/local/lib/perl5/site_perl/5.8.0
/usr/local/lib/perl5/site_perl
.   


-Ursprüngliche Nachricht-
Von: Stas Bekman [mailto:[EMAIL PROTECTED]]
Gesendet: Samstag, 25. Januar 2003 11:25
An: Helmut Zeilinger
Cc: [EMAIL PROTECTED]
Betreff: Re: PerlSwitches -M and @INC


Dr. Helmut Zeilinger wrote:
 I tried:
 
   PerlOptions +Parent
 #  PerlOptions +Clone
 
 
   PerlModule  Apache2
   PerlModule Apache::compat
   PerlSwitches -Mlib=/et/www/envirotex/lib
 
 The result is a Segmentation fault without any further messages on
the 
 screen and in the error_log file.

I can't reproduce it. Please send in the backtrace from the core file
and the 
rest of the details. See:
http://perl.apache.org/docs/2.0/user/help/help.html#Reporting_Problems

 When I try:
 
 #   PerlOptions +Parent
   PerlOptions +Clone
 
 
   PerlModule  Apache2
   PerlModule Apache::compat
   PerlSwitches -Mlib=/et/www/envirotex/lib

If you use the +Clone, it already inherits everything from the parent, 
including @INC. So you don't need the last 3 lines. It works just fine
for me 
with 'PerlOptions +Clone'.

Perhaps you can send in your httpd.conf after you have reduced it to the
very 
minimum (including the minimal startup.pl that still reproduces the
problem)

 the result

Re: PerlSwitches -M and @INC

2003-01-25 Thread Stas Bekman
Dr. Helmut Zeilinger wrote:

I tried:

  PerlOptions +Parent
#  PerlOptions +Clone


  PerlModule  Apache2
  PerlModule Apache::compat
  PerlSwitches -Mlib=/et/www/envirotex/lib

The result is a Segmentation fault without any further messages on the 
screen and in the error_log file.

I can't reproduce it. Please send in the backtrace from the core file and the 
rest of the details. See:
http://perl.apache.org/docs/2.0/user/help/help.html#Reporting_Problems

When I try:

#   PerlOptions +Parent
  PerlOptions +Clone


  PerlModule  Apache2
  PerlModule Apache::compat
  PerlSwitches -Mlib=/et/www/envirotex/lib


If you use the +Clone, it already inherits everything from the parent, 
including @INC. So you don't need the last 3 lines. It works just fine for me 
with 'PerlOptions +Clone'.

Perhaps you can send in your httpd.conf after you have reduced it to the very 
minimum (including the minimal startup.pl that still reproduces the problem)

the result is:

[Thu Jan 23 09:12:19 2003] [error] Can't locate 
Emma/AuthCookieHandler.pm in @INC (@INC contains: 
/usr/lib/perl5/site_perl/5.8.0/i686-linux-thread-multi/Apache2 
/usr/lib/perl5/5.8.0/i686-linux-thread-multi /usr/lib/perl5/5.8.0 
/usr/lib/perl5/site_perl/5.8.0/i686-linux-thread-multi 
/usr/lib/perl5/site_perl/5.8.0 /usr/lib/perl5/site_perl/5.6.1 
/usr/lib/perl5/site_perl .) at (eval 5) line 3.

[Thu Jan 23 09:12:19 2003] [error] Can't load Perl module 
Emma::AuthCookieHandler for server www.et:0, exiting...

The Module Emma::AuthCookieHandler is in the path 
/et/www/envirotex/lib. As i see from the message above the additional 
lib path is missing from the @INC Array.


__
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: PerlSwitches -M and @INC

2003-01-23 Thread Dr. Helmut Zeilinger
I tried:

  PerlOptions +Parent 

#  PerlOptions +Clone 



  PerlModule  Apache2 

  PerlModule Apache::compat 

  PerlSwitches -Mlib=/et/www/envirotex/lib

The result is a Segmentation fault without any further messages on the 
screen and in the error_log file.

When I try:

#   PerlOptions +Parent 

  PerlOptions +Clone 



  PerlModule  Apache2 

  PerlModule Apache::compat 

  PerlSwitches -Mlib=/et/www/envirotex/lib

the result is:

[Thu Jan 23 09:12:19 2003] [error] Can't locate Emma/AuthCookieHandler.pm 
in @INC (@INC contains: 
/usr/lib/perl5/site_perl/5.8.0/i686-linux-thread-multi/Apache2 
/usr/lib/perl5/5.8.0/i686-linux-thread-multi /usr/lib/perl5/5.8.0 
/usr/lib/perl5/site_perl/5.8.0/i686-linux-thread-multi 
/usr/lib/perl5/site_perl/5.8.0 /usr/lib/perl5/site_perl/5.6.1 
/usr/lib/perl5/site_perl .) at (eval 5) line 3.

[Thu Jan 23 09:12:19 2003] [error] Can't load Perl module 
Emma::AuthCookieHandler for server www.et:0, exiting...

The Module Emma::AuthCookieHandler is in the path 
/et/www/envirotex/lib. As i see from the message above the additional lib 
path is missing from the @INC Array.

Helmut

--On Donnerstag, 23. Januar 2003 12:42 +1100 Stas Bekman [EMAIL PROTECTED] 
wrote:

Helmut Zeilinger wrote:

Hi,

i am trying Apache 2.0.44 and mod_perl 1.99_08.

httpd.conf :Bevor all virtual hosts

	PerlRequire /usr/local/apache2/conf/virtual/startup.pl

The content of startup.pl is as in the mod_perl documentation including
the use Apache::compat() directive.

I one of my V-hosts i say (as described in the documentation):

	PerlOptions +Parent

	PerlSwitches -Mlib=/et/www/envirotex/lib

When I start the server i get the error message:


[Wed Jan 22 13:52:07 2003] [error] Can't locate loadable object for
module Apache::Constants in @INC (@INC contains: /et/www/envirotex/lib
/usr/lib/perl5/5.8.0/i686-linux-thread-multi /usr/lib/perl5/5.8.0
/usr/lib/perl5/site_perl/5.8.0/i686-linux-thread-multi
/usr/lib/perl5/site_perl/5.8.0 /usr/lib/perl5/site_perl/5.6.1
/usr/lib/perl5/site_perl .) at
/usr/lib/perl5/site_perl/5.8.0/i686-linux-thread-multi/mod_perl.pm line
14
Compilation failed in require at
/usr/lib/perl5/site_perl/5.8.0/i686-linux-thread-multi/Apache.pm line 6.
BEGIN failed--compilation aborted at
/usr/lib/perl5/site_perl/5.8.0/i686-linux-thread-multi/Apache.pm line 6.
Compilation failed in require at
/et/www/envirotex/lib/Emma/AuthCookieHandler.pm line 3.
BEGIN failed--compilation aborted at
/et/www/envirotex/lib/Emma/AuthCookieHandler.pm line 3.
Compilation failed in require at (eval 1) line 3.

[Wed Jan 22 13:52:07 2003] [error] Can't load Perl module
Emma::AuthCookieHandler for server www.et:0, exiting...


It seems to me, that all of the Apache2 paths create by the use
Apache2 directive are no more present in the @INC Array.

I tried a lot of things with several combinations of PerlSwitches (-M,
-I, -Mblib, -Mlib), and startup files, but I never got the result i
want:

I would like to load some private Modules under
/et/www/envirotex/lib and all the other things should work too.


That's because you get a completely new interpreter. So you have to run
Apache2 again

   PerlOptions +Parent
   PerlModule Apache2

Does that work for you?

I agree that this is not-intuitive and adds to a clutter. I suppose that
this should be documented for the time being. And hopefully by the time
2.0 is released we will come up with a transparent solution.

Have you tried using the +Clone option instead?
http://perl.apache.org/docs/2.0/user/config/config.html#C_Clone_

__
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







PerlSwitches -M and @INC

2003-01-22 Thread Helmut Zeilinger
Hi,

i am trying Apache 2.0.44 and mod_perl 1.99_08.

httpd.conf :Bevor all virtual hosts

PerlRequire /usr/local/apache2/conf/virtual/startup.pl

The content of startup.pl is as in the mod_perl documentation including
the use Apache::compat() directive.

I one of my V-hosts i say (as described in the documentation):

PerlOptions +Parent

PerlSwitches -Mlib=/et/www/envirotex/lib  

When I start the server i get the error message:


[Wed Jan 22 13:52:07 2003] [error] Can't locate loadable object for
module Apache::Constants in @INC (@INC contains: /et/www/envirotex/lib
/usr/lib/perl5/5.8.0/i686-linux-thread-multi /usr/lib/perl5/5.8.0
/usr/lib/perl5/site_perl/5.8.0/i686-linux-thread-multi
/usr/lib/perl5/site_perl/5.8.0 /usr/lib/perl5/site_perl/5.6.1
/usr/lib/perl5/site_perl .) at
/usr/lib/perl5/site_perl/5.8.0/i686-linux-thread-multi/mod_perl.pm line
14
Compilation failed in require at
/usr/lib/perl5/site_perl/5.8.0/i686-linux-thread-multi/Apache.pm line 6.
BEGIN failed--compilation aborted at
/usr/lib/perl5/site_perl/5.8.0/i686-linux-thread-multi/Apache.pm line 6.
Compilation failed in require at
/et/www/envirotex/lib/Emma/AuthCookieHandler.pm line 3.
BEGIN failed--compilation aborted at
/et/www/envirotex/lib/Emma/AuthCookieHandler.pm line 3.
Compilation failed in require at (eval 1) line 3.

[Wed Jan 22 13:52:07 2003] [error] Can't load Perl module
Emma::AuthCookieHandler for server www.et:0, exiting...


It seems to me, that all of the Apache2 paths create by the use
Apache2 directive are no more present in the @INC Array.

I tried a lot of things with several combinations of PerlSwitches (-M,
-I, -Mblib, -Mlib), and startup files, but I never got the result i
want:

I would like to load some private Modules under
/et/www/envirotex/lib and all the other things should work too. 


Helmut








Re: PerlSwitches -M and @INC

2003-01-22 Thread Stas Bekman
Helmut Zeilinger wrote:

Hi,

i am trying Apache 2.0.44 and mod_perl 1.99_08.

httpd.conf :Bevor all virtual hosts

	PerlRequire /usr/local/apache2/conf/virtual/startup.pl

The content of startup.pl is as in the mod_perl documentation including
the use Apache::compat() directive.

I one of my V-hosts i say (as described in the documentation):

	PerlOptions +Parent

	PerlSwitches -Mlib=/et/www/envirotex/lib  

When I start the server i get the error message:


[Wed Jan 22 13:52:07 2003] [error] Can't locate loadable object for
module Apache::Constants in @INC (@INC contains: /et/www/envirotex/lib
/usr/lib/perl5/5.8.0/i686-linux-thread-multi /usr/lib/perl5/5.8.0
/usr/lib/perl5/site_perl/5.8.0/i686-linux-thread-multi
/usr/lib/perl5/site_perl/5.8.0 /usr/lib/perl5/site_perl/5.6.1
/usr/lib/perl5/site_perl .) at
/usr/lib/perl5/site_perl/5.8.0/i686-linux-thread-multi/mod_perl.pm line
14
Compilation failed in require at
/usr/lib/perl5/site_perl/5.8.0/i686-linux-thread-multi/Apache.pm line 6.
BEGIN failed--compilation aborted at
/usr/lib/perl5/site_perl/5.8.0/i686-linux-thread-multi/Apache.pm line 6.
Compilation failed in require at
/et/www/envirotex/lib/Emma/AuthCookieHandler.pm line 3.
BEGIN failed--compilation aborted at
/et/www/envirotex/lib/Emma/AuthCookieHandler.pm line 3.
Compilation failed in require at (eval 1) line 3.

[Wed Jan 22 13:52:07 2003] [error] Can't load Perl module
Emma::AuthCookieHandler for server www.et:0, exiting...


It seems to me, that all of the Apache2 paths create by the use
Apache2 directive are no more present in the @INC Array.

I tried a lot of things with several combinations of PerlSwitches (-M,
-I, -Mblib, -Mlib), and startup files, but I never got the result i
want:

I would like to load some private Modules under
/et/www/envirotex/lib and all the other things should work too. 

That's because you get a completely new interpreter. So you have to run 
Apache2 again

  PerlOptions +Parent
  PerlModule Apache2

Does that work for you?

I agree that this is not-intuitive and adds to a clutter. I suppose that this 
should be documented for the time being. And hopefully by the time 2.0 is 
released we will come up with a transparent solution.

Have you tried using the +Clone option instead?
http://perl.apache.org/docs/2.0/user/config/config.html#C_Clone_

__
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