【问题标题】:Apache2 Problems after updating OSX to High Sierra将 OSX 更新到 High Sierra 后的 Apache2 问题
【发布时间】:2018-05-06 14:24:04
【问题描述】:

这周我在 Apache 上遇到了重大问题。更新到 High Sierra 后,我的 Mac 上的开发环境停止工作。我自己尝试了几个小时来解决这个问题,但找不到解决方案。

服务器版本:Apache/2.4.29 (Unix)

基本上发生了什么,每当我尝试重新启动 apache 时,我都会收到以下消息:

AH00558: httpd: Could not reliably determine the server's fully 
qualified domain name, using 10.0.0.50. Set the 'ServerName' directive 
globally to suppress this message

我尝试了很多不同的方式来配置我的 vhosts 文件以及我的 httpd 配置,但都没有看到任何改进。

文档根路径未指向我的网站之前存在的位置。在找到它并将其指向正确的位置后,“它有效!”我每次收到的消息都消失了,现在我只收到一条消息,上面写着

Not Found

The requested URL / was not found on this server.

无论我为 DocumentRoot 部分设置什么路径,都会出现此消息,因此我不确定真正的问题是什么。

另外,我将我的 apache 设置为使用 localhost,但它继续使用 10.0.0.50 作为它的选择 IP。我以前从未见过这个 IP,我对它的来源感到困惑。

TLDR:我在更新到 High Sierra 后遇到了大量的 apache 问题,我尝试卸载/重新安装。 Apache 使用 10.0.0.50 作为 IP,DocumentRoot 好像有问题,config 好像搞砸了。

【问题讨论】:

  • 从 Sierra 升级到 High Sierra 后,我按照这个超级有用的指南让我的“MAMP”环境恢复到工作状态:websitebeaver.com/… 它指导您完成 Apache 配置文件所需的所有行编辑

标签: apache web server dns apache2


【解决方案1】:

检查配置:

httpd -t

AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using 192.168.1.79. Set the 'ServerName' directive globally to suppress this message
Syntax OK

解决这个问题:

sudo vi /etc/apache2/httpd.conf

之前:

ServerName www.example.com:80

之后:

ServerName localhost

再次检查配置:

httpd -t

Syntax OK

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2018-05-08
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-04-02
    • 1970-01-01
    • 1970-01-01
    • 2018-03-08
    相关资源
    最近更新 更多