I'm using VirtualBox on my Windows 8.1 pc to host a Ubuntu Server 14.04 guest that runs Apache as a development web server.
I'm using Bridged Adapter in VirtualBox.
I have a few vhost on Apache and I can access all of them using Firefox or IE from the host. But I can't access it using Chrome.
Chrome gives me the following:
ERR_CONNECTION_REFUSED
Google Chrome's connection attempt to cooksfromhome.localhost was
rejected. The website may be down, or your network may not be
properly configured.
[...]
From what I understand, my Apache config should be okay because I can access it without problem with Firefox and IE... It looks as if Chrome can access my VirtualBox, but Apache refuses the connection... Any idea why I have this problem and what can I do to fix it?
Thanks!
Try this:
Go to the LAN settings (in Chrome: Tools → Options → Under the hood → Change Proxy setting → LAN Setting)
Tick the checkbox "Bypass proxy server for local address"
I finally found the solution.
Chrome ignores all entries in the host file that tries to send any website with .localhost to an IP that is not the computer's local address. (https://code.google.com/p/chromium/issues/detail?id=489973)
So I modified my Apache vhost in my Ubuntu VirtualBox from
to
(And I modified my host file accordingly) And now it's working!
Note that the ServerName could be whatever you want, as long as it doesn't end with .localhost.