tags:

views:

629

answers:

4

which one of these 2 files should i use to configure apache?

the httpd.conf is empty while apache2.conf is not.

it confuses me!

+1  A: 

If apache2.conf is not empty, and httpd.conf is empty, you should probably use apache2.conf ;-)

But I suppose that one includes the other (and that one of those is kept purely for backward compatibility reasons) -- so, it shouldn't change much.


Still, if you want to add something, like a new VirtualHost : is there not another sub-directory, in which you could put your file, and have it included ?

It would probably be a better solution : you would not modify the default file -- which would simplify updates.

Pascal MARTIN
As mentionned by Pascal, if you want to add a new VirtualHost, you should add a new file under sites-available and then have it symlink in sites-enabled with the command a2ensite - https://help.ubuntu.com/6.06/ubuntu/serverguide/C/httpd.html
ccheneson
+1  A: 

The httpd.conf is designed for user configurations. You really should not edit the apapche2.conf as it may be updated by future upgrades.

An additional option is to just put your custom configuration into /etc/apache2/conf.d, all files in this directory are included as well.

Rob Di Marco
+1  A: 

apache2.conf includes httpd.conf:

a@test$:/etc/apache2$ cat apache2.conf | grep httpd.conf 
Include /etc/apache2/httpd.conf

I think that httpd.conf is deprecated, but just left in there for conservative people so that they find they way around... :)

EDIT:

After reading Rob's answer, I did a better grep:

a@test:/etc/apache2$ grep -C 1 httpd.conf apache2.conf 
# Include all the user configurations:
Include /etc/apache2/httpd.conf

User configurations it is...

disown
+1  A: 

These are not your only options. On Ubuntu/Debian, Apache also processes all the files in /etc/apache2/sites-enabled/ (which should be symlinks to files in sites-available/ directory, managed by the a2ensite and a2dissite programs)

You're intended to use these directories for VirtualHosts.

R. Bemrose