Allow access to one file

Hello all,

I have site whose docroot is protected by LDAP authentication.

In the docroot i have one file, "xml.php" that I need to exclude from
this authentication.

I have been mucking around with <Files>, <FilesMatch>, etc. wiht no
success.

Here's my .htaccess in the docroot, but I *do* have access to
httpd.conf if needed:

>>>>>>>>>>>>>>>>>>>>>>>>>>
AuthType Basic
AuthName "Protected Content"
AuthBasicProvider "ldap"
AuthLDAPURL "ldap://LDAP-HOST:PORT/DC=example,DC=com?uid?
sub?(objectClass=user)"
AuthLDAPBindDN ldap-search [at] example.com
AuthLDAPBindPassword "p [at] 55ww0rd"
authzldapauthoritative Off
require valid-user

<FilesMatch "^xml\.php">
Allow from all
</FilesMatch>
>>>>>>>>>>>>>>>>>>>>>>>>>>

A little help? Anyone?
winterbeef [ Fr, 11 April 2008 19:14 ] [ ID #1940395 ]

Re: Allow access to one file

"beef" <winterbeef [at] gmail.com> wrote in message
news:3def6062-2257-4db2-93b9-3252aad58e87 [at] 59g2000hsb.googleg roups.com...
> Hello all,
>
> I have site whose docroot is protected by LDAP authentication.
>
> In the docroot i have one file, "xml.php" that I need to exclude from
> this authentication.
>
> I have been mucking around with <Files>, <FilesMatch>, etc. wiht no
> success.
>
> Here's my .htaccess in the docroot, but I *do* have access to
> httpd.conf if needed:
>
> >>>>>>>>>>>>>>>>>>>>>>>>>>
> AuthType Basic
> AuthName "Protected Content"
> AuthBasicProvider "ldap"
> AuthLDAPURL "ldap://LDAP-HOST:PORT/DC=example,DC=com?uid?
> sub?(objectClass=user)"
> AuthLDAPBindDN ldap-search [at] example.com
> AuthLDAPBindPassword "p [at] 55ww0rd"
> authzldapauthoritative Off
> require valid-user
>
> <FilesMatch "^xml\.php">
> Allow from all
> </FilesMatch>
> >>>>>>>>>>>>>>>>>>>>>>>>>>
>
> A little help? Anyone?

Rearrange your directory/virtual host.
.... Allow from all
<FilesMatch "!^xml\.php">
AuthType, etc.
</FilesMatch>

The problem with your configuration is that the authorization applies to
everything in that directory/virtual host.
spam [ Sa, 12 April 2008 02:05 ] [ ID #1941185 ]

Re: Allow access to one file

> Rearrange your directory/virtual host.
> ... Allow from all
> <FilesMatch "!^xml\.php">
> AuthType, etc.
> </FilesMatch>
>
> The problem with your configuration is that the authorization applies to
> everything in that directory/virtual host.

Thanks! I tried this, but while it doesn't error, apache now does not
prompt for ANY files...

It almost seems like the bang is being interpreted as part of the
pattern, and not as logical inversion. I have not seen this syntax,
nor have been able to find any docs on it...

pointers?
winterbeef [ Mo, 14 April 2008 17:51 ] [ ID #1942081 ]
Webserver » alt.apache.configuration » Allow access to one file

Vorheriges Thema: POST request interception
Nächstes Thema: Proxy Server with Apache