I've always struggled to find this: How can you ask apache which httpd.conf file it used to load up?

It becomes difficult when you have a number of instances of apache running, or if you haven't looked at the machine for a long time, and there are a lot of httpd.conf file on disk!

Thanks a lot :)

link|improve this question
That's it! Thank you so much. There's so much more great info in the -V option as well! Cheers. – Ali May 27 '09 at 18:54
feedback

1 Answer

apache2ctl -V | grep SERVER_CONFIG_FILE
link|improve this answer
Bingo. Please note that the binary might be called apachectl for different distributions or operating systems. Also grep for HTTPD_ROOT - the value of HTTPD_ROOT prepended to SERVER_CONFIG_FILE will give you the full path to the config file. – Mihai Limbăşan May 27 '09 at 15:13
In my case it's: -D HTTPD_ROOT="/srv/www" -D SERVER_CONFIG_FILE="/etc/apache2/httpd.conf" – vartec May 27 '09 at 15:26
feedback

Your Answer

 
or
required, but never shown