nivanka
nivanka

Reputation: 1372

apache basic_authentication exception

I want to put the a server under apache_basic authentication, I added HTTP auth to the root of the server using this

<Location />
   AuthType Basic
   AuthName "Authentication"
   AuthBasicProvider file
   AuthUserFile /etc/authdb
   Require valid-user
</Location>

now this works fine, and it authenticate everyone in.

now I have uploadify which is flash, and used to upload images to the server. So as this is flash, the requests sent to the server get 401 errors, and I want to do the authentication expect the uploadify URLs.

I added more configs to the httpd.conf which is this

<Location */UploadifyForm/*>
   AuthType None
   Require all granted
</Location>

but this doesnt work, any one knows a solution for this please ?

Upvotes: 2

Views: 1018

Answers (1)

Augusto Destrero
Augusto Destrero

Reputation: 4345

If UploadifyForm is under the root of your server these two directives should do the trick:

<Location "/">
    AuthType Basic
    AuthName "Authentication"
    AuthBasicProvider file
    AuthUserFile /etc/authdb
    Require valid-user
</Location>
<Location "/UploadifyForm">
    AuthType None
    Require all granted
</Location>

Note that of your resources are on a filesystem, it is better to use Directory directives instead of Location ones. You can find more info in the Apache documentation.

Upvotes: 1

Related Questions