Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Apache won't load when mod_perl enabled

by bart (Canon)
on May 07, 2008 at 08:16 UTC ( [id://685161]=perlquestion: print w/replies, xml ) Need Help??

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

I'm trying to run Apache 2 on my home PC (XP Pro). It used to work... but I've upgraded Perl since I last ran it (though it's the same major version: 5.8.x). Now, it simply refuses to start. Initially there were some complaints regarding mod_perl. (There's a few msgboxes complaining about not being able to load SSLeay32.DLL, despite it being in the PATH, and some error messages in the CMD window, too, but I forgot the details there.)

I uninstalled and reinstalled mod_perl (with PPM, so it's 2.0.3), and the complaint went away. It appears to start normally... However, when I check the running processes, Apache is not among them.

So now, I simply commented out the LoadModule statement for mod_perl.so in httpd.conf, and put every PerlModule and other perl related statements in <IfModule mod_perl.c> conditionals. And now, Apache loads and runs normally...

Why? What is wrong with mod_perl? How do you diagnose such a case? I get no error messages in the console at all.

Basic mod_perl question: what happens if mod_perl loads succesfully as a program, but it can't find, or otherwise fails to load, a module that's been specified with PerlModule?

Replies are listed 'Best First'.
Re: Apache won't load when mod_perl enabled
by moritz (Cardinal) on May 07, 2008 at 08:25 UTC
    The first place to look is the error.log file, which usually has some helpful information.

    Additionally you can change the log level in the server configuration to get more details.

      Yeah, I've thought of that after I posted my question. I see this:
      [Mon May 05 23:35:45 2008] [error] Can't load Perl module Apache2 for +server laptop.local, exiting...

      So it's module Apache2 (??) that appears to be missing, but I cannot find it on CPAN or PPM... Duh? I don't get it.

      p.s. This kind of behavior looks nasty to me: if a perl module refuses to load, it ought to just disable mod_perl, and not bring down Apache. IMHO.

        if a perl module refuses to load, it ought to just disable mod_perl, and not bring down Apache
        Actually, it should bring it down, IMHO. It's better to run a fully functional system, than crippled one, and you waste your time finding out what's broken while your apache is running and users are doing their nasty jobs to bring you down. I know I would'n like to work in such an environment.
        It's by design. If your configuration is screwed up, it's better to fail than it is to start in a runstate that will allow for unexpected behaviour. I'd rather have it die on mod perl than have it load and throw errors on every perl page. That kind of situation will leave you troubleshooting your perl libraries before you check apache, because apache is running, right? Must be working.
        cpan libapreq2 thats probably the missing module?
Re: Apache won't load when mod_perl enabled
by almut (Canon) on May 07, 2008 at 09:52 UTC
    Can't load Perl module Apache2

    Which mod_perl version did you have installed at the time it used to work?  Maybe it has to do with the various namespace changes for the 2.0 API...   In particular note (cited from that .pod):

    Remove any occurrences of use Apache2; in a script or module, as well as PerlModule Apache2 in an Apache configuration file.

    (Update: changed link to better readable HTML version of the POD)

      Maybe you need to add something like LoadFile "../perl/bin/perl510.dll"
      before LoadModule ... mod_perl.so
Re: Apache won't load when mod_perl enabled
by perrin (Chancellor) on May 07, 2008 at 12:24 UTC
    Make sure you are following the installation and configuration instructions provided on the mod_perl site.
Re: Apache won't load when mod_perl enabled
by arkturuz (Curate) on May 07, 2008 at 08:43 UTC
    It's been a while since I configured Apache on Win32, so I might be completely wrong, but isn't mod_perl.so used only on Unix-based machines, and on Win32 you load DLLs?
      It's a DLL with file extension .so.

      But I think that in the past, Apache modules on Windows indeed had the file extension .dll. I think they made it more uniform across platforms for Apache, as Windows actually doesn't seem to care about the file extension of the DLL file.

Re: Apache won't load when mod_perl enabled
by redhotpenguin (Deacon) on May 08, 2008 at 18:47 UTC
    If you can post the relevant sections of httpd.conf that would give some clues as to what the problem might be.
Re: Apache won't load when mod_perl enabled
by Jean-Charles (Initiate) on May 24, 2008 at 08:18 UTC
    Hi I am currently stuck with the same pb. After some investigations it seems that there is no yet stable module for Apache Win32 and Perl510 (as far at the moment). There is a first RC here http://people.apache.org/~gozer/mp2/mod_perl-2.0.4-rc1.tar.gz but you have to build it. Can anyone confirm ?

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (7)
As of 2024-04-23 19:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found