How To Create A Blank Root For Apache Virtual Host?
If you don’t want Apache to serve the first Virtual Host when you get a request for the server IP. (because that is what is supposed to happen).
If someone or somebot is attempting to see what is at the ip address, you can serve a blank page instead as follows:
Insert this VirtualHost at the top of the list/page.
VirtualHost *:80 ServerName server-ip ServerAlias server-ip ErrorLog /var/log/apache2/error.log CustomLog /var/log/apache2/access.log combined DocumentRoot /var/www/html /VirtualHost
create a blank index.html in the directory
chmod 644 index.html
create .htaccess as well
IfModule mod_rewrite.c RewriteEngine On Options -Indexes /IfModule
chmod 440 .htaccess
systemctl restart apache2