Bootstrap FreeKB - Apache (Web Server) - Require ip directive (whitelist)
Apache (Web Server) - Require ip directive (whitelist)

Updated:   |  Apache (Web Server) articles

The Require ip directive in the web servers configuration file (e.g. httpd.conf) can be used so that only certain IP addresses (or subnets) are allowed to access a particular resource. In this example, only IP address 10.14.115.25 would be permitted access .

<Directory />
  Options FollowSymLinks
  AllowOverride None
  Order deny, allow
  Deny from all
  Require all granted
  Require ip 10.14.115.25
</Directory>

 

In this example, any IP address within the 192.168.0.0/24 subnet would be permitted access.

<Directory />
  Options FollowSymLinks
  AllowOverride None
  Order deny, allow
  Deny from all
  Require all granted
  Require ip 192.168.0.0/24
</Directory>

 




Did you find this article helpful?

If so, consider buying me a coffee over at Buy Me A Coffee



Comments


Add a Comment


Please enter 98e969 in the box below so that we can be sure you are a human.