I have ISPConfig set up at a VPS at IP address 1.2.3.4. On that ISPConfig installation I have configures one site called example.no. Now when I visit example.no in the browser, it's correctly displaying the folder /var/www/example.no/web
.
The issue is: When I visit http://1.2.3.4 it's also displaying /var/www/example.no/web
. That's not supposed to happen, is it? What could possibly be the reason?
To sum up: 1.2.3.4 is a VPS with ISPConfig installed. It has Apache, FTP software, DNS software, courier etc. installed and ISPConfig is handling them all. When I visit the domain name of a site hosted on that server, I expect to be taken to the correct folder on that server, which I am. But when I visit the IP address of the server, I expect nothing to happen. Instead it displays the only site configured at the moment.
When a
Host:
header matching no configured sites is encountered by Apache on a port using name-based virtual hosting, it serves the request from the firstVirtualHost
block that was loaded on that port.If you want to prevent the behavior that you're observing, set up a
VirtualHost
that loads before your real one, which has a bogusServerName
and doesn't serve your site.