Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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>


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.

Rather than Google for the answer why don't you read the Apache documentation instead? – John Gardeniers Aug 2 '12 at 11:37
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
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 domain are allowed access; all other hosts are denied access.

Order Deny,Allow
Deny from all
Allow from 

So, your 2nd config is the right one.

share|improve this answer

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