Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have an Apache server in a DMZ, reachaable on the LAN from, public 123.456.789.123. I'm trying to get it to require authentication if the inbound hits are coming from the public side. This doesn't seem to work:

SetEnvIf SERVER_ADDR 123.456.789.123 local_nic=1

<Location /junk>
  Order Deny,Allow
  AuthName "Access required"
  AuthType Basic
  AuthUserFile /etc/httpd/conf/htpasswd
  Require valid-user

What am I doing wrong?

Sorry, HTML tags were wiping out my Apache directives.

share|improve this question
i guess something got lost in the formatting there, you are setting an env var but not doing anything with it later? – Aleksandar Ivanisevic Oct 21 '10 at 20:55

Never mind - I found an easier way: require auth, allow 10.x.x.x, and Satisfy Any. That lets people on the LAN get in without passwords, and people on the WAN to require passwords.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.