Apache http.conf allow intranet

12,943

But let's say you want people from your LAN to have full access, without being prompted for a password. In this scenario we could use:

<Directory /home/www/site1/private>
  AuthUserFile /home/www/site1-passwd
  AuthType Basic
  AuthName MySite
  Require valid-user
  Order allow,deny
  Allow from 172.17.10
  Satisfy any
</Directory>

This will force everyone from the outside to authenticate, but those coming from the LAN IP range would not be required to do so. Apache will let them access the directory without authenticating. You can add other hostnames (local or remote) to the Allow directive to give them access to the directory as well. See the Apache Docs on Allow.

From apache wiki http://wiki.apache.org/httpd/BypassAuthenticationOrAuthorizationRequirements

Share:
12,943

Related videos on Youtube

Admin
Author by

Admin

Updated on September 18, 2022

Comments

  • Admin
    Admin over 1 year

    what would be the correct config to allow only authenticated users and the intranet (without need for a password) in apache? This does not request a password and without the "satisfy any" intranet users are also required to enter a password...

    <Directory "/var/www">
    #   Allow Network Access and/or Basic Auth
    Satisfy any
    
    allow from 192.168
    
    AuthName "Enter passwd!"
    require valid-user
    AuthUserFile /var/.passwd
    AuthType Basic
    allow from all
    order deny,allow
    </Directory>
    
    • Mant101
      Mant101 over 12 years
      This should work, your satisfy any should do the trick: either the IP is 192.168.xxx.xxx or a password is entered.
  • Admin
    Admin over 12 years
    With this I am getting in without any password...
  • Mant101
    Mant101 over 12 years
    Well, are you on 192.168? Then that was the point, no? And end it with a deny all.
  • juiz
    juiz over 12 years
    No, I tried it from my cell phone. Sry for the account mix up. -Magreet