Trouble sorting out Apache on the Post-Server Mac
Yes, I know, Apple no longer supports Server for doing anything more than a little profile and device management, and some XSan while nobody's looking. (Who even uses that? Wait, no, wrong question, we're focusing on Apache today.) But vestiges of the old Server app still linger under the hood, and other parts have been brusquely torn out, between them leaving rough edges on the error logs and the fact that some stuff just isn't working as it should.
Apache is still technically running. I can go to http://terrilith.local and call up the index page of the current (degenerate) Server app, though it's come unhooked from PHP; I have an install of dokuwiki that I have crammed a lot of notes into, and all I get is a single page of php script instead of the stuff I need. (I have another way to browse those pages, but it's suboptimal to put it mildly.)
Then I start poking around under the hood, and things get weird.
Through terminal I enter
which httpd
...and it tells me
/usr/sbin/httpd
Likewise if I ask terminal
which apachectl
...it tells me
/usr/sbin/apachectl
All well and good. And if I enter
httpd -V
(with the capital V, so it gives me the details of its construction) it tells me
Server version: Apache/2.4.34 (Unix)
Server built: Aug 17 2018 16:29:43
Server's Module Magic Number: 20120211:79
Server loaded: APR 1.5.2, APR-UTIL 1.5.4
Compiled using: APR 1.5.2, APR-UTIL 1.5.4
Architecture: 64-bit
Server MPM: prefork
threaded: no
forked: yes (variable process count)
Server compiled with....
-D APR_HAS_SENDFILE
-D APR_HAS_MMAP
-D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
-D APR_USE_FLOCK_SERIALIZE
-D APR_USE_PTHREAD_SERIALIZE
-D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
-D APR_HAS_OTHER_CHILD
-D AP_HAVE_RELIABLE_PIPED_LOGS
-D DYNAMIC_MODULE_LIMIT=256
-D HTTPD_ROOT="/usr"
-D SUEXEC_BIN="/usr/bin/suexec"
-D DEFAULT_PIDLOG="/private/var/run/httpd.pid"
-D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
-D DEFAULT_ERRORLOG="logs/error_log"
-D AP_TYPES_CONFIG_FILE="/private/etc/apache2/mime.types"
-D SERVER_CONFIG_FILE="/private/etc/apache2/httpd.conf"
Good stuff, that. It tells me where the configuration file for the web server is.
Or does it??
Looking into the file /private/etc/apache2/httpd.conf reveals the main directive
DocumentRoot "/Library/WebServer/Documents"
...meaning that's where the web server should be pulling the pages it shows. But when I call up the error log after pulling up a page it can't find (say, the link to the wiki install I just removed for this purpose), I get
File does not exist: /Library/Server/Web/Data/Sites/Default/doku/
That's the folder the Server stored those pages in when Server was still providing the wrapper for the Apache web service.
Additionally, if in the terminal I try
httpd -t
(to check the syntax of the config files), I get the notifications:
[Sun Nov 18 10:07:17.291468 2018] [core:warn] [pid 83214] AH00111: Config variable ${WFS_SERVER_ADDR} is not defined
[Sun Nov 18 10:07:17.291536 2018] [core:warn] [pid 83214] AH00111: Config variable ${WFS_SERVER_PORT} is not defined
[Sun Nov 18 10:07:17.291544 2018] [core:warn] [pid 83214] AH00111: Config variable ${WFS_SERVER_ADDR} is not defined
[Sun Nov 18 10:07:17.291547 2018] [core:warn] [pid 83214] AH00111: Config variable ${WFS_SERVER_PORT} is not defined
[Sun Nov 18 10:07:17.296866 2018] [core:warn] [pid 83214] AH00111: Config variable ${WFS_SERVER_NAME} is not defined
[Sun Nov 18 10:07:17.296881 2018] [core:warn] [pid 83214] AH00111: Config variable ${WFS_SERVER_PORT} is not defined
[Sun Nov 18 10:07:17.297756 2018] [core:warn] [pid 83214] AH00111: Config variable ${WFS_ACCESS_GROUP} is not defined
[Sun Nov 18 10:07:17.297771 2018] [core:warn] [pid 83214] AH00111: Config variable ${WFS_SERVER_NAME} is not defined
AH00526: Syntax error on line 25 of /private/etc/apache2/other/httpd_webdavsharing.conf:
Port must be specified
And even wilder, if I try
sudo apachectl stop
it doesn't anything's wrong, but it doesn't say anything's right either since I can still pull up that useless MacOS Server landing page. Frankly, I'm not sure if that's "irony" or "adding insult to injury."
If I had to interpret what I've seen so far, it looks like there are two Apache installs on this computer, and the one I'm trying to configure has nothing to do with what's actually serving up pages.
Can anyone suggest how to untangle this mess short of deleting the Server app which I no longer need and reinstalling the OS?
MacBook Pro TouchBar and Touch ID, macOS Mojave (10.14.1), Terrilith