apache2/httpd – IP based access to a virtual host

The Require provides a variety of different ways to allow or deny access to resources. In conjunction with the RequireAll, RequireAny, and RequireNone directives, these requirements may be combined in arbitrarily complex ways, to enforce whatever your access policy happens to be.

example:

<VirtualHost *:80>

ServerName example.net
Documentroot /var/www/html/

<Location />
      Require ip 192.168.0.0/24  10.0.0.2
</Location>

</VirtualHost>

Leave a Reply

Your email address will not be published. Required fields are marked *