?
Solved

htaccess auth / allow from ip

Posted on 2009-12-25
5
Medium Priority
?
259 Views
Last Modified: 2012-05-08
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
0
Comment
Question by:zattz
  • 3
  • 2
5 Comments
 
LVL 11

Expert Comment

by:sompol_kiatkamolchai
ID: 26121886
Please use mod_access instead, here is reference
http://httpd.apache.org/docs/1.3/mod/mod_access.html
0
 

Author Comment

by:zattz
ID: 26121903
How do I use that with the password?
0
 
LVL 11

Accepted Solution

by:
sompol_kiatkamolchai earned 2000 total points
ID: 26121906
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
 

Author Comment

by:zattz
ID: 26121915
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

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

​Being a Managed Services Provider (MSP) has presented you  with challenges in the past— and by meeting those challenges you’ve reaped the rewards of success.  In 2014, challenges and rewards remain; but as the Internet and business environment evol…
BIND is the most widely used Name Server. A Name Server is the one that translates a site name to it's IP address. There is a new bug in BIND (https://kb.isc.org/article/AA-01272), affecting all versions of BIND 9 from BIND 9.1.0 (inclusive) thro…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
Suggested Courses
Course of the Month15 days, 12 hours left to enroll

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question