Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

apache2 + mod_perl 1.99_11 + failed to resolve handler

by primus (Scribe)
on Jun 09, 2004 at 13:10 UTC ( [id://362717]=perlquestion: print w/replies, xml ) Need Help??

primus has asked for the wisdom of the Perl Monks concerning the following question:

hey all,

I just installed mod_perl and got it running with apache2... or almost running.

in the /etc/conf.d/apache2, i added the -D PERL and my commonapache2.conf has:

<IfModule mod_perl.c> PerlModule Apache2::ModPerl::Registry #set Apache::Registry Mode for /perl Alias <Location /perl/*.pl> SetHandler perl-script <IfDefine MODPERL2> PerlResponseHandler Apache2::ModPerl::Registry </IfDefine> <IfDefine !MODPERL2> PerlResponseHandler ModPerl::Registry </IfDefine> Options -Indexes ExecCGI PerlSendHeader On </Location> </IfModule>

but notice the line:

PerlModule Apache2::ModPerl::Registry

if a place a script in the /var/www/localhost/perl/ and call it "test.pl" (with permissions 775), it gives me an internal server error.

contents of test.pl:
#!/usr/bin/perl use warnings; use strict; print "Content-type: text/plain\n\n"; print "hello";

also tried:

sub handler { my $r = shift; print "Content-type: text/plain\n\n"; print "hello"; } 1;
with no luck

fairly straight forward, but i check the error_log for apache, and it reports:

[...date here...] [error] failed to resolve handler `Apache2::ModPerl: +:Registry'

which happens after every visit to http://127.0.0.1/perl/test.pl. I am not really sure what is going on. the Apache2::ModPerl::Registry module is found via find / -iname Registry.pm at

/usr/lib/perl5/vendor_perl/5.8.2/i686-linux/Apache2/ModPerl/Registry.p +m
, and that path is in the includes... isnt it?

from the http://127.0.0.1/perl-status page, it tells me that all the modules are loaded, and i dont really know if this is an apache config problem or if it is something with my test scripts.

i am a bit confused, any help would be great. thanks monks.

Replies are listed 'Best First'.
Re: apache2 + mod_perl 1.99_11 + failed to resolve handler
by hsinclai (Deacon) on Jun 09, 2004 at 14:16 UTC
    <Location bla> specifies a "Path" or "URLpath", however you've got a file specification /bla/*.pl.. try changing to
    <Location /path/>

    Have in your apache config the file extensions allowed for cgi execution, e.g.
    AddHandler cgi-script .cgi .pl


    Finally make sure your Alias line to /var/www/localhost/perl/ is right, complete with ending slash correctness. The alias to your perl directory for CGIs should probably not be a subdirectory of your document root... you can operate a Alias/<Location bla/> combo outside of the Apache filesystem..

      you were right about the path. however it did work with the *.pl, all i had to do was give a full path... /var/www/localhost/perl/*.pl.

      thank you very much for the help!

Re: apache2 + mod_perl 1.99_11 + failed to resolve handler
by Anonymous Monk on May 17, 2017 at 18:36 UTC
    is there a solution to this???
      What do you mean, doesn't changing the path work for you?

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://362717]
Approved by Happy-the-monk
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (4)
As of 2024-03-28 21:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found