Apache2 authentication - Allow from IP, else use LDAP
Hello,
Is there a way of setting the directives on a particular file using the main Apache config file so that an IP address and/or localhost is allowed access, but everyone else uses LDAP to authenticate. E.g: I have /var/www/htdocs/ which is set to auth using LDAP. But then I'd like /var/www/htdocs/tsp/php/file1.php to be exempt from LDAP, but only for an IP - (10.10.10.10) for examples sake. I had a brief play with Allow from directives but no luck as yet... I'm probably doing it completely wrong. Code:
<Directory "/var/www/htdocs"> ns |
Hi,
You can allow access to that directory either to an authenticated user, or from the IP(s) you want, by adding a Code:
Satisfy Any If you want to do the same for a particular file, I guess you'll need to use mod_rewrite Regards |
Thanks bathory,
I'm using the following example from the apache docs: Code:
Satisfy Code:
<Directory "/var/www/htdocs"> Thanks again, ns |
You're using wrong Order and you need also a "Deny All".
The config in your 1st post was ok for this to work. So use: Code:
<Directory "/var/www/htdocs"> |
You're absolutely right.
The code was checking PHP_AUTH_USER, and if not set, was redirecting to a script in /var/www/cgi-bin, which is configured differently to /var/www/htdocs. So that's why it was prompting me for the password every time. Cheers for the help, ns |
All times are GMT -5. The time now is 10:45 PM. |