Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

which one of these two files should I use to configure Apache?

The httpd.conf is empty, while apache2.conf is not.

It confuses me!

share|improve this question

migrated from Sep 22 '12 at 16:56

This question came from our site for professional and enthusiast programmers.

up vote 40 down vote accepted

The httpd.conf is designed for user configurations. You really should not edit the apache2.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.

share|improve this answer
I don't have a file called apapche2.conf – Doug Molineux Sep 9 '11 at 16:05

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.

share|improve this answer
this is the correct answer ! and also the ports/mods-available config files if you want to elaborate on your answer – Sudhi Nov 19 '11 at 21:01

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... :)


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...

share|improve this answer
+1 "httpd.conf is deprecated" – feeela Jul 27 '12 at 12:05

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.

share|improve this answer
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 - – ccheneson Apr 2 '10 at 15:38

Apache 2.4+

Place any user/custom configuration in /etc/apache2/conf-available/{name}.conf

Enable/Disable your config using 2enconf/a2disconf

As noted above in a note, httpd.conf is deprecated and if you see it at all, it's there for historical reasons. It is installed empty (as of now) on fresh install. Leave it empty!


share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.