httpd.conf location

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.

9 Responses to “httpd.conf location”

  1. Martin Says:

    Thanks. Saved me some source code surfing ;)

  2. Tim Says:

    Thanks tons! This really helped me out.

    tc

  3. How to Install WordPress on Mac OS X (Leopard) :: Software Says:

    […] httpd.conf location « splintor’s blog […]

  4. How to Install WordPress on Mac OS X (Leopard) Says:

    […] httpd.conf location « splintor’s blog […]

  5. LiewCF Says:

    thanks for the tip. :)

  6. EFFOTHFAH Says:

    treba zkontrolovat:)

  7. wrangleraz Says:

    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.

  8. Joe Says:

    Great! Thanks. This has been plagued by for a long time.

  9. Carlos Says:

    thanks

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


%d bloggers like this: