How does one properly unregister
httpd from launching at reboot following a
sudo wfsctl start and subsequent
sudo wfsctl stop?
wfsctl is a "WebDAV File Sharing control utility" released with macOS High Sierra.
wfsctl is located at
In my case, after an initial install of macOS High Sierra, the Apache
httpd daemon is not initially serving content. (This was expected.) The observation that httpd was not serving could observed in various ways, including:
localhostinto a web browser on the same machine
curl localhostin the terminal on the same machine.
curl localhost # curl: (7) Failed to connect to localhost port 80: Connection refused
wfsctl WebDAV services are started for the first time, then
httpd is also started.
sudo wfsctl start # ... sudo wfsctl diagnose # ... snip ... # All httpd processes: # COMM RUSER PPID PID STARTED # httpd root 1 885 4:18PM # httpd _www 885 890 4:18PM
It was not surprising that an Apache
httpd was started. Although, the baseline Apache
httpd configuration also start serviing the contents of /Library/WebServer/Documents in addition to and separate from any WebDAV shares. In particular,
index.html content is returned via either
localhost in a web browser or
curl localhost in the Terminal application.
curl localhost --verbose # * Connected to localhost (::1) port 80 (#0) # > GET / HTTP/1.1 # > Host: localhost # > User-Agent: curl/7.54.0 # > Accept: */* # > # < HTTP/1.1 200 OK # < Server: Apache/2.4.28 (Unix) mod_secure_transport/2.4.27 # < Content-Location: index.html.en # <html><body><h1>It works!</h1></body></html>
Finally, stop the WebDAV services with
sudo wfsctl stop, then reboot. After reboot,
httpd is apparently still running:
# after `sudo wfsctl stop` and system reboot ... curl localhost # <html><body><h1>It works!</h1></body></html> sudo wfsctl status # disabled sudo wfsctl diagnose # ... # WFS is not enabled. # ... # All httpd processes: # COMM RUSER PPID PID STARTED # httpd root 1 85 6:12PM # httpd _www 85 414 6:13PM
Is it a reasonably expected behaviour that
sudo wfsctl stop does not also unregister
wfsctl presumes to not interfere with other services with might be used to start the
httpd web server? (Though, in my use case,
httpd was not enabled via any other means than