Take the 2-minute tour ×

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
add comment

2 Answers

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
add comment

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
add comment

Your Answer


