Add to vhost:
AllowOverride AuthConfig
Create password:
# htpasswd -c /usr/local/apache/passwd/passwords nasso
Add to vhost or .htaccess.
AuthType Basic
AuthName "Restricted Files"
# (Following line optional)
AuthBasicProvider file
AuthUserFile /usr/local/apache/passwd/passwords
Require user username
Add this after the previous lines to make everything awsome:
Order allow,deny
Allow from 192.168.0.0/24
Satisfy any
Satisfy any makes it so that only one of the conditions have to match, either logging in as a user, or coming from the internal network. Now you can login if you are connecting from the internet and if you are connecting from your local LAN, you dont have to supply login credentials. Sweet!


Comments
0 comments postedPost new comment