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