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?

  • 1
    A number of settings can also be set from the commandline from with Apache httpd gets started such as -d directory to specify an alternate initial ServerRoot
    – HBruijn
    Jun 27, 2017 at 4:40
  • So that's set from httpd, not apachectl? That might be the explanation then...
    – thomas88wp
    Jun 27, 2017 at 4:59

1 Answer 1


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)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.