localhost/127.0.0.1 - This site can’t be reached

3.7k views Asked by At

Installed and setup dnsmasq / apache vhosts, localhost say, "This site can’t be reached". Followed these tutorials https://mallinson.ca/osx-web-development/, https://mallinson.ca/osx-web-development/

NameVirtualHost *:80
UseCanonicalName Off

httpd-vhosts.conf

LogFormat "%V %h %l %u %t "%r" %s %b "%{Referer}i" "%{User-Agent}i"" dynamic_vhosts
CustomLog /var/log/apache2/access_log dynamic_vhosts
<VirtualHost *:80>
  ServerName localhost
  VirtualDocumentRoot /Users/jharri34/Sites/%0

  <Directory "/Users/jharri34/Sites">
    Options Indexes FollowSymLinks MultiViews
    AllowOverride All
    Order allow,deny
    Allow from all
  </Directory>
</VirtualHost>
<VirtualHost *:80>
    ServerName localhost
</VirtualHost>
1

There are 1 answers

3
Salim Ibrohimi On

I think You should add this line into Your httpd-vhosts.conf:

<VirtualHost *:80>
    ServerName localhost
</VirtualHost>