Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

This should be an easy one, but I am seeing conflicting information from google, and would like some clarification. I am trying to block access to a site to all but 1 IP address.

I am adding Allow, Deny and Order directives to the sites-enabled directory. Which of the following is correct?

Order allow, deny
Allow From <ip>

or

Order deny, allow
Deny From all
Allow From <ip>
share|improve this question

closed as not constructive by John Gardeniers, Ward, Scott Pack, HopelessN00b, mgorven Aug 28 '12 at 5:40

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.If this question can be reworded to fit the rules in the help center, please edit the question.

1  
Rather than Google for the answer why don't you read the Apache documentation instead? –  John Gardeniers Aug 2 '12 at 11:37
1  
Instead of posting snarky responses like RTFM or Google it, add a succinct answer so that when people DO Google this question and come here they get more than your snark. –  Scott Dec 12 '13 at 16:30
add comment

1 Answer

up vote 2 down vote accepted

You can easily find an example in apache documentation page.

This is taken from the referenced page:

In the following example, all hosts in the apache.org domain are allowed access; all other hosts are denied access.

Order Deny,Allow
Deny from all
Allow from apache.org 

So, your 2nd config is the right one.

share|improve this answer
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.