67

I recently installed apache2 on ubuntu but I have a problem, my httpd.conf is empty. Can someone give me a clean copy of httpd.conf for apache2 on ubuntu? Thanks!

Edit: I saw your answers but on wampserver httpd.conf is not empty and as you mentioned it is for user options. SO what should I do?

Edit2 : That's what I got on my apache2.conf, how I add modules, enable gzip and all of that?

[Deleted the contents, as they render the question unreadable and are useless, because that were the default Apache2 configuration under Ubuntu.]

feeela
  • 29,399
  • 7
  • 59
  • 71
Yehonatan
  • 3,168
  • 7
  • 31
  • 39
  • Reinstall or find the right .conf file. – Peon Jul 27 '12 at 11:48
  • I already installed phpmyadmin so it would be a head heck... and I found it but it was empty. – Yehonatan Jul 27 '12 at 11:50
  • 1
    @Yehonatan installing phpMyAdmin does not change the contents of the `apache2.conf` but create a symbolic link: `/etc/apache2/conf.d/phpmyadmin -> /etc/phpmyadmin/apache.conf` (Apache includes al config files under `/etc/apache2/conf.d/` by default.) – feeela Jul 27 '12 at 11:52
  • The settings you find in httpd.conf on your wampserver should be in the file mentioned in the answers. – fkerber Jul 27 '12 at 11:53
  • This would be a good question for http://askubuntu.com/, but I can't flag it properly… – feeela Jul 27 '12 at 11:55

4 Answers4

122

The /etc/apache2/httpd.conf is empty in Ubuntu, because the Apache configuration resides in /etc/apache2/apache2.conf!

“httpd.conf is for user options.” No it isn't, it's there for historic reasons.

Using Apache server, all user options should go into a new *.conf-file inside /etc/apache2/conf.d/. This method should be "update-safe", as httpd.conf or apache2.conf may get overwritten on the next server update.

Inside /etc/apache2/apache2.conf, you will find the following line, which includes those files:

# Include generic snippets of statements
Include conf.d/

As of Apache 2.4+ the user configuration directory is /etc/apache2/conf-available/. Use a2enconf FILENAME_WITHOUT_SUFFIX to enable the new configuration file or manually create a symlink in /etc/apache2/conf-enabled/. Be aware that as of Apache 2.4 the configuration files must have the suffix .conf (e.g. conf-available/my-settings.conf);

feeela
  • 29,399
  • 7
  • 59
  • 71
  • 3
    +1. Yes, file override during server update is important, else you will end up looking for this question after 2 years when you do a server update. – Fr0zenFyr Apr 21 '14 at 10:27
  • > # Include all the user configurations: Include httpd.conf –  Apr 23 '14 at 18:16
11

It's empty by default. You'll find a bunch of settings in /etc/apache2/apache2.conf.

In there it does this:

# Include all the user configurations:
Include httpd.conf
bcmcfc
  • 25,966
  • 29
  • 109
  • 181
5

OK - what you're missing is that its designed to be more industrial and serve many sites, so the config you want is probably:

/etc/apache2/sites-available/default

which on my system is linked to from /etc/apache2/sites-enabled/

if you want to have different sites with different options, copy the file and then change those...

nsgulliver
  • 12,655
  • 23
  • 43
  • 64
Kevin
  • 61
  • 1
  • 1
1

It seems to me, that it is by design that this file is empty.

A similar question has been asked here: https://stackoverflow.com/questions/2567432/ubuntu-apache-httpd-conf-or-apache2-conf

So, you should have a look for /etc/apache2/apache2.conf

Community
  • 1
  • 1
fkerber
  • 1,032
  • 9
  • 24