I've discovered by accident that my Mac is running a localhost web server. I typed "localhost" into Safari and got "It works!" I get the same result when I go to http://127.0.0.1:80
.
My question is: How do I turn this thing off? I've tried things like this:
$ sudo apachectl stop
And
$ sudo launchctl unload -w /System/Library/LaunchDaemons/org.apache.httpd.plist
But this changes nothing, and the Terminal complains
/System/Library/LaunchDaemons/org.apache.httpd.plist: Could not find specified service
I'm running Catalina. No MAMP. I did at one point a couple of years ago run npm
briefly, but there is no evidence that this is its server (for one thing, it's on port 80).
Following up on Gordon Davisson's suggestion, I tried
$ sudo lsof -i | grep LISTEN
and got:
rapportd 462 mattneubelcap 4u IPv4 0x3fcd6c7f11a6984d 0t0 TCP *:49169 (LISTEN)
rapportd 462 mattneubelcap 5u IPv6 0x3fcd6c7f0a82c41d 0t0 TCP *:49169 (LISTEN)
cupsd 1117 root 5u IPv6 0x3fcd6c7f0a829f5d 0t0 TCP localhost:ipp (LISTEN)
cupsd 1117 root 6u IPv4 0x3fcd6c7f1975f0cd 0t0 TCP localhost:ipp (LISTEN)
sudo lsof -i :80 | grep LISTEN
, then try searching the active launch daemons for the master process's PID withsudo launchctl list | grep <masterPID>
. See this Q&A for an example.