Apache http.conf allow intranet
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
Related videos on Youtube
Admin
Updated on September 18, 2022Comments
-
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 over 12 yearsThis should work, your satisfy any should do the trick: either the IP is 192.168.xxx.xxx or a password is entered.
-
-
Admin over 12 yearsWith this I am getting in without any password...
-
Mant101 over 12 yearsWell, are you on 192.168? Then that was the point, no? And end it with a deny all.
-
juiz over 12 yearsNo, I tried it from my cell phone. Sry for the account mix up. -Magreet