- Feb 25, 2011
- 16,978
- 1,614
- 126
Apache2 2.4.29 on Ubuntu 18.04.
I've got two Virtual Hosts (server1.localdomain and server2.localdomain) configured on a Ubuntu system w/ IP x.x.x.x. They work as expected.
However, when I navigate (web browser) to the x.x.x.x IP, instead of an error or the generic Apache landing page, I get the content from server1.localdomain. I want an error or landing page instead.
I tried adding a nonsense DNS entry (farts.localdomain) to my hosts file, for the x.x.x.x IP. When I try navigating to farts, I still get content from server1.localdomain. This is super-weird, since the ServerName definitely doesn't match the request header.
I tried creating a third VirtualHost entry with no ServerName directive, and a documentroot of /var/www/html/. When I navigate to the x.x.x.x address, I get to the apache landing page, but when I navigate to farts.localdomain, I still end up getting served the server1.localdomain content.
Is there a way to make Apache not send me to a place unless I specifically want to go there?
I've got two Virtual Hosts (server1.localdomain and server2.localdomain) configured on a Ubuntu system w/ IP x.x.x.x. They work as expected.
However, when I navigate (web browser) to the x.x.x.x IP, instead of an error or the generic Apache landing page, I get the content from server1.localdomain. I want an error or landing page instead.
I tried adding a nonsense DNS entry (farts.localdomain) to my hosts file, for the x.x.x.x IP. When I try navigating to farts, I still get content from server1.localdomain. This is super-weird, since the ServerName definitely doesn't match the request header.
I tried creating a third VirtualHost entry with no ServerName directive, and a documentroot of /var/www/html/. When I navigate to the x.x.x.x address, I get to the apache landing page, but when I navigate to farts.localdomain, I still end up getting served the server1.localdomain content.
Is there a way to make Apache not send me to a place unless I specifically want to go there?