modperl_some_eagle_errata_apache_tree_browser

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



To: Pierre Phaneuf <pp@ludusdesign.com>
From: Matt Sergeant <matt@sergeant.org>
Subject: Re: trouble with path_info
Date: Tue, 13 Feb 2001 20:40:08 +0000 (GMT)

On Tue, 13 Feb 2001, Pierre Phaneuf wrote:

> Matt Sergeant wrote:
> 
> > > Does anyone has an idea about this? I think I have proper behavior from
> > > my perl handler by installing it at the root of the server, but this is
> > > no real solution!
> > >
> > > What I am doing wrong here???
> > >
> > > > I'm really stumped with that one. How come Apache::Registry gets the
> > > > right information and I don't??? I tried doing the exact same thing, to
> > > > no avail.
> > 
> > Because Apache::Registry has a real file, so the fixup handler puts the
> > right thing in path_info. Without a real file and a fixup handler you
> > don't get the right information in path_info, you have to figure it out by
> > hand.
> 
> That would make the Apache::TreeBrowser example in the eagle book wrong,
> isn't it?

Yes, that example seems incorrect to me.


===

To: "modperl@apache.org" <modperl@apache.org>
From: Pierre Phaneuf <pp@ludusdesign.com>
Subject: Re: trouble with path_info
Date: Tue, 13 Feb 2001 16:41:27 -0500

Matt Sergeant wrote:

> > That would make the Apache::TreeBrowser example in the eagle book wrong,
> > isn't it?
> 
> Yes, that example seems incorrect to me.

Hmm... Strange... It actually *works* at http://modperl.com/tree/ and I
downloaded its source code from http://modperl.com/book/source/!

Doug, is there something you forgot? Errata? Or, again, something we are
forgetting?

I made a PerlFixUpHandler that simply shave $r->location from the front
of $r->path_info, if you install it in the same directory as
Apache::TreeBrowser (or other similarly written handler), it make them
work fine.

> PS: Please don't post large attachments to the list in future - send us a
> link to a place we can see the code you are using on the web.

Sorry! I took extra care to make the package as small as possible, but I
understand the rule, thanks!

===
To: Pierre Phaneuf <pp@ludusdesign.com>
From: Matt Sergeant <matt@sergeant.org>
Subject: Re: trouble with path_info
Date: Tue, 13 Feb 2001 22:32:21 +0000 (GMT)

On Tue, 13 Feb 2001, Pierre Phaneuf wrote:

> Matt Sergeant wrote:
> 
> > > That would make the Apache::TreeBrowser example in the eagle book wrong,
> > > isn't it?
> > 
> > Yes, that example seems incorrect to me.
> 
> Hmm... Strange... It actually *works* at http://modperl.com/tree/ and I
> downloaded its source code from http://modperl.com/book/source/!

Right, but the directory /tree might exist on their server - you never
know...

===
To: "modperl@apache.org" <modperl@apache.org>
From: Pierre Phaneuf <pp@ludusdesign.com>
Subject: Re: trouble with path_info
Date: Tue, 13 Feb 2001 18:22:04 -0500

Matt Sergeant wrote:

> > Hmm... Strange... It actually *works* at http://modperl.com/tree/ and I
> > downloaded its source code from http://modperl.com/book/source/!
> 
> Right, but the directory /tree might exist on their server - you never
> know...

I found the visible trigger.

I didn't have a DocumentRoot *at all* in my configuration, but it didn't
matter, as everything I have is served from handlers in <Location>
sections (or even in the root of the configuration file!). If I would
hit / directly (without the root PerlHandler), I would get a notice
about /usr/htdocs not existing in my error log (that's the default
DocumentRoot).

I intented to verify the idea that having an actual /tree directory
would help matters, so I proceeded to set a DocumentRoot in my
configuration, figuring I'd then create the appropriate directory.

Behold! Everything worked as in the book, without the directory! It just
needed to have something *valid* as the DocumentRoot (I tried setting
the DocumentRoot to something invalid, it doesn't work).

Now, I do not completely understand this. Am I right when I say that
nothing on the filesystem is needed to locate a <Location> handler?
IMHO, a <Location> handler should be able to get its path_info resolved
without any filesystem access (thus, without any dependency on having a
valid DocumentRoot), and the current behavior would be a bug.

I think the trouble might be more into Apache itself than in mod_perl.

Right now, I consider my problem fixed, but I feel that this might be a
real bug. I'll go submit something to the Apache bug tracking system
later...

===

To: Pierre Phaneuf <pp@ludusdesign.com>
From: Matt Sergeant <matt@sergeant.org>
Subject: Re: trouble with path_info
Date: Tue, 13 Feb 2001 23:26:24 +0000 (GMT)

On Tue, 13 Feb 2001, Pierre Phaneuf wrote:

> Now, I do not completely understand this. Am I right when I say that
> nothing on the filesystem is needed to locate a <Location> handler?
> IMHO, a <Location> handler should be able to get its path_info resolved
> without any filesystem access (thus, without any dependency on having a
> valid DocumentRoot), and the current behavior would be a bug.

Well you should read how Apache works. See
http://httpd.apache.org/docs/sections.html

It should clear things up for you.

===

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

doom@kzsu.stanford.edu