Home ยป Block IP go to default page in Apache

Block IP go to default page in Apache

0 comment 227 views

Edit or create a default vhost and put this inside:

<VirtualHost *:80>
    ServerName xxx.xxx.xxx.xxx
    Redirect 403 /
    DocumentRoot /var/www/html
</VirtualHost>

xxx.xxx.xxx.xxx is your server ip address

After that restart your apache

sudo a2ensite your-vhost.conf
sudo systemctl restart apache2

Leave a Comment