This article explains how to set up non-existent sites and IP addresses to go to a particular site or the default web page instead of the first vhost entry bound to an IP address.
If you have a domain that resolves to an IP address on a server, but doesn't exist on the server, Apache will serve the content for the first site bound to the IP address that the domain resolves to. See more: Secondary shared IP address shows a website
To change the behavior, you need to add a new virtualhost to
/etc/apache2/conf.d/includes/pre_virtualhost_global.conf that will become the first virtualhost.
The easy way to do this is as follows:
1. Navigate to WHM »Service Configuration »Apache Configuration »Include Editor
2. Under Pre VirtualHost Include, select the 2.4.X Apache version
3. Add the virtualhost for the IP address over the webserver ports in the box that opens
4. Click Update
5. Click Restart Apache
Examples of virtualhosts to include:
You can use any Apache directive that works in the VirtualHost context.
If you want the default web page to load on the IP address, add this, replacing the IP in the VirtualHost directive:
suPHP_UserGroup nobody nobody
Do this for each IP on the server if desired.