PDA

View Full Version : Only prompt WAN users for Apache password?


brianafischer
1st March 2006, 08:34 AM
I was wondering if there were any tricks that would allow me to configure my system running a webserver to only prompt a user coming through my cable modem and not a user on the LAN. My configuration:

Fedora 2.6.12-1.1381_FC3
httpd-2.0.53-3.3

From httpd.conf:
AllowOverride None
# Force a password
AuthType Basic
AuthName "BasicAuth"
AuthUserFile /etc/httpd/conf/basicauth
Require valid-user

Any advice? Thanks,

Brian

wdingus
2nd March 2006, 02:57 AM
.htaccess contents:

AuthName "whatever"
AuthType Basic
AuthUserFile /path/to/file
deny from all
allow from nnn.nnn.nnn
require valid-user
satisfy any


The "allow from" I have in place is the first 3 octets of a valid Class C network. I'm guessing it could be defined quite a few ways other than how I did it... The "satisfy any" allows either the internal LAN IP or the providing of a password coming in from some other network to constitute authentication.