LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 03-08-2008, 07:54 AM   #1
uncle-c
Member
 
Registered: Oct 2006
Location: The Ether
Distribution: Ubuntu 16.04.7 LTS, Kali, MX Linux with i3WM
Posts: 299

Rep: Reputation: 30
apache2 - which conf file to use ?


Hello,
I'm using Ubuntu 7.04 server which comes with apache2. I done some directory surfring and found that there are two .conf files : apache2.conf and httpd.conf. I want to add the directives ServerName and DocumentRoot but into which of the conf files should I place the two directives ???

Thanks !

UC
 
Old 03-08-2008, 08:07 AM   #2
reddazz
LQ Guru
 
Registered: Nov 2003
Location: N. E. England
Distribution: Fedora, CentOS, Debian
Posts: 16,298

Rep: Reputation: 77
Most likely you want httpd.conf (thats the standard on most Linux distros and the BSDs).
 
Old 03-08-2008, 08:21 AM   #3
uncle-c
Member
 
Registered: Oct 2006
Location: The Ether
Distribution: Ubuntu 16.04.7 LTS, Kali, MX Linux with i3WM
Posts: 299

Original Poster
Rep: Reputation: 30
Thanks reddazz. The httpd.conf file is empty ( 0Kb) whereas the apache2.conf ( 21Kb) contains all the other directives which are usually associated with the httpd.conf file, hence, the confusion.
 
Old 03-08-2008, 08:30 AM   #4
reddazz
LQ Guru
 
Registered: Nov 2003
Location: N. E. England
Distribution: Fedora, CentOS, Debian
Posts: 16,298

Rep: Reputation: 77
It could be one of those things that Ubuntu has decided to do differently. Is httpd.conf a symlink to apache2.conf? Try making your changes in apache2.conf and see if they work.
 
Old 03-08-2008, 08:42 AM   #5
uncle-c
Member
 
Registered: Oct 2006
Location: The Ether
Distribution: Ubuntu 16.04.7 LTS, Kali, MX Linux with i3WM
Posts: 299

Original Poster
Rep: Reputation: 30
They are not symlinked but I can put the directive ServerName in either of the two files and everything seems to work ok. I'm just intrigued and curious.

Edit: Just been doing a bit of reading around. Apparently in Ubuntu/ Debian the httpd.conf file is now redundant and apache2.conf is where all the action is.

Last edited by uncle-c; 03-08-2008 at 08:47 AM. Reason: additional material.
 
Old 03-08-2008, 10:07 AM   #6
reddazz
LQ Guru
 
Registered: Nov 2003
Location: N. E. England
Distribution: Fedora, CentOS, Debian
Posts: 16,298

Rep: Reputation: 77
Quote:
Edit: Just been doing a bit of reading around. Apparently in Ubuntu/ Debian the httpd.conf file is now redundant and apache2.conf is where all the action is.
This is one of those things that annoys me about some Linux distros. Everyone else has standardised on httpd.conf and they move away from that.
 
Old 07-23-2009, 02:48 PM   #7
the_guv
LQ Newbie
 
Registered: Jul 2009
Location: valencia & london
Distribution: jaunty desktop & heron server
Posts: 8

Rep: Reputation: 2
there's a cascade of importance ..

anything you add to the httpd.conf overides apache2.conf. and anything in your vhost files takes precedence over both.

Last edited by the_guv; 07-23-2009 at 02:50 PM.
 
1 members found this post helpful.
Old 07-23-2009, 09:36 PM   #8
sokha
Member
 
Registered: Sep 2008
Posts: 46

Rep: Reputation: 15
I think for ubuntu and debian, they use apache2.conf. And httpd.conf is in centos.
 
Old 07-24-2009, 03:29 AM   #9
the_guv
LQ Newbie
 
Registered: Jul 2009
Location: valencia & london
Distribution: jaunty desktop & heron server
Posts: 8

Rep: Reputation: 2
Quote:
Originally Posted by sokha View Post
I think for ubuntu and debian, they use apache2.conf. And httpd.conf is in centos.
Well, for Ubuntu and Debian - at least when installed with LAMP via tasksel - there is ah httpd.conf, but it's blank on install, and I guess used for supplementary commands.

Sure, you could ignore it and just use the apache2.conf, or vhost files.
 
1 members found this post helpful.
Old 05-04-2012, 09:03 AM   #10
Jinojosep
LQ Newbie
 
Registered: May 2012
Posts: 1

Rep: Reputation: Disabled
The below command will list the compile settings for apache

# apache2 -V | grep conf
-D SERVER_CONFIG_FILE="/etc/apache2/apache2.conf"

Here we can see that the /etc/apache2/apache2.conf is the configuration file.
 
1 members found this post helpful.
Old 07-15-2012, 11:04 AM   #11
unistinger
LQ Newbie
 
Registered: Jul 2012
Posts: 1

Rep: Reputation: Disabled
Hello everyone!
First of all excuse my English!
I just came by while searching for an answer for the same question!
And based on your argue guys, I did this small test just to see what file does apache depend on when it starts. I simply renamed httpd.conf to something else (e.g. http.conf_) and restarted apache. And the result? Apache failed to start!

Then did the same thing to the other file (apache2.conf), and again apache failed to start, which means that apache will actually read and apply any configs done in BOTH FILES!

And thanks for reading!!

P.S. did the test under Debian 5...

Last edited by unistinger; 07-15-2012 at 11:08 AM. Reason: adding that last line!
 
1 members found this post helpful.
Old 01-09-2013, 07:57 PM   #12
money_shots
LQ Newbie
 
Registered: Nov 2012
Distribution: Ubuntu
Posts: 3

Rep: Reputation: Disabled
# Include all the user configurations:
Include httpd.conf


This is now added in apache2.conf, dont know when it was added though.
 
1 members found this post helpful.
  


Reply

Tags
apache, apache2conf, httpdconf


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
apache2 complains 'sysconfig.d/include.conf' not found tacca Linux - Software 1 03-24-2011 09:23 AM
mod python: What to use for PythonHandler in apache2.conf? BrianK Linux - Software 1 10-10-2007 05:24 PM
Should I include srm.conf in httpd.conf in apache2? xpucto Linux - Software 3 02-16-2006 08:16 AM
apache2.conf read-only? lPrentice Linux - Newbie 4 05-26-2005 10:06 PM
saving changes to apache2/conf/httpd.conf file Zaius Linux - Newbie 6 01-09-2004 11:45 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 07:15 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
Open Source Consulting | Domain Registration