Friday, April 20, 2012

Apache 2.4: directory IP protection; require, allow, deny

Apache 2.4 

Allow access for all:
<Directory /dir1/dir2>
Require all granted
</Directory>

Allow access from one IP address:
<Directory /dir1/dir2>
Require ip 123.123.123.12
</Directory>

Apache < 2.4

Allow access for all:
<Directory /dir1/dir2>
Order deny,allow
Allow from all
</Directory>

Allow access from one IP address:
<Directory /dir1/dir2>
Order deny,allow
Deny from all
Allow from 123.123.123.12
</Directory>

No comments: