Take the 2-minute tour ×
Server Fault is a question and answer site for professional 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

2 Answers 2

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. –  Krister Andersson Aug 9 '12 at 14:12
    
Might also be httpd -V –  Lotus Oct 9 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 at 12:57

Your Answer

 
discard

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