You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Jan Eden <li...@janeden.org> on 2005/06/22 17:12:11 UTC

mod_perl configuration trouble

Hi,

I recently installed mod_perl 2.0.1 as a DSO to Apache 2.0.53 (on OS X 10.3.9). The simple example from the docs works:

Alias /perl/ /home/httpd/httpd-2.0/perl/
  <Location /perl/>
      SetHandler perl-script
      PerlResponseHandler ModPerl::Registry
      PerlOptions +ParseHeaders
      Options +ExecCGI
</Location>

I can run a simple script (printing out headers and a single line).

But if I change the setup to something like (based on the Perl Cookbook 2nd edition recipe):

Alias /perl/ /home/httpd/httpd-2.0/perl/

PerlModule Apache::Registry
PerlModule CGI

<Location /perl/>
    SetHandler perl-script
    PerlHandler Apache::Registry
    PerlOptions +ParseHeaders
    Options +ExecCGI
</Location>

I get error messages like

Can't locate loadable object for module Apache::Constants in @INC
Can't load Perl module Apache::Registry for server 127.0.0.1:0, exiting...

All Apache:: modules seem to be in /System/Library/Perl/5.8.1/darwin-thread-multi-2level - so what am I doing wrong?

I already read the FAQ which gives an explanation referring to the number of files to be opened by a single process - which does not seem to plausible to me, because with ModPerl::Registry, the script runs just fine.

Another - related - question: Is ModPerl::Registry the successor to Apache::Registry? The manpages can be interpreted like that.

Even though ModPerl::Registry is not in the directory of the other Perl modules, it seems to be the only module which is found by mod_perl.

Before I ran "make install", "make test" did not find the startup.pl used for testing - or the TestApache:: modules, for that matter.

This is quite confusing - can anyone clear things up a bit?

Thanks,

Jan
-- 
Alcohol and calculus don't mix - PLEASE don't drink and derive.

Re: mod_perl configuration trouble

Posted by Jan Eden <li...@janeden.org>.
Joe Cullin wrote on 22.06.2005:

>Also, PerlHandler was replaced with PerlResponseHandler in 2.0.
>
>PerlResponseHandler ModPerl::Registry
>
>It's kind of tough learning mod_perl right now, because all the
>books give 1.0 examples, and 2.0 seems to have a lot of small
>differences.  The docs at perl.apache.org are a good reference. 
>Here's a page that covers some of the 1.0 - 2.0 differences:
>
Right, I am already flipping through the online docs - my boss wants the transition to be in finished quickly (as always). At least all the scripts are written in a strict fashion and I hope I don't have to change anything there.

Now if I can only get that @INC problem solved, I am happy.

Thanks for the link,

Jan
-- 
He who would give up a little liberty in return for a little security deserves neither liberty nor security. - Benjamin Franklin

Re: mod_perl configuration trouble

Posted by Joe Cullin <jc...@unipress.com>.
Also, PerlHandler was replaced with PerlResponseHandler in 2.0.

   PerlResponseHandler ModPerl::Registry

It's kind of tough learning mod_perl right now, because all the books give
1.0 examples, and 2.0 seems to have a lot of small differences.  The docs
at perl.apache.org are a good reference.  Here's a page that covers some
of the 1.0 - 2.0 differences:

http://perl.apache.org/docs/2.0/user/porting/compat.html#C_Apache__Registry___C_Apache__PerlRun__and_Friends

-Joe


On Wed, 22 Jun 2005, Geoffrey Young wrote:

> Jan Eden wrote:
> > Hi,
> > 
> > I recently installed mod_perl 2.0.1 as a DSO to Apache 2.0.53 (on OS
> > X 10.3.9). The simple example from the docs works:
> > 
> > Can't locate loadable object for module Apache::Constants in @INC 
> > Can't load Perl module Apache::Registry for server 127.0.0.1:0,
> > exiting...
> 
> Apache::Registry is for mod_perl 1.0/Apache 1.3.X, ModPerl::Registry is
> for mod_perl 2.0/Apache 2.X.X, and you cannot run one within the other's
> environment.
> 
> 
> > Another - related - question: Is ModPerl::Registry the successor to
> > Apache::Registry? The manpages can be interpreted like that.
> 
> essentially yes, insofar as mod_perl 2.0 is the successor of mod_perl 1.0.
> 
> > Before I ran "make install", "make test" did not find the startup.pl
> > used for testing - or the TestApache:: modules, for that matter
> 
> that is very odd.  if you can reliably reproduce that please file a
> proper bug report:
> 
>   http://perl.apache.org/docs/2.0/user/help/help.html#Reporting_Problems
> 
> --Geoff
> 
> 
> 




Re: mod_perl configuration trouble

Posted by Jan Eden <li...@janeden.org>.
Geoffrey Young wrote on 22.06.2005:

>
>>But this does not solve my real problem, i.e. that the modules are
>>not found when running my scripts.
>>
>>[Wed Jun 22 18:04:12 2005] [error] Can't locate Apache/RequestRec.pm
>
>you initially said you were using mod_perl 2.0.1.  if that's true
>it's Apache2::RequestRec you're after, not Apache::RequestRec.
>
>see http://perl.apache.org/docs/2.0/rename.html for the gory
>details.
>
That was it:

    €   If using CGI.pm you will need to upgrade to version 3.08 - versions 3.07 and older do not support the new mod_perl API. you can get CGI.pm from http://search.cpan.org/dist/CGI.pm/.

I had CGI version 2.98. Now everything works.

Thanks a lot,

Jan
-- 
I'd never join any club that would have the likes of me as a member. - Groucho Marx

Re: mod_perl configuration trouble

Posted by Geoffrey Young <ge...@modperlcookbook.org>.
> But this does not solve my real problem, i.e. that the modules are not
> found when running my scripts.
> 
> [Wed Jun 22 18:04:12 2005] [error] Can't locate Apache/RequestRec.pm

you initially said you were using mod_perl 2.0.1.  if that's true it's
Apache2::RequestRec you're after, not Apache::RequestRec.

see http://perl.apache.org/docs/2.0/rename.html for the gory details.

--Geoff

Re: mod_perl configuration trouble

Posted by Jan Eden <li...@janeden.org>.
Jan Eden wrote on 22.06.2005:

>Geoffrey Young wrote on 22.06.2005:
>
>>
>>>..[Wed Jun 22 17:20:49 2005] [error] Insecure directory in
>>>$ENV{PATH} while 
>>running with -T switch
>>
>>clean up your path and you should be ok - this is keeping
>>Apache::Test* from loading properly.  in other words, it's not that
>>it can't find the modules it needs, they just can't load because
>>something funky is in your $ENV{PATH}.
>
>I saw that just after sending the message and - it works. Most tests
>ran just fine, except for some denied permission errors and some
>skipped tests due to missing modules (which is expected with an
>empty path).
>
>But this does not solve my real problem, i.e. that the modules are
>not found when running my scripts.
>
>[Wed Jun 22 18:04:12 2005] [error] Can't locate Apache/RequestRec.pm
>
>Now this one is true, there is no module Apache::RequestRec anywhere
>in my path - but I have no idea why and why it wasn't installed.

Followup: I do have Apache2::RequestRec, and the error occurs only when certain modules are used in a script (DBI works, CGI does not). Strange.

Best,

Jan
-- 
He who would give up a little liberty in return for a little security deserves neither liberty nor security. - Benjamin Franklin

Re: mod_perl configuration trouble

Posted by Jan Eden <li...@janeden.org>.
Geoffrey Young wrote on 22.06.2005:

>
>> ..[Wed Jun 22 17:20:49 2005] [error] Insecure directory in $ENV{PATH} while 
>running with -T switch 
>
>clean up your path and you should be ok - this is keeping Apache::Test*
>from loading properly.  in other words, it's not that it can't find the
>modules it needs, they just can't load because something funky is in
>your $ENV{PATH}.

I saw that just after sending the message and - it works. Most tests ran just fine, except for some denied permission errors and some skipped tests due to missing modules (which is expected with an empty path).

But this does not solve my real problem, i.e. that the modules are not found when running my scripts.

[Wed Jun 22 18:04:12 2005] [error] Can't locate Apache/RequestRec.pm

Now this one is true, there is no module Apache::RequestRec anywhere in my path - but I have no idea why and why it wasn't installed.

Thanks,

Jan
-- 
I was gratified to be able to answer promptly, and I did. I said I didn't know. - Mark Twain

Re: mod_perl configuration trouble

Posted by Geoffrey Young <ge...@modperlcookbook.org>.
> ..[Wed Jun 22 17:20:49 2005] [error] Insecure directory in $ENV{PATH} while running with -T switch 

clean up your path and you should be ok - this is keeping Apache::Test*
from loading properly.  in other words, it's not that it can't find the
modules it needs, they just can't load because something funky is in
your $ENV{PATH}.

--Geoff

Re: mod_perl configuration trouble

Posted by Jan Eden <li...@janeden.org>.
Geoffrey Young wrote on 22.06.2005:

>Jan Eden wrote:
>>Hi,
>>
>>I recently installed mod_perl 2.0.1 as a DSO to Apache 2.0.53 (on
>>OS X 10.3.9). The simple example from the docs works:
>>
>>Can't locate loadable object for module Apache::Constants in @INC
>>Can't load Perl module Apache::Registry for server 127.0.0.1:0,
>>exiting...
>
>Apache::Registry is for mod_perl 1.0/Apache 1.3.X, ModPerl::Registry
>is for mod_perl 2.0/Apache 2.X.X, and you cannot run one within the
>other's environment.
>
>
>>Another - related - question: Is ModPerl::Registry the successor to
>>Apache::Registry? The manpages can be interpreted like that.
>
>essentially yes, insofar as mod_perl 2.0 is the successor of
>mod_perl 1.0.
>
Thanks, that's what I thought.

>>Before I ran "make install", "make test" did not find the
>>startup.pl used for testing - or the TestApache:: modules, for that
>>matter
>
>that is very odd.  if you can reliably reproduce that please file a
>proper bug report:

I am always hesitant to file a bug report before having made absolutely sure that the mistake is not mine. This is the last part of the output of "make test":

using Apache/2.0.53 (prefork MPM)

waiting 120 seconds for server to start: .[Wed Jun 22 17:20:47 2005] [info] 6 Apache2:: modules loaded
[Wed Jun 22 17:20:47 2005] [info] 0 APR:: modules loaded
[Wed Jun 22 17:20:47 2005] [info] base server + 27 vhosts ready to run tests
..[Wed Jun 22 17:20:49 2005] [error] Insecure directory in $ENV{PATH} while running with -T switch at /Users/jan/Documents/temporaer/Downloads/mod_perl-2.0.1/Apache-Test/lib/Apache/TestConfig.pm line 1059.\nCompilation failed in require at /Users/jan/Documents/temporaer/Downloads/mod_perl-2.0.1/t/conf/modperl_startup.pl line 17.\n\t...propagated at /Users/jan/Documents/temporaer/Downloads/mod_perl-2.0.1/t/conf/modperl_startup.pl line 18.\nBEGIN failed--compilation aborted at /Users/jan/Documents/temporaer/Downloads/mod_perl-2.0.1/t/conf/modperl_startup.pl line 20.\nCompilation failed in require at (eval 2) line 1.\n
[Wed Jun 22 17:20:49 2005] [error] Can't load Perl file: /Users/jan/Documents/temporaer/Downloads/mod_perl-2.0.1/t/conf/modperl_startup.pl for server localhost:8529, exiting...

Does this give you any hint about what is going on?

Thanks,

Jan
-- 
How many Microsoft engineers does it take to screw in a lightbulb? None. They just redefine "dark" as the new standard.

Re: mod_perl configuration trouble

Posted by Geoffrey Young <ge...@modperlcookbook.org>.
Jan Eden wrote:
> Hi,
> 
> I recently installed mod_perl 2.0.1 as a DSO to Apache 2.0.53 (on OS
> X 10.3.9). The simple example from the docs works:
> 
> Can't locate loadable object for module Apache::Constants in @INC 
> Can't load Perl module Apache::Registry for server 127.0.0.1:0,
> exiting...

Apache::Registry is for mod_perl 1.0/Apache 1.3.X, ModPerl::Registry is
for mod_perl 2.0/Apache 2.X.X, and you cannot run one within the other's
environment.


> Another - related - question: Is ModPerl::Registry the successor to
> Apache::Registry? The manpages can be interpreted like that.

essentially yes, insofar as mod_perl 2.0 is the successor of mod_perl 1.0.

> Before I ran "make install", "make test" did not find the startup.pl
> used for testing - or the TestApache:: modules, for that matter

that is very odd.  if you can reliably reproduce that please file a
proper bug report:

  http://perl.apache.org/docs/2.0/user/help/help.html#Reporting_Problems

--Geoff