【问题标题】:Before update to High Sierra httpd-vhosts.conf is empty在更新到 High Sierra 之前 httpd-vhosts.conf 为空
【发布时间】:2018-06-09 19:10:57
【问题描述】:

我刚刚从 Sierra 升级到 High Sierra。

显然一切正常。但是在本地测试我的作品(PHP 中的 Web 开发等)时,我发现没有任何作品。

检查并寻找错误可能在哪里,我去查看我所有的虚拟主机都很好,我发现虚拟主机文件有超过 10 个配置元素,只有 2 个虚拟-大量测试

更新后的虚拟主机文件内容为:

<VirtualHost *:80>
    ServerAdmin webmaster@dummy-host.example.com
    DocumentRoot "/usr/docs/dummy-host.example.com"
    ServerName dummy-host.example.com
    ServerAlias www.dummy-host.example.com
    ErrorLog "/private/var/log/apache2/dummy-host.example.com-error_log"
    CustomLog "/private/var/log/apache2/dummy-host.example.com-access_log" common
</VirtualHost>

<VirtualHost *:80>
    ServerAdmin webmaster@dummy-host2.example.com
    DocumentRoot "/usr/docs/dummy-host2.example.com"
    ServerName dummy-host2.example.com
    ErrorLog "/private/var/log/apache2/dummy-host2.example.com-error_log"
    CustomLog "/private/var/log/apache2/dummy-host2.example.com-access_log" common
</VirtualHost>

我的虚拟主机文件是:/etc/apache2/extra/httpd-vhosts.conf

我可以通过某种方式恢复该内容吗?我肯定丢失了那些虚拟主机配置吗?

【问题讨论】:

    标签: localhost macos-high-sierra virtual-hosts


    【解决方案1】:

    我不知道我的消息应该是评论还是答案。

    我遇到了同样的问题,但幸运的是更新保留了您的文件。

    我在以下位置找到了我最后一个 httpd 虚拟主机:

    httpd-vhosts.conf~previous
    

    建议去看看

    /etc/apache2/
    

    文件夹也是,也许你以前的

    httpd.conf 
    

    以“~previous”命名备份,您可以恢复它或更改当前的。

    运行:

    sudo apachectl --test
    

    检查是否一切正常。

    【讨论】:

      猜你喜欢
      • 2018-08-14
      • 2019-01-07
      • 2014-02-15
      • 2018-05-06
      • 1970-01-01
      • 2021-09-21
      • 2018-03-08
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多