Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I wonder, is there any possibility to find which .conf files apache is using at runtime? Some environment variable maybe, as it should work both windows and linux. Or php function?

share|improve this question

If you run

/usr/sbin/apachectl -V

you will see

-D HTTPD_ROOT="/etc/httpd"


-D SERVER_CONFIG_FILE="conf/httpd.conf"

which when combined will tell you the default location for the config file on a unix machine.

There's no apachectl for windows, but this posting indicates something similar might be possible by calling the apache executable directly with the proper arguments.

share|improve this answer
The real problems are Includes as they can be nested, and thus requiring a (potentially infinite) recursive scan to detect the full set of configs that get read in. It's fairly easily scriptable as long as your Includes structure does not create loops: grep through the main httpd.conf, find paths to Includes, grep through that newfound include, keep until grep returns zero results or you're visiting a file that you've visited before. – Marcin Jan 18 '11 at 23:14

At runtime - no way. I would run

strace httpd | grep conf

(replace httpd by the mpm binary you're using, like httpd.worker or just httpd)

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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