On Wed, 2005-11-02 at 17:19 -0600, Michael Preslar wrote:
> Server version: Apache/2.0.40
[...]
> What version of mod_perl? Not sure. CPAN wants me to upgrade to 1.29

Nothing in the 1.x mp series will run on the 2.x apache series.  You can
find out what version you have by printing $ENV{MOD_PERL} or looking at
the startup message in your error_log. 

> # declare these here since I dont have an Apache::Constants

Those are in Apache2::Const now.  See the 2.0 migration documentation.

> use constant OK => "200";
> use constant DECLINED => "404";
> 
> sub handler {
>         my $r = shift;
> 
>         return OK unless $r->header_in('Referer') ne '';
> 
>         return OK unless $r->header_in('Referer') ne '-';
> 
>         if ($r->header_in('Referer') =~ /$badwords/i) {
>                 return DECLINED;
>         } else {
>                 return OK;
>         }

Those are not supposed to be HTTP codes.  They are apache internal
codes.  The values 200 and 404 are not correct.

> Now.. All seems right.. To me at least.. But whenever I restart apache, 
> it errors out

I think the above should explain what the problem is, but in the future,
please explain what happens more specifically than "it errors out."
That could mean practically anything.

- Perrin

Reply via email to