Re: [QUESTION] mod_perl isnt having any effect...perhaps I've misconfigured?

2006-07-11 Thread Evan Kaufman

To check if mod_perl is loading at all, you could put some warns in your
module that you load with PerlModule, or PerlRequire a startup.pl that
logs something.

i think i found the problem, its something specific to the linux
distro i'm using (gentoo) thats preventing mod_perl from ever loading.
i've yet to find the solution, but since its distro-specific, i'll
ask on the gentoo forums.

thanks so much for the help!


[QUESTION] mod_perl isnt having any effect...perhaps I've misconfigured?

2006-07-10 Thread Evan Kaufman

I'm running a Gentoo Linux server using Apache 2.0.55-r1 with Perl
5.8.8, and just recently installed mod_perl 2.0.1-r2.  However,
mod_perl just doesnt seem to work.  I get no errors when apache starts
up, and theres nothing in apache's error log except some unrelated
404s.  It [mod_perl] just...isnt doing anything.

My (only) virtual host and mod_perl are configured as follows:

# default virtual host
NameVirtualHost *:80
IfDefine DEFAULT_VHOST
   VirtualHost *:80

   DocumentRoot /home/test/public_html

   Directory /home/test/public_html
   Options Indexes FollowSymLinks ExecCGI
   AllowOverride None
   DirectoryIndex index.htm index.html index.pl index.cgi index.php
   AddHandler cgi-script .cgi
   Order allow,deny
   Allow from all
   /Directory

   IfModule peruser.c
   ServerEnvironment apache apache
   MinSpareProcessors 4
   MaxProcessors 20
   /IfModule

   /VirtualHost
/IfDefine

# mod_perl configuration
IfDefine PERL
   IfModule !mod_perl.c
   LoadModule perl_modulemodules/mod_perl.so
   /IfModule
/IfDefine

IfModule mod_perl.c

   IfModule mod_access.c
   Location /perl-status
   SetHandler perl-script
   PerlResponseHandler Apache2::Status
   Order deny,allow
   Deny from all
   Allow from 127.0.0.1
   /Location
   /IfModule

   PerlModule ModPerl::Registry
   Directory /home/test/public_html/perl
   SetHandler perl-script
   PerlResponseHandler ModPerl::Registry
   Options -Indexes ExecCGI
   PerlSendHeader On
   /Directory

   PerlModule Onomatopoeia
   Files *.phtml
 SetHandler perl-script
 PerlHandler Onomatopoeia
 PerlSendHeader On
   /Files
/IfModule

Now, apache serves html and text documents, and even .cgi scripts
(which run through the normal mod_cgi).  However, when I run any .pl
scripts, for instance http://localhost/perl/test.pl:

#!/usr/bin/perl -w
print Content-Type: text/html\n\n;
if($ENV{MOD_PERL}) { print using mod_perl!\n; }
else { print NOT using mod_perl!\n; }

I get a download file dialog, which means its not sending the
text/html content-type header, so its probably not being interpreted
(because I am using the PerlSendHeader directive, and the script is
chmodded to 755).

Additionally, whenever I try to access a .phtml file (which should be
parsed by a handler module, Onomatopoeia in this case), it's served up
as a static html document.
And, if I try http://localhost/perl-status, i get a 404.

Am I missing something obvious?  Perhaps I stumbled past something in
the docs?  I appreciate any help, sorry for the length message!


Re: [QUESTION] mod_perl isnt having any effect...perhaps I've misconfigured?

2006-07-10 Thread Evan Kaufman

You need to do more debugging to find out if your requests are going
through mod_perl or not.  For example, you could add a warn of
$ENV{MOD_PERL} in your test script and see what shows up in the log.

Nope, nothing in the error log.  Apache isnt executing the .pl file,
just serving it up as a raw binary file (its not even converting
newlines).


 AddHandler cgi-script .cgi

If you take that out, does mod_perl work as expected?

No, that just prevents the .cgi files (currently vanilla cgi scripts)
from executing.

And I've restarted apache after every modification to the
configs...(thanks for responding though!)


Re: [QUESTION] mod_perl isnt having any effect...perhaps I've misconfigured?

2006-07-10 Thread Perrin Harkins
On Mon, 2006-07-10 at 16:05 -0500, Evan Kaufman wrote:
  You need to do more debugging to find out if your requests are going
  through mod_perl or not.  For example, you could add a warn of
  $ENV{MOD_PERL} in your test script and see what shows up in the log.
 Nope, nothing in the error log.  Apache isnt executing the .pl file,
 just serving it up as a raw binary file (its not even converting
 newlines).

I'd try shutting down apache to make sure you have the right one.
Sounds dumb, but I've done it more than once.  Then I'd try removing
things from your config until it starts to work, or else just try using
a really minimal one.

To check if mod_perl is loading at all, you could put some warns in your
module that you load with PerlModule, or PerlRequire a startup.pl that
logs something.

- Perrin