Find where DocumentRoot is set in all apache2 config files

apache-2.2Apache2

I'm working on a OSX server running apache 2.2 that someone else setup. Somehow they changed the root web server directory. However, I've searched through all the config files in /etc/apache2/ and all I see is the default:
DocumentRoot "/Library/WebServer/Documents" in httpd.conf.

I've grep'd for Include statements in httpd.conf and they're just the normal ones in the same config folder. I've grep'd those .config files as well and nothing changes the DocumentRoot. But somehow the server isn't loading from Library/WebServer/Documents`.

These config files are being used because when I add syntax errors, the server won't start. Is there a higher-level config file that I should be looking at?

I'm far from an apache guru, but I don't know what else to try. Is there any way to search all included config files for where the DocumentRoot is being set? Is there another way to set the default web directory that I'm missing?

Best Answer

You can see default ServerRoot with this command:

httpd -V

Assume httpd is your apache httpd main binary, in some distros it is named apache2 or similar, just look for it.

If still you are confused and do not want to be looking around all the files, you could just load mod_info and its handler in a specific location and will see all values specified.

Also note, httpd docs for 2.2 say the default documentroot is: "Default: DocumentRoot /usr/local/apache/htdocs" this may be changed when compiling httpd from scratch though. (--docdir= option in configure script)