You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Aaron Dalton <aa...@daltons.ca> on 2007/09/05 01:24:17 UTC

[users@httpd] Overriding

I have an overarching <Location /> directive that passes everything in
my virtual host through a home-rolled handler.  I would like create a
few directory aliases, though, that bypass this handler.  As far as I
know, however, Locations are processed before Directories.  How can I
accomplish this?  Here's what I want to do:

Alias /js /foo/bar/js
<Directory /foo/bar/js>
	Allow from all
</Directory>

<Location />
	# mod_perl handler stuff
</Location>

Thanks for your time and attention.
-- 
Aaron Dalton       |   Super Duper Games
aaron@daltons.ca   |   http://superdupergames.org

Re: [users@httpd] Overriding

Posted by Aaron Dalton <aa...@daltons.ca>.
Joshua Slive wrote:
> On 9/4/07, Aaron Dalton <aa...@daltons.ca> wrote:
> 
>> Thanks again.  <Location /js> would be fine but how do I then associate
>> /js with somewhere in the filesystem?  I kept the Alias and <Directory>
>> directives too, but no go.  I am confused about why <Location /> slurps
>> everything in if it is indeed resolved last as the documentation states.
>>  Why is the Alias + <Directory> not being seen and invoked first?
> 
> The <Directory> is invoked first, but its effects are later overridden
> by the <Location />.
> 
> I don't know why the <Location /js>SetHandler trick isn't working. Are
> you listing that AFTER the <Location />? (Order in the config file
> does matter when applying multiple <Location> sections.)
> 
> Joshua.

*There* we go!  I'm new to working with <Location>s so I appreciate your
patience.  This is my current configuration and it is now working as
expected.  Thanks again!

Alias /foo/bar /some/dir
<Directory /some/dir>
	#stuff
</Directory>

<Location />
	#mod-perl handler
</Location>

<Location /foo/bar>
	SetHandler default-handler
</Location>

-- 
Aaron Dalton       |   Super Duper Games
aaron@daltons.ca   |   http://superdupergames.org

Re: [users@httpd] Overriding

Posted by Aaron Dalton <aa...@daltons.ca>.
Joshua Slive wrote:
> On 9/4/07, Aaron Dalton <aa...@daltons.ca> wrote:
>> Joshua Slive wrote:
>>> On 9/4/07, Aaron Dalton <aa...@daltons.ca> wrote:
>>>> I have an overarching <Location /> directive that passes everything in
>>>> my virtual host through a home-rolled handler.  I would like create a
>>>> few directory aliases, though, that bypass this handler.  As far as I
>>>> know, however, Locations are processed before Directories.  How can I
>>>> accomplish this?  Here's what I want to do:
>>>>
>>>> Alias /js /foo/bar/js
>>>> <Directory /foo/bar/js>
>>>>         Allow from all
>>>> </Directory>
>>>>
>>>> <Location />
>>>>         # mod_perl handler stuff
>>>> </Location>
>>> No, Location is processed after Directory and the last match usually wins.
>>>
>>> Why not put the mod_perl stuff in a <Directory> section instead?
>> Thanks for the reply, Joshua.  The <Location /> is used because the
>> handler implements a RESTful system where the urls do not map to the
>> file system.  Some urls, however, need to reference specific files, thus
>> the Alias+<Directory>.  I tried moving the <Directory> directive after
>> the <Location> but the Location handler is still intercepting the request.
> 
> The order in the config file is irrelevant.
> 
> You can either be more specific in your <Location> sections -- they
> probably don't really need to cover EVERYTHING. Or you can try
> something like
> <Location /js>
> SetHandler default-handler
> </Location>
> 
> Or you can play with <LocationMatch> to find a regex that excludes
> some specific URLs.
> 
> Joshua.

Thanks again.  <Location /js> would be fine but how do I then associate
/js with somewhere in the filesystem?  I kept the Alias and <Directory>
directives too, but no go.  I am confused about why <Location /> slurps
everything in if it is indeed resolved last as the documentation states.
 Why is the Alias + <Directory> not being seen and invoked first?

-- 
Aaron Dalton       |   Super Duper Games
aaron@daltons.ca   |   http://superdupergames.org

Re: [users@httpd] Overriding

Posted by Joshua Slive <js...@gmail.com>.
On 9/4/07, Aaron Dalton <aa...@daltons.ca> wrote:
> Joshua Slive wrote:
> > On 9/4/07, Aaron Dalton <aa...@daltons.ca> wrote:
> >> I have an overarching <Location /> directive that passes everything in
> >> my virtual host through a home-rolled handler.  I would like create a
> >> few directory aliases, though, that bypass this handler.  As far as I
> >> know, however, Locations are processed before Directories.  How can I
> >> accomplish this?  Here's what I want to do:
> >>
> >> Alias /js /foo/bar/js
> >> <Directory /foo/bar/js>
> >>         Allow from all
> >> </Directory>
> >>
> >> <Location />
> >>         # mod_perl handler stuff
> >> </Location>
> >
> > No, Location is processed after Directory and the last match usually wins.
> >
> > Why not put the mod_perl stuff in a <Directory> section instead?
>
> Thanks for the reply, Joshua.  The <Location /> is used because the
> handler implements a RESTful system where the urls do not map to the
> file system.  Some urls, however, need to reference specific files, thus
> the Alias+<Directory>.  I tried moving the <Directory> directive after
> the <Location> but the Location handler is still intercepting the request.

The order in the config file is irrelevant.

You can either be more specific in your <Location> sections -- they
probably don't really need to cover EVERYTHING. Or you can try
something like
<Location /js>
SetHandler default-handler
</Location>

Or you can play with <LocationMatch> to find a regex that excludes
some specific URLs.

Joshua.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Overriding

Posted by Aaron Dalton <aa...@daltons.ca>.
Joshua Slive wrote:
> On 9/4/07, Aaron Dalton <aa...@daltons.ca> wrote:
>> I have an overarching <Location /> directive that passes everything in
>> my virtual host through a home-rolled handler.  I would like create a
>> few directory aliases, though, that bypass this handler.  As far as I
>> know, however, Locations are processed before Directories.  How can I
>> accomplish this?  Here's what I want to do:
>>
>> Alias /js /foo/bar/js
>> <Directory /foo/bar/js>
>>         Allow from all
>> </Directory>
>>
>> <Location />
>>         # mod_perl handler stuff
>> </Location>
> 
> No, Location is processed after Directory and the last match usually wins.
> 
> Why not put the mod_perl stuff in a <Directory> section instead?

Thanks for the reply, Joshua.  The <Location /> is used because the
handler implements a RESTful system where the urls do not map to the
file system.  Some urls, however, need to reference specific files, thus
the Alias+<Directory>.  I tried moving the <Directory> directive after
the <Location> but the Location handler is still intercepting the request.

-- 
Aaron Dalton       |   Super Duper Games
aaron@daltons.ca   |   http://superdupergames.org

Re: [users@httpd] Overriding

Posted by Joshua Slive <jo...@slive.ca>.
On 9/4/07, Aaron Dalton <aa...@daltons.ca> wrote:
> I have an overarching <Location /> directive that passes everything in
> my virtual host through a home-rolled handler.  I would like create a
> few directory aliases, though, that bypass this handler.  As far as I
> know, however, Locations are processed before Directories.  How can I
> accomplish this?  Here's what I want to do:
>
> Alias /js /foo/bar/js
> <Directory /foo/bar/js>
>         Allow from all
> </Directory>
>
> <Location />
>         # mod_perl handler stuff
> </Location>

No, Location is processed after Directory and the last match usually wins.

Why not put the mod_perl stuff in a <Directory> section instead?

Joshua.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org