linux poison RSS
linux poison Email

Apache - limit access to certain directories based on IP address

You can do this completely from /etc/httpd/conf/httpd.conf which are shown below for multiple IP addresses. Note that all 3 setting are the same.

10.0.0.0/255.0.0.0
10.0.0.0/8
10

However, the following is different

10.0.0.0/24 only allows 10.0.0.1 to 10.0.0.254

Some complete settings in /etc/httpd/conf/httpd.conf

Order allow,deny
Allow from 10.0.0.0/8 # All 10.
Allow from 192.168.0.0/16 # All 192.168
Allow from 127 # All 127.

Don’t forget to reload httpd with the following command.

$ /etc/init.d/httpd reload


0 comments:

Post a Comment

Related Posts with Thumbnails