Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I installed a fresh TurnKey LAMP VM (Ubuntu, Apache2, PHP 5.2, the usual) in VirtualBox (latest). I configured networking so it has an IP of on the bridged network. Then I logged into Webmin from the host machine at fine. In Webmin I set up an Apache2 virtual host with the ServerName foo.local and set up a PHP app in the configured directory. Then I added the line foo.local to /etc/hosts.

Now back in my host machine--Windows 7--I edited my C:/windows/system32/drivers/etc/hosts file and added the line foo.local. Now, from Windows I can ssh jordan@foo.local just fine, and when I lynx http://foo.local/ from the VM it loads home page of the virtual host perfectly, and the app works perfectly.

But when I open a browser on the Windows host and navigate to http://foo.local/ I get unexpected results: In IE8 (not my browser of choice, for the record) when I hit http://foo.local/ it takes me to the VM's Webmin home page, i.e. the same thing as if I went to on the host machine. In Chrome, however, I just get redirected to http://localhost/--i.e. Windows' localhost, which doesn't have a web server configured, so error.

Can anybody help me resolve this? I've tried every combination of configurations on both the host and in the VM that I can think of and it's driving me batty. Thanks in advance.

share|improve this question

Have you tried restarting chrome to ensure it has picked up the modified hosts file?

Another option is:

  • Go to the Wrench icon
  • Options
  • Under the Hood
  • Clear browsing data
  • Turn off all check boxes other than Empty the cache.
  • Click Clear browsing data
share|improve this answer
Thanks. I have done all of those things with no success. – Jordan Sep 1 '10 at 4:16

Make sure you have NameVirtualHost *:80 in your Apache config file, I know CentOS/RHEL have it commented out by default.

share|improve this answer
up vote 0 down vote accepted

I somehow finally resolved this. Like I said, tried every configuration I could think of, but in the end it was changing <VirtualHost foo.local:80> in foo.local.conf to <VirtualHost *:80>.

I still don't know why Chrome is misbehaving--some sort of caching issue, probably--but it's working in at least one browser on the host machine, so I'm happy.

share|improve this answer
Ah yes it should be <VirtualHost *:80> and then ServerName foo.local within the <VirtualHost> block. Sorry I assumed that was already that way :) – Geraint Jones Sep 1 '10 at 4:36
*:80 tells apache to do Name Based Vhosting - the other option is IP Based Vhosting and by having foo.local set to in your servers hosts file that would have become <VirtualHost> which is an IP Based VHost. That is why it was working on the server but not over the network. – Geraint Jones Sep 1 '10 at 4:39
Thanks for the clarification, c10k. Probably I should have posted the .conf file for good measure; I'm not sure if it was Webmin's mistake or my own, but it doesn't much matter anymore. – Jordan Sep 1 '10 at 5:20

Your Answer


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.