in reply to mod_perl.so installed, not running?

I had some trouble getting it working with Apache2 and mod_perl2. After fooling around with it I switched to Apache 1.3.x with mod_perl1. Took some tweaking but I was able to get it working fine. I don't believe AddModule works correctly with Apache2. I'm pretty sure LoadModule is the correct way to load modules. Here is how I tested my environment btw.
print "Content-type: text/plain\r\n\r\n"; print "Server's environment\n"; foreach ( keys %ENV ) { print "$_\t$ENV{$_}\n"; }
Basically this prints out your environment within Apache. You should see mod_perl as your gateway I believe. Also a setting somewhere for which version of mod_perl you are running. The program should just work without the #! at the top. If it doesn't then try adding it. This means you are not loading mod_perl. It runs fine as is if mod_perl is loaded.

Some place to start at least.

After thinking about it, here is an example of what the above produced (edited of course):

Server's environment
PERL_SEND_HEADER	On
SERVER_NAME	test
SERVER_SOFTWARE	Apache/1.3.31 (Unix) mod_perl/1.29
GATEWAY_INTERFACE	CGI-Perl/1.1
MOD_PERL	mod_perl/1.29


Hope this helps

Replies are listed 'Best First'.
Re^2: mod_perl.so installed, not running?
by Anonymous Monk on Jul 28, 2004 at 17:08 UTC
    I tried your script (with and without a #!), but it printed the server environment not apache's and it didn't say anything about mod_perl. Also, if you install apache2 and mod_perl2 without error, add the LoadModule line, but that doesn't work, how else are you supposed to get Apache to recognize mod_perl? Thanks. P
      So you didn't see any of the environment variables such as gateway interface or server software? If that's the case then you might have your environment setup incorrectly.

      I had purchased the "Oreilly Practical Mod_Perl" which helped immensely. Here is some of my httpd.conf referring to this subject. The last section is what you need to pay attention to I believe:
      # MOD_Perl Section <Directory "/usr/local/apache/perllibrary"> AllowOverride None Options ExecCGI Order allow,deny Allow from All </Directory> + ScriptAlias /perl/ "/usr/local/apache/perllibrary/" + <IfModule mod_perl.c> + PerlRequire "/usr/local/apache/perllibrary/startup.pl" + <Location /perl> SetHandler perl-script PerlHandler Apache::Registry PerlSendHeader On </Location> . . .
      Basically the startup.pl includes which modules I want to include and a couple of additional libraries I wanted to add. Stuff that we wrote for our application. The last part is what you need to pay attention to. If you don't have your environment setup properly then it won't work.

      NOTE: I'm not an expert in the use of Mod_Perl. Never used it until just a few weeks ago. I know that I was able to (finally) get it working just fine. Running the test script provided proof that mod_perl was loaded and running. If you don't see the server software or mod_perl version then it's defintely not loading.

      If it's still not working please post your setup. The section dealing with your /perl location specifically. (hope I didn't confuse you with all this. I'm still learning myself ::grinz::)
        Okay, so I'm convinced mod_perl is not running. Can you help me get it started? Here's what I did. I first installed Apache2 with ./configure --prefix=/usr/local/apache2 --enable-info --enable-headers --enable-so --enable-speling --enable-ssl --enable-shared=perl. I recompilied and reinstalled after my first post adding the --enable-shared=perl pricisly because it wasn't working. Then I do make and make install. After that I try to install mod_perl with  perl Makefile.PL MP_APXS=/usr/local/apache2/bin/apxs. Then make and make install. After that I added  LoadModule perl_module  modules/mod_perl.so to httpd.conf and I added
        <IfModule mod_perl.c> #Alias /perl/ /home/httpd/perl/ <Location /perl> SetHandler perl-script PerlHandler Apache::Registry Options +ExecCGI </Location> </IfModule>
        to httpd.conf as well. However there's no mod_perl.c when I type httpd -l so the above IfModule statement isn't doing much probably.....? Any ideas? Thanks for the help. P
        Thanks for all your help. I've given up on Apache2 and reverted to Apache1 and mod_perl 1. I'm at least able to get that up and running. Now it's just a matter of reconfiguring everything else.... cheers.