apache2/httpd – IP based restriction 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.


<VirtualHost *:80>

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

<Location />
      Require ip


Leave a Reply

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