wally fatboy klingon
Fight ePatents in Europe!
Get FireFox
I'm a hacker!
Valid CSS!
Valid HTML 4.01!
 
As explained in full by a friend of mine over here, it is quite easy to set up a section on your Apache webserver that is "protected" by a password challenge. But I got tired of always entering my password time and time again so I looked for a solution, which, i'm going to share with you...

Your standard .htaccess file might look like this:

AuthUserFile /path/to/.htpasswd
AuthName "Restricted Access Area"
AuthType Basic
Require valid-user
That requires authentication for anyone that accesses that spot on the server.
Now, to disable this behaviour for a specific IP address, change the .htaccess file to look like this:
AuthUserFile /path/to/.htpasswd
AuthName "Restricted Access Area"
AuthType Basic
Require valid-user

Order Deny,Allow
Deny from all
Allow from 192.168.0.0/16

Satisfy Any
The line 'Satisfy Any' is what makes it work. Although this is documented at The Apache webserver documentation, it's not easy to find for many of us. 'Satisfy Any' means that any of both client authenticators cause the client to be accepted, while 'Satisfy All' would mean all the authenticators have to pass before the client is accepted.

Simple, huh? :)