问题
I'm trying to install the brew package httpd (apache). I'm so confused. Every time I do and navigate to http://localhost:8080 I get a big welcome screen that says "Welcome to Nginx." I don't understand.
Am I running nginx and not apache? How could that be?
I'm on macOS 10.15.6.
I'm running pretty basic commands...
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
And then I get get this...
https://www.dropbox.com/s/yia1yk9uhsootpk/Screen%20Shot%202020-09-18%20at%208.53.39%20PM.png?dl=0
"Welcome to nginx"
What don't I know? A lot probably. If I edit the httpd.conf file to listen to another port, I get the same screen.
╰─ 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
Can anyone shed some light on this for me?
Update:
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)
回答1:
I think I narrowed it down to "groonga." First I'm hearing of it, but apparently it's a mariadb brew dependency. I found where the "welcome to nginx" text was coming from.
var/www/index.html
Not sure why it's hard coding that text if it will also display with apache running. Very confusing. However, it adds that file to the default apache DocumentRoot.
回答2:
Had a similar issue to this, discovered the fact that generic start file at usr/local/var/www/index.html
, had been hard-coded to contain the "Welcome to nginx" when I installed nginx and
the message remained that way even I uninstalled it. The Apache (httpd) service also happens calls that index.html
file upon startup which makes it appear as if it were nginx rendering that file.
Not too sure why nginx doesn't automatically empty the file upon uninstallation but just manually change/remove the contents of that file after uninstalling nginx and your problem should be fixed :)
Similar problem also addressed here: nginx uninstalled, localhost:8080 still showing nginx welcome page
来源:https://stackoverflow.com/questions/63964589/brew-install-httpd-welcome-to-nginx