Brew 安装 Httpd:欢迎使用 Nginx?

Brew Install Httpd: Welcome to Nginx?

我正在尝试安装 brew 包 httpd (apache)。我很困惑。每次我这样做并导航到 http://localhost:8080 时,我都会看到一个很大的欢迎屏幕,上面写着“欢迎使用 Nginx”。没看懂。

我是 运行 nginx 而不是 apache?怎么可能?

我使用的是 macOS 10.15.6。

我 运行 非常基本的命令...

brew install openldap libiconv
sudo apachectl stop
sudo launchctl unload -w /System/Library/LaunchDaemons/org.apache.httpd.plist 2>/dev/null
brew install httpd
sudo brew services start httpd

然后我得到这个...
https://www.dropbox.com/s/yia1yk9uhsootpk/Screen%20Shot%202020-09-18%20at%208.53.39%20PM.png?dl=0
“欢迎使用 nginx”

我不知道什么?可能很多。如果我编辑 httpd.conf 文件以监听另一个端口,我会得到相同的屏幕。

╰─ brew list                                                                            
apr     gettext     jemalloc    libidn2     node        powerlevel9k
apr-util    httpd       libev       libunistring    openldap    wget
brotli      icu4c       libevent    ncurses     openssl@1.1 zsh
c-ares      jansson     libiconv    nghttp2     pcre        zsh-completions

有谁能帮我解释一下吗?

更新:

lsof -i :8080
COMMAND    PID  USER   FD   TYPE             DEVICE SIZE/OFF NODE NAME
Brave\x20 1225 user   35u  IPv6 0xcdbe6ccead8e5deb      0t0  TCP localhost:53261->localhost:http-alt (CLOSE_WAIT)

我想我把范围缩小到了“groonga”。首先我听说过它,但显然它是 mariadb brew 依赖项。我找到了“欢迎使用 nginx”文本的来源。

var/www/index.html

不知道为什么要对文本进行硬编码,如果它也可以用 apache 显示 运行。非常混乱。但是,它将该文件添加到默认的 apache DocumentRoot。

有一个类似的问题,发现 usr/local/var/www/index.html 的通用启动文件 hard-coded 在我安装 nginx 时包含“欢迎使用 nginx” 即使我卸载了它,消息仍然如此。 Apache (httpd) 服务也会在启动时调用 index.html 文件,这使得它看起来好像是 nginx 渲染该文件。

不太清楚为什么 nginx 在卸载时不会自动清空文件,而是在卸载 nginx 后手动 change/remove 该文件的内容,您的问题应该已解决:)

这里也解决了类似的问题:nginx uninstalled, localhost:8080 still showing nginx welcome page