2017-09-14 76 views
1

安裝並設置了dnsmasq/apache虛擬主機,localhost說:「無法聯繫到此站點」。其次這些教程https://mallinson.ca/osx-web-development/https://mallinson.ca/osx-web-development/localhost/127.0.0.1 - 無法聯繫到此站點

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> 

回答

0

我想你應該加入這行到你的httpd-vhosts.conf

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

添加還是我已在原來的問題在httpd-vhost.conf文件相同。我把這個文件放在〜/ Sites/httpd-vhost.conf文件中,並將它軟鏈接到/ etc/apache2/extra和/ etc/apache2/other – user1952312

+0

似乎有兩個地方使用apache配置/ etc/apache2 /和/ private/etc/apache2,以便將虛擬主機文件添加到 – user1952312

+0

午餐您的APACHE服務器 –