LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   multiple apache config files (https://www.linuxquestions.org/questions/linux-newbie-8/multiple-apache-config-files-404434/)

bowie101 01-17-2006 08:12 AM

multiple apache config files
 
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?

thank you, b

muha 01-17-2006 08:38 AM

For apache2 i see it's like:

Code:

$ cat /etc/sysconfig/apache2
<SNIP>
## Type:        string
## Default:    ""
## ServiceRestart: apache2
#
# Which config file do you want to use?
# (if not set, /etc/apache2/httpd.conf is used.)
# It is unusual to need to use this setting.
#
APACHE_HTTPD_CONF=""
<SNIP>

So this is the script that defines where HTTPD_CONF lives, which is /etc/apache2/httpd.conf by default.
If you want to be reallly sure, you could edit /etc/apache2/httpd.conf so it restricts access to anywhere
(save a backup beforehand) and than see that it works. Restore the backup version.

bowie101 01-17-2006 09:33 AM

not quite clear on this. plus, it's not apache 2, as you can see. what should I do?

bowie101 01-17-2006 12:06 PM

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 one is for the working server, and what is the other one for?

i know this is a basic question, and that's why I'm a newbie asking under newbie forum.

thnx, b

phil.d.g 01-17-2006 01:04 PM

/etc/httpd/conf/httpd.conf will be for the apache that came bundled with the distribution, the others may be backups of the configuration file or maybe where the previous admin compiled apache locally.

Examine the init scripts and find out the location of the httpd deamon that is started, if it is in /usr/bin then most likely /etc/httpd/conf/httpd.conf is the configuration file you want, if it is in /home/webuser/local/apache/bin then /home/webuser/local/apache/conf/httpd.conf is most likely the configuration file you want

bowie101 01-17-2006 01:09 PM

ok, and at the risk of sounding completely new, , where are the init scripts to examine?

gilead 01-17-2006 01:29 PM

There are a few things which might identify which instance it is.

Have a look in the httpd.conf files and see where they log data. Then access one of the web pages and see which log is altered.

You could also try:

Code:

ps aux | grep apache | grep -v 'grep'
This should show which executable is running. The httpd.conf file will be stored near the running executable.

You can also grep for instances of the full path/name of the running executable in your startup scripts.

phil.d.g 01-17-2006 01:36 PM

For Fedora Core I think they are in /etc/init.d or maybe /etc/rc.d/init.d, somewhere like that

the code snippet by gilead, is easier and should give you a full path to the location of the httpd deamon

bowie101 01-17-2006 01:58 PM

ok, after typing in the ps aux ... command,

on the first box, I got:

/srvrs/apache-1.3.31-ssl/bin/httpd


on the second box, I got :

/usr/sbin/httpd
but if the config files are in either
/home/webuser/local/apache/conf/httpd.conf or
/etc/httpd/conf/httpd.conf ,


I'm just going to look at them both and see which one has

/usr/sbin/httpd as the serverRoot, right?

Thanks much!

______


All times are GMT -5. The time now is 06:56 PM.