Archive for the ‘apache’ Category

httpd.conf location

March 6, 2007

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.