Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

share|improve this question
add comment

1 Answer

up vote 0 down vote accepted

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 first VirtualHost 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 bogus ServerName and doesn't serve your site.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.