Forum Moderators: phranque

Message Too Old, No Replies

newbie's challenge - which apache httpd.conf is the real deal?

identifying the working httpd.conf file for an apache server

         

bowie101

7:07 pm on Jan 17, 2006 (gmt 0)

10+ Year Member



hi. I'm a newbie, of course, so, I have inherited a linux box with Apache on it. I'm looking for the main httpd.conf file to look at the main information (in particular, the access configuration) for the web site that it houses. I do a find command from the root, and this is what I get:

/opt/apache_build/mod_perl-1.29/t/conf/httpd.conf
/opt/apache_build/mod_perl-1.29/t/httpd.conf
/opt/apache_build/mod_perl-1.29/t/httpd_conf/conf/httpd.conf
/srvrs/apache-1.3.31-ssl/conf/httpd.conf
/usr/local/stuaff-apache/conf/httpd.conf
/etc/httpd/conf/httpd.conf

how do i know which one is the main, functioning one? I can probably rule out the ones under perl, and probably the one in the usr/local/ directory, but maybe i can't. That would leave me with 2 files to guess from. What is the sure-fire way of finding out which httpd.conf file is the real operating deal?

------------------------------------------------

here's another example. another linux/apache box

find the httpd.conf in 2 places :

/home/webuser/local/apache/conf/httpd.conf
/etc/httpd/conf/httpd.conf

which is the real deal and what is the other one for?

thank you, b

zCat

7:53 pm on Jan 17, 2006 (gmt 0)

10+ Year Member



I'd bet it is /etc/httpd/conf/httpd.conf. I would make sure by locating the apachectl used to start the server
(check the root user's command line history, or /etc/init.d). Then I'd rename /etc/httpd/conf/httpd.conf to say /etc/httpd/conf/httpd.conf.1, and perform
apachectl configtest
. If apache was expecting to find the config file you renamed, you'll get an error message (btw this won't affect the running server). Once you've determined the main file, you'll need to check if any further files are included (with the Include directive).

bowie101

8:02 pm on Jan 17, 2006 (gmt 0)

10+ Year Member



ok, but if, after much linux newbie labor, I stumble upon the ps command and type

ps aux ¦ grep apache ¦ grep -v 'grep'

the result i get is: /srvrs/apache-1.3.31-ssl/bin/httpd

a bunch of times.

did that rule out your bet?

zCat

9:00 pm on Jan 17, 2006 (gmt 0)

10+ Year Member



Possibly, that makes it possible that /srvrs/apache-1.3.31-ssl/conf/httpd.conf is being used.

bowie101

9:13 pm on Jan 17, 2006 (gmt 0)

10+ Year Member



ok, so what would rule out one or the other definitively?

zCat

9:18 pm on Jan 17, 2006 (gmt 0)

10+ Year Member



The only way I can think of is as I suggested above with renaming the files and trying apachectl configtest.

bowie101

9:23 pm on Jan 17, 2006 (gmt 0)

10+ Year Member



ok thanks.

hey, why is the PS command not enough? why would it not rule out all possibilities? (assuming the web site is currently running)

zCat

9:46 pm on Jan 17, 2006 (gmt 0)

10+ Year Member



It's possible the server is running with a different configuration file to the one you think...

Just had another, possibly safer idea: look in the various httpd.conf files to see where the server is writing its logs. If the configuration is different, you can look at the log files to see which ones are active. (If they both specify e.g. /var/log/httpd/access_log then that wouldn't be any help).

You could also check the httpd.conf files for which domains they are configured for, that might help determin which file is the "right" one.

bowie101

9:50 pm on Jan 17, 2006 (gmt 0)

10+ Year Member



right-o. thanks!