You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Jamie Krasnoo <we...@myeboard.com> on 2001/02/26 05:15:30 UTC

Is it Apache or me?

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?

Thanks,

Jamie Krasnoo
www.MyEBoard.com
webmaster@myeboard.com

public key: http://www.planetphat.com/jkrasnoo/pgp.html


Re: Is it Apache or me?

Posted by darren chamberlain <dl...@users.sourceforge.net>.
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.

(darren)

-- 
As the poet said, 'Only God can make a tree' - probably because it's
so hard to figure out how to get the bark on.
    -- Woody Allen

Re: Is it Apache or me?

Posted by Ken Williams <ke...@forum.swarthmore.edu>.
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 /".


  -------------------                            -------------------
  Ken Williams                             Last Bastion of Euclidity
  ken@forum.swarthmore.edu                            The Math Forum

RE: Is it Apache or me?

Posted by Jamie Krasnoo <we...@myeboard.com>.
Found a way around it. I used <LocationMatch "^/$">. Now it does what I want
it to do.

Thanks for your help guys.

Jamie

-----Original Message-----
From: sterling [mailto:sterling@covalent.net]
Sent: Sunday, February 25, 2001 9:26 PM
To: Jamie Krasnoo
Cc: Modperl
Subject: Re: Is it Apache or me?


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">.


sterling

On Sun, 25 Feb 2001, 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?
>
> Thanks,
>
> Jamie Krasnoo
> www.MyEBoard.com
> webmaster@myeboard.com
>
> public key: http://www.planetphat.com/jkrasnoo/pgp.html
>


Re: Is it Apache or me?

Posted by sterling <st...@covalent.net>.
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">.


sterling

On Sun, 25 Feb 2001, 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?
> 
> Thanks,
> 
> Jamie Krasnoo
> www.MyEBoard.com
> webmaster@myeboard.com
> 
> public key: http://www.planetphat.com/jkrasnoo/pgp.html
>