You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Jakov Sosic <ja...@srce.hr> on 2010/11/25 15:39:07 UTC

[users@httpd] Location and sublocation?

Hi.

I have a following config:

<Location />
   Order allow,deny
   Allow from all
   AuthType basic
   AuthName "Password Required"
   AuthUserFile /etc/httpd/htpasswd
   Require valid-user
</Location>

Now, I want to allow access to location /somethingelse. Is that possible
somehow? For example, tu put this in configuration:

<Location /somethingelse>
   Allow from all
</Location>

This does not work. It seems that locations cannot be chained like
directories. So can I achieve this somehow?

Problem that I have is: i must defend location "/" with authentication,
and for authentication I use mod_auth_memcookie with local PHP files
which must be accessible by world if I want the authentication to
work... So chicken and egg problem - if I don't defend /, I can access
/somethingelse and authorize, if I defend /, I cannot access
/somethingelse and because of that I cannot authenticate :(


Apache 2.2 on CentOS 5.5


-- 
Jakov Sosic

---------------------------------------------------------------------
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] Location and sublocation?

Posted by Tom Evans <te...@googlemail.com>.
On Thu, Nov 25, 2010 at 2:39 PM, Jakov Sosic <ja...@srce.hr> wrote:
> Hi.
>
> I have a following config:
>
> <Location />
>   Order allow,deny
>   Allow from all
>   AuthType basic
>   AuthName "Password Required"
>   AuthUserFile /etc/httpd/htpasswd
>   Require valid-user
> </Location>
>
> Now, I want to allow access to location /somethingelse. Is that possible
> somehow? For example, tu put this in configuration:
>
> <Location /somethingelse>
>   Allow from all
> </Location>
>
> This does not work. It seems that locations cannot be chained like
> directories. So can I achieve this somehow?
>
> Problem that I have is: i must defend location "/" with authentication,
> and for authentication I use mod_auth_memcookie with local PHP files
> which must be accessible by world if I want the authentication to
> work... So chicken and egg problem - if I don't defend /, I can access
> /somethingelse and authorize, if I defend /, I cannot access
> /somethingelse and because of that I cannot authenticate :(
>
>
> Apache 2.2 on CentOS 5.5
>
>

This is covered in the docs:

http://httpd.apache.org/docs/2.2/mod/core.html#require

gives this exact case as an example (you're missing a 'Satisfy Any' in
the 2nd block).

Cheers

Tom

Cheers

Tom

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