2

I have a few virtualhosts on my localhost apache, here's the config of one (the others just change the letters before .localhost)

<VirtualHost *:80>
    ServerAdmin admin@dev.localhost
    ServerName dev.localhost
    ServerAlias dev.localhost
    DocumentRoot /var/www/dev
    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

It doesn't work on Chrome. Works on other browsers and works when I type this on terminal

sudo wget dev.localhost

When I access the virtualhost on Chrome, I get the error ERR_NAME_NOT_RESOLVED and if I'm not connected to the internet, I get ERR_INTERNET_DISCONNECTED (I think that's not supposed to happen once it's localhost)

I also tried to access the virtualhost with Chrome Private Mode (CTRL+SHIFT+N) and accessing like this I get the DNS_PROBE_FINISHED_NXDOMAIN error.

Tried to disable all my extensions too.

Everything I just said, it's only for virtualhosts because when I access localhost or any folder inside that, works fine.

This is my /etc/hosts file

127.0.0.1   localhost
127.0.1.1   Henrique-Note
127.0.0.1   bobbabr.localhost
127.0.0.1   art.localhost
127.0.0.1   id.localhost
127.0.0.1   artweb.localhost
127.0.0.1   pontoagua.localhost
127.0.0.1   ibobba.localhost
127.0.0.1   fnxhenry.localhost
127.0.0.1   pipoca.localhost
127.0.0.1   popbr.localhost
127.0.0.1   gentil.localhost
127.0.0.1   structure.localhost
127.0.0.1   thehits.localhost
127.0.0.1   dev.localhost

# The following lines are desirable for IPv6 capable hosts
::1             localhost
::1     ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters

How can I fix this and access virtualhost on Chrome?

Chrome version: 43.0.2357.18 beta (64-bit)

OS: Elementary OS Freya, which is based on Ubuntu 14.04

Apache/2.4.7

Henrique Arthur
  • 123
  • 1
  • 1
  • 4

1 Answers1

2

Do you have a non-beta Chrome version you could try just in case it's a bug with Chrome?

Another thing you could try is to code those hostnames and configure the VirtualHosts to access the IP address of your machine instead of 127.0.0.1, even though in theory using 127.0.0.1 should be legitimate.

g491
  • 973
  • 5
  • 7
  • 1
    I installed Chrome stable and it's working now. But why virtualhosts can't be accessed on this beta? I tried to search Chromium for something like that but found nothing. – Henrique Arthur Apr 20 '15 at 17:54