LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-17-2006, 09:12 AM   #1
bowie101
Member
 
Registered: Nov 2005
Distribution: FC4 & RHES
Posts: 105

Rep: Reputation: 15
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
 
Old 01-17-2006, 09:38 AM   #2
muha
Member
 
Registered: Nov 2005
Distribution: xubuntu, grml
Posts: 451

Rep: Reputation: 37
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.
 
Old 01-17-2006, 10:33 AM   #3
bowie101
Member
 
Registered: Nov 2005
Distribution: FC4 & RHES
Posts: 105

Original Poster
Rep: Reputation: 15
not quite clear on this. plus, it's not apache 2, as you can see. what should I do?
 
Old 01-17-2006, 01:06 PM   #4
bowie101
Member
 
Registered: Nov 2005
Distribution: FC4 & RHES
Posts: 105

Original Poster
Rep: Reputation: 15
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
 
Old 01-17-2006, 02:04 PM   #5
phil.d.g
Senior Member
 
Registered: Oct 2004
Posts: 1,192

Rep: Reputation: 101Reputation: 101
/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
 
Old 01-17-2006, 02:09 PM   #6
bowie101
Member
 
Registered: Nov 2005
Distribution: FC4 & RHES
Posts: 105

Original Poster
Rep: Reputation: 15
ok, and at the risk of sounding completely new, , where are the init scripts to examine?
 
Old 01-17-2006, 02:29 PM   #7
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,125

Rep: Reputation: 164Reputation: 164
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.
 
Old 01-17-2006, 02:36 PM   #8
phil.d.g
Senior Member
 
Registered: Oct 2004
Posts: 1,192

Rep: Reputation: 101Reputation: 101
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
 
Old 01-17-2006, 02:58 PM   #9
bowie101
Member
 
Registered: Nov 2005
Distribution: FC4 & RHES
Posts: 105

Original Poster
Rep: Reputation: 15
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!

______

Last edited by bowie101; 01-17-2006 at 03:15 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
multiple log files in apache Red Squirrel Linux - Software 1 09-27-2005 01:42 AM
Apache 2 Config Files waynejkruse10 Linux - Software 5 05-24-2005 03:20 PM
Apache config files bcom Linux - Newbie 2 05-21-2004 11:53 AM
apache config files deleted!!! HELP! tris Linux - Software 2 10-11-2003 07:09 PM
Apache Config Files mikeyt_333 Linux - General 1 01-18-2002 04:32 AM


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

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration