[mp2] httpd.conf Perl block problems

2003-05-29 Thread Warren Young
I've got a working Apache::ASP application that has been used mainly on 
more-or-less stock Red Hat Linux 7.2 and 7.3 systems (Apache 1.3.2x, 
mod_perl 1.26, perl 5.6.1).  I tried moving it to a Red Hat Linux 9 
system (Apache 2.0.40, mod_perl 1.99_07, perl 5.8.0) and it failed.

The bugs I'm seeing are tickled by the Perl block I've been using in 
httpd.conf on the RH7 systems.  This block contains an 
Apache::ASP-Loader() directive, which precompiles all of the scripts 
before the httpd children are forked off, for efficiency.  If I comment 
this optional Perl block out, httpd starts up fine.

The first bug is a known one: apparently, recent mod_perls are sensitive 
to the syntax of the Perl tag: they require a space in it, like this: 
Perl   I hope this is just a bug that hasn't risen to the top of the 
priority list yet, and that the mod_perl folk don't intend to keep this 
sytax.

Once that was fixed, I found a new problem.  I recieved errors like this:

Syntax error on line 1059 of /etc/httpd/conf/httpd.conf:
Bareword Apache::OK not allowed while strict subs in use at 
/usr/lib/perl5/site_perl/5.8.0//i386-linux-thread-multi/Apache/PerlSection.pm 
line 47.!BEGIN not safe after errors--compilation aborted at 
/usr/lib/perl5/site_perl/5.8.0//i386-linux-thread-multi/Apache/PerlSection.pm 
line 58.!Compilation failed in require at (eval 57) line 3.!

Line 1059 is the /Perl line.  If I comment out the use strict 
directive at the top of PerlSection.pm, this problem goes away.  I'm not 
sure what the correct fix is, but I hope this is enough information to 
lead one of the mod_perl developers to a solution.

I replaced the mod_perl Red Hat shippped with v1.99_09 while chasing 
this problem, so that's the version I changed.



Re: [mp2] httpd.conf Perl block problems

2003-05-29 Thread Geoffrey Young

The first bug is a known one: apparently, recent mod_perls are sensitive 
to the syntax of the Perl tag: they require a space in it, like this: 
Perl   I hope this is just a bug that hasn't risen to the top of the 
priority list yet, and that the mod_perl folk don't intend to keep this 
sytax.
this is due to a limitation of apache 2.0.  there _may_ be a way around it, 
but probably not any time soon.

Once that was fixed, I found a new problem.  I recieved errors like this:

Syntax error on line 1059 of /etc/httpd/conf/httpd.conf:
Bareword Apache::OK not allowed while strict subs in use at 
/usr/lib/perl5/site_perl/5.8.0//i386-linux-thread-multi/Apache/PerlSection.pm 
line 47.!BEGIN not safe after errors--compilation aborted at 
/usr/lib/perl5/site_perl/5.8.0//i386-linux-thread-multi/Apache/PerlSection.pm 
line 58.!Compilation failed in require at (eval 57) line 3.!
try this patch, which was introduced after 1.99_09

Index: lib/Apache/PerlSection.pm
===
RCS file: /home/cvspublic/modperl-2.0/lib/Apache/PerlSection.pm,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- lib/Apache/PerlSection.pm   7 Oct 2002 15:45:52 -   1.3
+++ lib/Apache/PerlSection.pm   20 May 2003 01:20:09 -  1.4
@@ -7,6 +7,10 @@
 use Apache::CmdParms ();
 use Apache::Directive ();
+use APR::Table ();
+use Apache::Server ();
+use Apache::ServerUtil ();
+use Apache::Const -compile = qw(OK);
 use constant SPECIAL_NAME = 'PerlConfig';

--Geoff



Re: [mp2] httpd.conf Perl block problems

2003-05-29 Thread Warren Young
Geoffrey Young wrote:

sensitive to the syntax of the Perl tag: they require a space in it, 
this is due to a limitation of apache 2.0.  there _may_ be a way around 
it, but probably not any time soon.
I can live with that.  It's good enough to know that you (plural) aren't 
thrilled with it, either, and intend to fix it some day.  :)

try this patch, which was introduced after 1.99_09
[snip]
+use Apache::Const -compile = qw(OK);
Without trying it, I'm sure that line will fix the error I'm seeing. 
I'd try it, but my RH9 box can't be disturbed at the moment.

Thanks!



Re: [mp2] httpd.conf Perl block problems

2003-05-29 Thread Geoffrey Young


+use Apache::Const -compile = qw(OK);


Without trying it, I'm sure that line will fix the error I'm seeing. I'd 
try it, but my RH9 box can't be disturbed at the moment.
you will find that you need all the lines in that patch to get it to work - 
the error you are seeing is just masking others that will occur at runtime :)

--Geoff



Re: [mp2] httpd.conf Perl block problems

2003-05-29 Thread Philippe M. Chiasson
On Thu, 2003-05-29 at 05:24, Warren Young wrote:
 Geoffrey Young wrote:
  
  sensitive to the syntax of the Perl tag: they require a space in it, 
  
  this is due to a limitation of apache 2.0.  there _may_ be a way around 
  it, but probably not any time soon.
 
 I can live with that.  It's good enough to know that you (plural) aren't 
 thrilled with it, either, and intend to fix it some day.  :)

Oy! Indeed. I am the guilty person to blame for not having fixed it
quite yet. And yes, we are all very much aware of it ;-( But I am happy
to say : It's httpd's fault!.

  try this patch, which was introduced after 1.99_09
 [snip]
  +use Apache::Const -compile = qw(OK);
 
 Without trying it, I'm sure that line will fix the error I'm seeing. 
 I'd try it, but my RH9 box can't be disturbed at the moment.
 
 Thanks!
-- 
-- -
Philippe M. Chiasson /gozer\@(cpan|ectoplasm)\.org/ 88C3A5A5 (122FF51B/C634E37B)
http://gozer.ectoplasm.org/F9BF E0C2 480E 7680 1AE5 3631 CB32 A107 88C3 A5A5
Q: It is impossible to make anything foolproof because fools are so ingenious.
perl -e'$$=\${gozer};{$_=unpack(P7,pack(L,$$));/^JAm_pH\n$/print||$$++redo}'


signature.asc
Description: This is a digitally signed message part