0

I have managed to password protect a virtualhost by using this:

     <Proxy *>
            Order deny,allow
            Deny from all
            Allow from office-ip-1 office-ip-2
    </Proxy>

It works fine as far as it's accessed from our office (the IP used are office static IPs) . Now I want to give access to the web application for some people who might be working from home thus using different IPs (not static IP). So what I want to achieve is that if I am in the office , I can have access without password challenge but when am not in the office a basic auth challenge prompt should pop up.

Is it possible to have this hybrid setup in apache2 under ubuntu 12.04 ? If yes kindly show the way to do it.

Thanks

black sensei
  • 609
  • 3
  • 10
  • 25

1 Answers1

2

You can use Apache's Satisfy directive for that:

AuthType Basic
AuthName intranet
AuthUserFile /www/passwd/users
Require valid-user
Order allow,deny
Allow from internal.com
Satisfy any

More info in the Apache wiki.

phoebus
  • 8,380
  • 1
  • 31
  • 30
zhenech
  • 1,492
  • 9
  • 13