You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by "Marc M. Adkins" <mm...@Doorways.org> on 2003/06/06 05:36:01 UTC
DirectoryIndex doesn't see SetHandler path
This is going to seem odd...obscure...dumb...
I've been using code like this to set up handlers:
<Location /some/path/index>
SetHandler perl-script
PerlResponseHandler Some::Handler
</Location>
Now I'm using this code to set up handlers for individual pages. The
directive above is in a sense telling Apache "there is a directory
/some/path/index which contains files which should be processed via
Some::Handler" but in fact there is no such directory. There is just a
handler. So in my mind I'm defining a single page with a handler.
All this works OK, weird though it may be, until I want a directory index.
Say I want to go to url:
/some/path
The DirectoryIndex directive doesn't allow me to say that 'index' is a
directory, only 'index.html'. That is to say, the following:
DirectoryIndex index index.html
doesn't cause Apache to automatically find /some/path/index, even if I have
defined one using AddHandler. I'm assuming this is because there is no such
file, the handler is attached to the /some/path/index directory, there isn't
anything for Apache to find.
For the moment I'm faking things out using the miracle of mod_rewrite:
RedirectMatch ^/some/path/index\.html /some/path/index
which makes it all work like I want. NOW Apache finds the handler for some
reason. So I'm not complaining, and I don't need a fix, but I wonder if I'm
missing something.
* AddHandler attaches a handler to a set of files with a given suffix.
* SetHandler attaches a handler to a location (a directory, right?)
and all of the files therein.
* There isn't (?) a directive that attaches a handler to a single leaf
in the directory tree which may in fact be non-existent in such a
manner that the DirectoryIndex directive will find the leaf.
Have I missed something? Am I abusing the tool?
mma
Re: DirectoryIndex doesn't see SetHandler path
Posted by Stas Bekman <st...@stason.org>.
Marc M. Adkins wrote:
>>I hope that this is the issue. Marc has failed to say that he is using
>>mp2/apache2, so I won't be surprised if this is yet another
>>problem introduced
>>by apache-2.0 (incompatible mod_dir behavior wrt apache-1.3). see
>>my recent
>>bug reports to the httpd-dev list.
>
>
> Yah, yah, sorry, Apache 2.0.46 on W2K, ActiveState build 804 (Perl 5.8),
> mod_perl/1.99_10-dev. Postcards from the bleeding edge.
>
> Wish I'd given more attention to your postings on httpd-dev. I was thinking
> this might be a bug and it might not...I'm not always sure what is
> _supposed_ to happen.
You don't have to keep up with all those bloody^H^H^H^Heeding lists. The issue
with Apache 2.0 is that it has totally changed the way it handles existing
directories which also happen to be assigned to be handled by handlers. One
thing I didn't try is replacing <Location > containers with <Directory >.
I haven't really delved into the specific issue you have asked about, so I
might be talking about a totally irrelevant to your problem thing, that's why
I haven't responded in first place, but just wanted to tell that 2.0 behavior
"might" be different.
__________________________________________________________________
Stas Bekman JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org http://ticketmaster.com
RE: DirectoryIndex doesn't see SetHandler path
Posted by "Marc M. Adkins" <mm...@Doorways.org>.
> I hope that this is the issue. Marc has failed to say that he is using
> mp2/apache2, so I won't be surprised if this is yet another
> problem introduced
> by apache-2.0 (incompatible mod_dir behavior wrt apache-1.3). see
> my recent
> bug reports to the httpd-dev list.
Yah, yah, sorry, Apache 2.0.46 on W2K, ActiveState build 804 (Perl 5.8),
mod_perl/1.99_10-dev. Postcards from the bleeding edge.
Wish I'd given more attention to your postings on httpd-dev. I was thinking
this might be a bug and it might not...I'm not always sure what is
_supposed_ to happen.
mma
Re: DirectoryIndex doesn't see SetHandler path
Posted by Stas Bekman <st...@stason.org>.
Michael Kropinack wrote:
> Mark,
>
> I think that I may be able to clarify this. I ran into the same type of
> problem a few weeks ago. I had always defined my handlers inside a "Location"
> block and couldn't get the DirectoryIndex to work properly. I solved my
> problem by calling my handler from within a "Directory" block instead.
>
> You should be able to find the answer you're looking for on the following page.
>
> http://httpd.apache.org/docs/sections.html
I hope that this is the issue. Marc has failed to say that he is using
mp2/apache2, so I won't be surprised if this is yet another problem introduced
by apache-2.0 (incompatible mod_dir behavior wrt apache-1.3). see my recent
bug reports to the httpd-dev list.
>>-----Original Message-----
>>From: Marc M. Adkins [mailto:mmadki@Doorways.org]
>>Sent: Thursday, June 05, 2003 11:36 PM
>>To: modperl@perl.apache.org
>>Subject: DirectoryIndex doesn't see SetHandler path
>>
>>
>>This is going to seem odd...obscure...dumb...
>>
>>I've been using code like this to set up handlers:
>>
>> <Location /some/path/index>
>> SetHandler perl-script
>> PerlResponseHandler Some::Handler
>> </Location>
>>
>>Now I'm using this code to set up handlers for individual pages. The
>>directive above is in a sense telling Apache "there is a directory
>>/some/path/index which contains files which should be processed via
>>Some::Handler" but in fact there is no such directory. There is just a
>>handler. So in my mind I'm defining a single page with a handler.
>>
>>All this works OK, weird though it may be, until I want a directory index.
>>Say I want to go to url:
>>
>> /some/path
>>
>>The DirectoryIndex directive doesn't allow me to say that 'index' is a
>>directory, only 'index.html'. That is to say, the following:
>>
>> DirectoryIndex index index.html
>>
>>doesn't cause Apache to automatically find /some/path/index, even
>>if I have
>>defined one using AddHandler. I'm assuming this is because there
>>is no such
>>file, the handler is attached to the /some/path/index directory,
>>there isn't
>>anything for Apache to find.
>>
>>For the moment I'm faking things out using the miracle of mod_rewrite:
>>
>> RedirectMatch ^/some/path/index\.html /some/path/index
>>
>>which makes it all work like I want. NOW Apache finds the
>>handler for some
>>reason. So I'm not complaining, and I don't need a fix, but I
>>wonder if I'm
>>missing something.
>>
>>* AddHandler attaches a handler to a set of files with a given suffix.
>>* SetHandler attaches a handler to a location (a directory, right?)
>> and all of the files therein.
>>* There isn't (?) a directive that attaches a handler to a single leaf
>> in the directory tree which may in fact be non-existent in such a
>> manner that the DirectoryIndex directive will find the leaf.
>>
>>Have I missed something? Am I abusing the tool?
>>
>>mma
>>
>
>
--
__________________________________________________________________
Stas Bekman JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org http://ticketmaster.com
RE: DirectoryIndex doesn't see SetHandler path
Posted by Michael Kropinack <mk...@modperlhosting.com>.
Mark,
I think that I may be able to clarify this. I ran into the same type of
problem a few weeks ago. I had always defined my handlers inside a "Location"
block and couldn't get the DirectoryIndex to work properly. I solved my
problem by calling my handler from within a "Directory" block instead.
You should be able to find the answer you're looking for on the following page.
http://httpd.apache.org/docs/sections.html
-Mike
> -----Original Message-----
> From: Marc M. Adkins [mailto:mmadki@Doorways.org]
> Sent: Thursday, June 05, 2003 11:36 PM
> To: modperl@perl.apache.org
> Subject: DirectoryIndex doesn't see SetHandler path
>
>
> This is going to seem odd...obscure...dumb...
>
> I've been using code like this to set up handlers:
>
> <Location /some/path/index>
> SetHandler perl-script
> PerlResponseHandler Some::Handler
> </Location>
>
> Now I'm using this code to set up handlers for individual pages. The
> directive above is in a sense telling Apache "there is a directory
> /some/path/index which contains files which should be processed via
> Some::Handler" but in fact there is no such directory. There is just a
> handler. So in my mind I'm defining a single page with a handler.
>
> All this works OK, weird though it may be, until I want a directory index.
> Say I want to go to url:
>
> /some/path
>
> The DirectoryIndex directive doesn't allow me to say that 'index' is a
> directory, only 'index.html'. That is to say, the following:
>
> DirectoryIndex index index.html
>
> doesn't cause Apache to automatically find /some/path/index, even
> if I have
> defined one using AddHandler. I'm assuming this is because there
> is no such
> file, the handler is attached to the /some/path/index directory,
> there isn't
> anything for Apache to find.
>
> For the moment I'm faking things out using the miracle of mod_rewrite:
>
> RedirectMatch ^/some/path/index\.html /some/path/index
>
> which makes it all work like I want. NOW Apache finds the
> handler for some
> reason. So I'm not complaining, and I don't need a fix, but I
> wonder if I'm
> missing something.
>
> * AddHandler attaches a handler to a set of files with a given suffix.
> * SetHandler attaches a handler to a location (a directory, right?)
> and all of the files therein.
> * There isn't (?) a directive that attaches a handler to a single leaf
> in the directory tree which may in fact be non-existent in such a
> manner that the DirectoryIndex directive will find the leaf.
>
> Have I missed something? Am I abusing the tool?
>
> mma
>
>