Is there a way to determine the offending file when running https configtest
.
For example, instead of:
Warning: DocumentRoot [/var/www/whatever.com/webroot] does not exist
Warning: DocumentRoot [/var/www/example.com/webroot] does not exist
I could see:
Warning: DocumentRoot [/var/www/whatever.com/webroot] does not exist in /etc/httpd/conf.d/file.conf
Warning: DocumentRoot [/var/www/example.com/webroot] does not exist in /etc/httpd/conf.d/other_file.conf
I reviewed help/man and searched, but could not find an option or equivalent command.
Unfortunately, apachectl does not offer this information.
Your best solution is to simply use
grep
to search the config files for the string shown in the error message.Just to add a little of extra info, the
apachectl
script doesn't do much on its own, just invokes thehttpd
binary with a flag:So this has to be addressed in the core itself.
This is fixed in
apache-2.4
:The relevant code is in
server/config.c
.Based on this tutorial check
/etc/apache2/extra/httpd-vhosts.conf
. This worked on my machine which is OSX 10.13 using Apache 2.4.