Re: mod_perl.c Not Compatible with Apache

2003-01-06 Thread Stas Bekman
Dale Lancaster wrote:

Trying to narrow down a problem I am having with mod_perl::PerlRun on a
stock RedHat 8.0 system, I have the following that simply doesn't work
reliably under Apache 2.0.40 and mod_perl-1.99_05-3.  The script runs fine
for the first few refreshes and then I get the ominous error message:

Error message:
Not a CODE reference at /home/usa/cgi-bin/env.cgi line 7.


Thanks for the report, Dale.

Please try again with the current cvs, I've just committed a bug fix and 
a test that was reproducing it based on your report.

__
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: mod_perl.c Not Compatible with Apache

2003-01-04 Thread Dale Lancaster

Trying to narrow down a problem I am having with mod_perl::PerlRun on a
stock RedHat 8.0 system, I have the following that simply doesn't work
reliably under Apache 2.0.40 and mod_perl-1.99_05-3.  The script runs fine
for the first few refreshes and then I get the ominous error message:

Error message:
Not a CODE reference at /home/usa/cgi-bin/env.cgi line 7.

After a few retries and then nothing seems to fix it until I do a cold
restart on Apache.

env.cgi is:

#!/usr/bin/perl

print Content-type: text/html\n\n;

require /home/usa/cgi-bin/authlib_test.pl ;

my $status = testsub() ;

foreach (keys %ENV){
print $_ - $ENV{$_}br\n;
}

and the file authlib_test.pl contains:

sub testsub {

return 1 ;
}

1;


If I move the code for authlib_test.pl into env.cgi, it works all the time,
moving it into that seperate file that is required seems to break it.  I am
trying to reproduce a code snippet that causes my production mod_perl
programs to produce a zero byte response page (no data returned, but returns
with a status 200).  But this is far as I get.

The config is:

LoadModule perl_module modules/mod_perl.so
PerlModule Apache2
Alias /perl /home/usa/cgi-bin
Directory /home/usa/cgi-bin
SetHandler perl-script
PerlHandler ModPerl::PerlRun
PerlOptions +ParseHeaders
PerlSendHeader On
Options ExecCGI FollowSymLinks Includes
/Directory

I also tried this on the CVS code for apache and mod_perl and get the same
results, so I dropped back to the standard RPM versions with RedHat.

Any ideas?
thanks
dale




mod_perl.c Not Compatible with Apache

2003-01-03 Thread Steve Davis
Upon successfully compiling mod_perl 2.0, and modifying httpd.conf so
that it becomes invoked at the start of Apache 2.0.43, the following
error message is gernerated.  It is httpd failed. The error was:
Starting httpd: httpd: module mod_perl.c is not compatible with this
version of Apache.
Please contact the vendor for the correct version. [FAILED]

If you would like you, may refer to the previous thread named mod_perl
make failed: cannot find -lapr for a history of the root of this
problem-particularly the last post directly before this article.  This
also shows the detail environment and configuration for the server in
question.  Else, I would be glad more details to this post.  In brief,
let me say, the system consists of RH 8.0, apache 2.0.43, and current
CVS edition of mod_perl 2.0.  It has a date stamp of 1/1/03.

This is one problem which I don't know how to proceed with.  Is this
message saying the code in mod_perl's mod_perl.c is using an edition
of 'C' code that is incompatible with Apache 2.0?  Is the development
environment for which mod_perl 2.0 is being developed, by its creators,
using a 'C' compiler that is different than what is found on RH 8.0?
Does any one have an idea of how I might go about solving this problem?
Any advance given would be appreciated.  

Steve D







Re: mod_perl.c Not Compatible with Apache

2003-01-03 Thread Randy Kobes
On Fri, 3 Jan 2003, Steve Davis wrote:

 Upon successfully compiling mod_perl 2.0, and modifying httpd.conf so
 that it becomes invoked at the start of Apache 2.0.43, the following
 error message is gernerated.  It is httpd failed. The error was:
 Starting httpd: httpd: module mod_perl.c is not compatible with this
 version of Apache.
 Please contact the vendor for the correct version. [FAILED]
 
 If you would like you, may refer to the previous thread named mod_perl
 make failed: cannot find -lapr for a history of the root of this
 problem-particularly the last post directly before this article.  This
 also shows the detail environment and configuration for the server in
 question.  Else, I would be glad more details to this post.  In brief,
 let me say, the system consists of RH 8.0, apache 2.0.43, and current
 CVS edition of mod_perl 2.0.  It has a date stamp of 1/1/03.
 
 This is one problem which I don't know how to proceed with.  Is this
 message saying the code in mod_perl's mod_perl.c is using an edition
 of 'C' code that is incompatible with Apache 2.0?  Is the development
 environment for which mod_perl 2.0 is being developed, by its creators,
 using a 'C' compiler that is different than what is found on RH 8.0?
 Does any one have an idea of how I might go about solving this problem?
 Any advance given would be appreciated.  

I think in general the problem
  mod_perl.c is not compatible with this version of Apache.
means that mod_perl was compiled against a different set of
Apache sources than that used to build the server trying to
load the mod_perl module (assuming that the same compiler
is being used in building Perl, Apache, and mod_perl).

Just to clarify what came from where 

- are you using a modperl-2.0 cvs snapshot from
 http://cvs.apache.org/snapshots/modperl-2.0/?
- are you running Apache 2.0.43, compiled from the sources
  httpd-2.0.43.tar.gz from 
 http://httpd.apache.org/dist/httpd/?

If so, does modperl-2.0 compile against these apache 2.0 sources
successfully?

-- 
best regards,
randy




RE: mod_perl.c Not Compatible with Apache

2003-01-03 Thread Steve Davis
Randy,

All of what I've done, in the form of compiling software, has been done
on the same computer and with the same release of the RH.  So, there is
nothing for which I'm doing to distinctly change which compiler is being
used between the compilations of the packages.

As best as I can recall, the answer is 'yes' to the last three questions
you asked.  1) Everything compiles successfully.  2) The edition of
mod_perl was obtained from cvs.apache.org while the Apache was from the
distribution source repository.  3) The various release numbers for the
packages where the most current; hence, 2.0.43 of Apache and 2.0 for
mod_perl.

Maybe there is some difference between the distribution and CVS versions
of Apache.  Perhaps, the next step will be to match packages via
obtaining CVS editions from both packages and see what happens then.
This shouldn't take to long.  I'll give it a shot and provide an update.


Let me also add, I'm grateful for your help.  Thank you.

Steve D

The following comments were provided from Randy Kobes:

I think in general the problem  mod_perl.c is not compatible with this
version of Apache.
means that mod_perl was compiled against a different set of Apache
sources than that used to build the server trying to load the mod_perl
module (assuming that the same compiler
is being used in building Perl, Apache, and mod_perl).

Just to clarify what came from where 

- are you using a modperl-2.0 cvs snapshot from
 http://cvs.apache.org/snapshots/modperl-2.0/?
- are you running Apache 2.0.43, compiled from the sources
  httpd-2.0.43.tar.gz from 
 http://httpd.apache.org/dist/httpd/?

If so, does modperl-2.0 compile against these apache 2.0 sources
successfully?

-- 
best regards,
randy






RE: mod_perl.c Not Compatible with Apache

2003-01-03 Thread Steve Davis
Randy,

You 'maybe' on to something here.  Let me report to you what I found.
In order to be as careful and consistent as possible, I've actually
started to keep a log of my activities.  It records which commands which
I've been used to compile the packages.  So I can saw with certainty the
following.  Here are the parameters which I used to compile both Apache
and mod_perl.

To configure Apache:
./configure --prefix=/etc/httpd --with-mpm=prefork

To configure mod_perl:
perl Makefile.PL MP_AP_PREFIX=/etc/httpd MP_APXS=/etc/httpd/bin/apxs
MP_INST_APACHE2=1 MP_DEBUG=1

Also, when I examine /etc/httpd/bin/httpd (the executable),
/etc/httpd/lib/libarp*,  and /etc/module/mod_perl.so, all the theses
files have a creation date that's current (today's date).  Plus,
/etc/httpd/httpd.conf points to the current file locations.  According
to the RH 8.0 docs regarding Apache 2.X, they suggest modifying
httpd.conf to incorporate the use of an include statement which invokes
/etc/conf.d/perl.conf.  This latter file points to
/etc/httpd/module/mod_perl.3.0.  I've mapped the files and dates.  There
doesn't appear to be any conflict here.  

However, for good measure, I just completed a search of the /etc/* and
/usr/* directories for the presence of the httpd executable.  And there
are two of them on the system.  To be expected, the /etc/httpd/bin/httpd
executable is present.  However, these is also an existence of a httpd
executable under /usr/sbin.  When I changed the name of /etc/sbin/httpd
to /etc/sbin/httpd-bu (backup).  The httpd web server wouldn't start any
longer (I toggled this off and on via the service utilility [start -
system settings - service]).  /etc/sbin/httpd has a footprint of 384.7K
where as /etc/httpd/bin/httpd is a 2meg file.  I don't know whether
/etc/sbin/httpd is being used to merely start /etc/httpd/bin/httpd or
not.  If you can advise further it would be helpful.

This is the first time which I had to gain the merits (and subsequent
challenges) of dealing with the open source world.  Bringing mod_perl
on-line has been a bitter-sweet experience.  On the up side, it is
certainly sweet to gain help from others for which I am exceedingly
grateful for.  In this regard, the help being provided is making this a
better experience.  To your credit, I not accustom to this type of aid
when dealing with the proprietary world.  That is, I am not familiar
with receiving the same degree of cooperation, support, and camaraderie.
Therefore, let me continue to express my gratitude.  It means a lot to
me.  Thank you.  

Steve


Steve D


-Original Message-
From: Randy Kobes [mailto:[EMAIL PROTECTED]] 
Sent: Friday, January 03, 2003 5:19 PM
To: Steve Davis
Cc: [EMAIL PROTECTED]
Subject: RE: mod_perl.c Not Compatible with Apache 

On Fri, 3 Jan 2003, Steve Davis wrote:

 Randy,
 
 All of what I've done, in the form of compiling software, has been
done
 on the same computer and with the same release of the RH.  So, there
is
 nothing for which I'm doing to distinctly change which compiler is
being
 used between the compilations of the packages.
 
 As best as I can recall, the answer is 'yes' to the last three
questions
 you asked.  1) Everything compiles successfully.  2) The edition of
 mod_perl was obtained from cvs.apache.org while the Apache was from
the
 distribution source repository.  3) The various release numbers for
the
 packages where the most current; hence, 2.0.43 of Apache and 2.0 for
 mod_perl.
 
 Maybe there is some difference between the distribution and CVS
versions
 of Apache.  Perhaps, the next step will be to match packages via
 obtaining CVS editions from both packages and see what happens then.
 This shouldn't take to long.  I'll give it a shot and provide an
update.

This is strange ... I just tried, on a RedHat 7.1 system, the
cvs modperl-2.0 sources compiled against
Server version: Apache/2.0.43
built using stock httpd-2.0.43 sources, and it went fine. You 
shouldn't have to use the cvs apache sources. mod_perl was built as
 perl Makefile.PL MP_AP_PREFIX=/usr/local/httpd MP_INST_APACHE2=1
where the httpd binary is installed under /usr/local/httpd/bin. 

One thought ... Some Linux distributions come with their own
Apache server, which may be in a different location than the
Apache 2.0.43 you built and installed. Are you sure that the
mod_perl you built is being used with your Apache-2.0.43
specified under MP_AP_PREFIX?

-- 
best regards,
randy






Re: mod_perl.c Not Compatible with Apache

2003-01-03 Thread Stas Bekman
I've updated the README file to specify the minimum and maximum Apache 
versions required, the next mod_perl version's release will include it.

As for your troubles, as Randy has suggested you probably have a bunch 
of various installs laying around and you've it all messed up. You don't 
need to install apr separately from Apache, just grab the latest cvs 
version of Apache and mod_perl, build them and you will be all set. See:
http://perl.apache.org/docs/2.0/user/install/install.html#Getting_Bleeding_Edge_CVS_Sources
http://perl.apache.org/docs/2.0/user/install/install.html#Configuring_and_Installing_Prerequisites
http://perl.apache.org/docs/2.0/user/install/install.html#Downloading_the_mod_perl_Source
...

It should just work. To make sure that you aren't messing up with other 
installation on your system, go and clean those up first.

__
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: mod_perl.c Not Compatible with Apache

2003-01-03 Thread Randy Kobes
On Fri, 3 Jan 2003, Steve Davis wrote:

[ .. ]
 To configure Apache:
 ./configure --prefix=/etc/httpd --with-mpm=prefork
 
 To configure mod_perl:
 perl Makefile.PL MP_AP_PREFIX=/etc/httpd MP_APXS=/etc/httpd/bin/apxs
 MP_INST_APACHE2=1 MP_DEBUG=1
 
 Also, when I examine /etc/httpd/bin/httpd (the executable),
 /etc/httpd/lib/libarp*, and /etc/module/mod_perl.so, all the
 theses files have a creation date that's current (today's
 date).  Plus, /etc/httpd/httpd.conf points to the current file
 locations.  According to the RH 8.0 docs regarding Apache 2.X,
 they suggest modifying httpd.conf to incorporate the use of an
 include statement which invokes /etc/conf.d/perl.conf.  This
 latter file points to /etc/httpd/module/mod_perl.3.0.  I've
 mapped the files and dates.  There doesn't appear to be any
 conflict here.
 
 However, for good measure, I just completed a search of the
 /etc/* and /usr/* directories for the presence of the httpd
 executable.  And there are two of them on the system.  To be
 expected, the /etc/httpd/bin/httpd executable is present.  
 However, these is also an existence of a httpd executable under
 /usr/sbin.  When I changed the name of /etc/sbin/httpd to
 /etc/sbin/httpd-bu (backup).  The httpd web server wouldn't
 start any longer (I toggled this off and on via the service
 utilility [start - system settings - service]).  
 /etc/sbin/httpd has a footprint of 384.7K where as
 /etc/httpd/bin/httpd is a 2meg file.  I don't know whether
 /etc/sbin/httpd is being used to merely start
 /etc/httpd/bin/httpd or not.  If you can advise further it
 would be helpful.

It sounds like /etc/sbin/httpd and /etc/httpd/bin/httpd are
separate binaries, judging by their different sizes. You
compiled modperl against /etc/httpd/bin/httpd, but your system
is using /etc/sbin/httpd in the services utility to start.
This might explain the problem you were having before - 
/etc/sbin/httpd might be an older apache binary from
before (perhaps the installation), whereas mod_perl was
compiled against the newer /etc/httpd/bin/httpd. It's
hard to tell whether or not the binaries are sharing
the same httpd.conf files.

Did mod_perl's 'make test' pass? When you start the test,
it reports which httpd it's using - is it /etc/httpd/bin/httpd?

One thing you might try - stop the /etc/sbin/httpd service,
and then go to /etc/httpd/bin and issue the command
apachectl start
to start the server associated with /etc/httpd/. This (normally)
will use the httpd.conf under /etc/httpd/conf/, which presumably
is the right one - if not, try starting httpd with the -f switch
to specify the config file - see ./httpd -h for help. 
Alteratively, since you have a backup of /etc/sbin/httpd,
try copying /etc/httpd/bin/httpd to /etc/sbin/httpd, and
start the service.

Do either of these work? If so, what you might do is forget
completely about the httpd stuff under /etc (which sounds like
it's getting mixed up with different versions), and compile
httpd-2.0.43 using a prefix like /usr/local/httpd, and then
compile and install mod_perl against this prefix. With a fresh
install Apache will install a reasonable default httpd.conf.  
You'd then have to figure out how to adjust the service utility
to start /usr/local/httpd/bin/httpd, rather than /etc/sbin/httpd.

-- 
best regards,
randy