Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Problems with Finding mod_perl

by dru145 (Friar)
on Jan 11, 2002 at 10:35 UTC ( [id://137954]=perlquestion: print w/replies, xml ) Need Help??

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

Monks,

I've been working on this all day with no luck. I installed mod_perl via CPAN and it seems to be installed fine.
cpan> install Apache CPAN: Storable loaded ok Going to read /root/.cpan/Metadata Database was generated on Thu, 10 Jan 2002 08:13:21 GMT Apache is up to date. cpan> install mod_perl mod_perl is up to date.
but when I go to start apache, I get this error:
[root@localhost bin]# ./apachectl start Syntax error on line 3 of /usr/local/everything/everything.apache.conf +: Invalid command 'PerlModule', perhaps mis-spelled or defined by a modu +le not included in the server configuration ./apachectl start: httpd could not be started
Here is what the everything.apache.conf file looks like:
AddHandler perl-script .pl PerlModule Apache::DBI PerlModule CGI PerlSetupEnv On
This is being called from /usr/local/apache/httpd.conf as such:
Include /usr/local/everything/everything.apache.conf
I did a find for mod_perl.so on my system, but it didn't produce any results. Any ideas what is wrong?

Thanks,
Dru
Another satisfied monk.

Replies are listed 'Best First'.
Re: Problems with Finding mod_perl
by Chmrr (Vicar) on Jan 11, 2002 at 10:48 UTC

    The mod_perl Guide should be enough to get you started, and is something you should probably know about if you're going to be playing with mod_perl. For your particular problem, I think you'll need to have Apache compiled with DSO support, and add a:

    LoadModule perl_module modules/mod_perl.so AddModule mod_perl.c
    to your httpd.conf. Do read or at least skim the Guide, however -- I built my mod_perl by recompiling it into Apache statically, so I'm no expert on doing it as a DSO -- and I'm even sketchier on what bits get installed if you only install files from CPAN. The Guide is a veritable fount of information.

    Update: Changed libperl.so to mod_perl.so -- the Guide mentions the former, but I've also seen the latter. Try 'em both, I'd guess.

    perl -pe '"I lo*`+$^X$\"$]!$/"=~m%(.*)%s;$_=$1;y^`+*^e v^#$&V"+@( NO CARRIER'

Re: Problems with Finding mod_perl
by perrin (Chancellor) on Jan 11, 2002 at 19:13 UTC
    I suspect you forgot to install apache. When you build mod_perl, it also rebuilds apache and you have to install apache again. I don't think the mod_perl installation does this for you.
Re: Problems with Finding mod_perl
by Hrunting (Pilgrim) on Jan 11, 2002 at 18:45 UTC
    mod_perl compiles a libperl.so into your apache libexec/ directory. If it's not there, it won't work. As mentioned above, you need to have an Apache server with DSO capabilities (do a bin/httpd -l and look for mod_so). If you install mod_perl via APXS, it will put the necessary lines in your conf/httpd.conf file for you, so you can look in the httpd.conf file for libperl.so and see if it's been installed correctly.

    In my experience, installing mod_perl via CPAN is generally a bad idea. It's typically better to install it by hand. I'm not saying it won't work, but a mod_perl isn't a typical perl module. It requires either the Apache source or the Apache apxs code and an Apache server that's setup to handle it.

    Try reading the aforementioned guide and doing it by hand.

Re: Problems with Finding mod_perl
by dru145 (Friar) on Jan 11, 2002 at 23:51 UTC
    Thanks everyone for your replies. Of course I should have RTFM, but my brain was fryed after troubleshooting this all day and I was out of it when I posted this. I followed the manual and I'm now up and running.

    Thanks again,
    Dru
    Another satisfied monk.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (3)
As of 2024-04-25 23:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found