htaccess auth / allow from ip

Hi

I have the following in my htaccess for password protection:

<Directory "/var/www/html">
AuthType Basic
AuthName "Restricted Files"
AuthUserFile /etc/httpd/conf/access
Require user john
</Directory>

How can I allow access without a password from IP x.x.x.x and y.y.y.y

Thanks
zattzAsked:
Who is Participating?
 
sompol_kiatkamolchaiConnect With a Mentor Commented:
If you want to make restriction for both ip and password, you have to use both mod_access and htaccess
Here is reference for htaccess
http://httpd.apache.org/docs/1.3/howto/htaccess.html#ssi
0
 
sompol_kiatkamolchaiCommented:
Please use mod_access instead, here is reference
http://httpd.apache.org/docs/1.3/mod/mod_access.html
0
 
zattzAuthor Commented:
How do I use that with the password?
0
 
zattzAuthor Commented:
I have tried the following but it dosnt work. It is not asking for the password.

<Directory "/var/www/html">
AuthType Basic
AuthName "Restricted Files"
AuthUserFile /etc/httpd/conf/access
Require user john
Allow from X.X.X.X
Satisfy any
</Directory>
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.