Sign up ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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 :)

share|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

3 Answers 3

apache2ctl -V | grep SERVER_CONFIG_FILE
share|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
This saved my day=) You could also simply try httpd.conf in the case that the SERVER_CONFIG_FILE is named something else: apachectl -V | grep httpd.conf. – Cyclone Aug 9 '12 at 14:12
Might also be httpd -V – Lotus Oct 9 '14 at 19:57

/usr/sbin/apache2 -V provides this info and a little more :)

share|improve this answer
You could improve this answer by providing some example output of that command. – Ladadadada Nov 6 '14 at 12:57

In Yosemite I found it was /Library/Server/Web/Config/apache2/httpd_server_app.conf

Even though apachectl -V | grep .conf

Gives -D SERVER_CONFIG_FILE="/private/etc/apache2/httpd.conf"

share|improve this answer

Your Answer


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