【问题标题】:localhost/127.0.0.1 - This site can’t be reachedlocalhost/127.0.0.1 - 无法访问此站点
【发布时间】:2018-02-23 05:05:21
【问题描述】:

已安装并设置 dnsmasq / apache vhosts,localhost 说“无法访问此站点”。遵循这些教程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>

【问题讨论】:

    标签: macos apache vhosts dnsmasq


    【解决方案1】:

    我认为您应该将此行添加到您的httpd-vhosts.conf

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

    【讨论】:

    • 添加的内容与我在原始问题中添加的 httpd-vhost.conf 文件相同。我将文件放在 ~/Sites/httpd-vhost.conf 中,并将其软链接到 /etc/apache2/extra 和 /etc/apache2/other
    • 似乎有两个地方有 apache config /etc/apache2/ 和 /private/etc/apache2 可以添加 vhost 文件
    • 你午餐你的APACHE服务器
    猜你喜欢
    • 1970-01-01
    • 2016-07-06
    • 2017-04-04
    • 2019-04-02
    • 1970-01-01
    • 2021-04-25
    • 2021-04-09
    • 1970-01-01
    • 2021-12-29
    相关资源
    最近更新 更多