modperl_httpd_conf

This is part of The Pile, a partial archive of some open source mailing lists and newsgroups.



To: "Modperl" <modperl@apache.org>
From: "Jamie Krasnoo" <webmaster@myeboard.com>
Subject: Is it Apache or me?
Date: Sun, 25 Feb 2001 20:15:30 -0800

I'm not quite sure how this works, and maybe I missed it in the Eagle book.
I have a handler set in httpd.conf like this:

<Location />
	Set-Handler perl-script
	PerlHandler app::main
</Location>

Now this works great when I want to go to the first page of the server.
However if I try to go to a static page, that page gets intercepted and the
app::main goes in to action. The handler doesn't intercept any of the other
set locations. Why is it intercepting static pages? Is it a standard rule
that a handler for <Location /> is never set?

===

To: Jamie Krasnoo <webmaster@myeboard.com>
From: sterling <sterling@covalent.net>
Subject: Re: Is it Apache or me?
Date: Sun, 25 Feb 2001 21:26:24 -0800 (PST)

if you set a handler for / it will handle every request that way.
you can either have all pages that are generated be /foo/ and set 
that as the location, or you can force all files with a certain
suffix to be handled by mod_perl: <Files ~ "*\.pl">.

===

To: "Jamie Krasnoo" <webmaster@myeboard.com>
From: "Ken Williams" <ken@forum.swarthmore.edu>
Subject: Re: Is it Apache or me?
Date: Sun, 25 Feb 2001 23:32:25 -0600

webmaster@myeboard.com (Jamie Krasnoo) wrote:

>I'm not quite sure how this works, and maybe I missed it in the Eagle book.
>I have a handler set in httpd.conf like this:
>
><Location />
>	Set-Handler perl-script
>	PerlHandler app::main
></Location>
>
>Now this works great when I want to go to the first page of the server.
>However if I try to go to a static page, that page gets intercepted and the
>app::main goes in to action. The handler doesn't intercept any of the other
>set locations. Why is it intercepting static pages? Is it a standard rule
>that a handler for <Location /> is never set?

It sounds like you want this (or similar):

<Files index.html>
	Set-Handler perl-script
	PerlHandler app::main
</Files>

Using <Location /> sets things for the entire server, because it means
"everything below /".

===

To: "Modperl" <modperl@apache.org>
From: "Jamie Krasnoo" <webmaster@myeboard.com>
Subject: RE: Is it Apache or me?
Date: Sun, 25 Feb 2001 23:25:14 -0800

Found a way around it. I used <LocationMatch "^/$">. Now it does what I want
it to do.

Thanks for your help guys.

Jamie

===

To: Modperl <modperl@apache.org>
From: darren chamberlain <dlc@users.sourceforge.net>
Subject: Re: Is it Apache or me?
Date: Mon, 26 Feb 2001 13:27:55 -0500

Jamie Krasnoo (webmaster@myeboard.com) said something to this effect on 02/26/2001:
> I'm not quite sure how this works, and maybe I missed it in the Eagle book.
> I have a handler set in httpd.conf like this:
> 
> <Location />
> 	Set-Handler perl-script
> 	PerlHandler app::main
> </Location>
> 
> Now this works great when I want to go to the first page of the server.
> However if I try to go to a static page, that page gets intercepted and the
> app::main goes in to action. The handler doesn't intercept any of the other
> set locations. Why is it intercepting static pages? Is it a standard rule
> that a handler for <Location /> is never set?

Another option, besides a LocationMatch or Files section, is to
return DECLINED in your handler:

    return DECLINED unless ($r->content_type eq 'text/html');

Now things like images, directories, etc will not be handled by
app::man.

===

the rest of The Pile (a partial mailing list archive)

doom@kzsu.stanford.edu