Apache 2.4 – allow specific IP

Simple Apache 2.4 configuration to allow a specific IP address to access the sub/domain.

<VirtualHost *:80>
 ServerAdmin [email protected]

 ServerName admin.something.pt
 DocumentRoot /home/webroot/tools/public/

 ErrorLog /home/webroot/tools/logs/error.log
 CustomLog /home/webroot/tools/logs/access.log combined

 <Directory /home/webroot/tools/public/>
 Options Indexes FollowSymLinks MultiViews
 AllowOverride All
 Require ip XXX.XXX.XXX.XXX
 </Directory>
</VirtualHost>

Leave a Reply

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


*