From time to time I find myself having to debug a UNIX machine that runs apache, and I have to figure out where its httpd.conf is located. I usually look around the location of the executable and find it, and I always assumed it is actually somehow set in the appropriate environment variable, but today Shirley, a colleague from QA called me and asked for help in finding the httpd.conf file used by the apache she was running on her AIX test machine.
A quick qoogling told me that unlike what I thought, the apache documentation clearly says that the location of this file is set at compile time, but can be overridden using the –f option. But how can I know what is the location that the server was compiled with?
Reverting to search Google Groups helped me find out that I can use the “httpd -V” command to get the options that the httpd executable was compiled with. One of these options is the SERVER_CONFIG_FILE, which will tell you the exact path of the httpd.conf that this apache server is using by default.
February 29, 2008 at 12:44 pm |
Thanks. Saved me some source code surfing ;)
May 21, 2009 at 1:49 pm |
Thanks tons! This really helped me out.
tc
July 8, 2009 at 11:01 am |
[...] httpd.conf location « splintor’s blog [...]
March 5, 2010 at 1:47 pm |
[...] httpd.conf location « splintor’s blog [...]
April 9, 2010 at 11:41 pm |
thanks for the tip. :)
March 4, 2011 at 6:43 am |
treba zkontrolovat:)
April 6, 2012 at 7:14 pm |
Good article, exactly what I was looking for. I noticed the “exact path” for the configuration file is actually the combination of HTTPD_ROOT + SERVER_CONFIG_FILE.
October 17, 2012 at 5:21 pm |
Great! Thanks. This has been plagued by for a long time.