Apache IP based Access


Here are some of the basics of restricting IP based access to directories in Apache i.e. /etc/httpd/conf/httpd.conf. I hope you still remember your RHCE Training.

Now these all 3 setting are the same.

But, this one is different only allows to

Here are some examples for your from /etc/httpd/conf/httpd.conf 

<Directory /var/www/html/networknuts>
Order allow,deny
Allow from # All 10.
Allow from # All 192.168
Allow from 127 # All 127.

Here’s an example that only allows access to .html files
and nothing else for a particular directory.

<Directory “/var/www/html/networknuts/secured”>
Satisfy All
Order allow,deny
Deny from all
<Files *.html>
Order deny,allow
Allow from all
Satisfy Any

GEEKS don’t forget to reload httpd with the following command.

/etc/init.d/httpd reload

Enjoy your Sunday.