Ubuntu

Ubuntu’s Apache configuration is a bit baroque but reasonable once you get the hang of it. Most things in /etc/apache/apache2.conf are just sourcing other things. Which things get sourced are configured by linking "available" things into the "enabled" directories. This applies to modules (mods-available) and virtual hosts (sites-available).

On Ubuntu, httpd.conf is pretty much empty and the end user can put whatever special things make the site special in there. But note that it might not be in the right order or context there. It does get sourced though and is a convenient place to put some stuff.

Normally to change the behavior of the default served directory, edit /etc/apache2/sites-enabled/000-default which will contain:

    <Directory /var/www/>
        Options Indexes FollowSymLinks MultiViews
        AllowOverride None
        Order allow,deny
        allow from all
    </Directory>

This also indicates where the default web documents (document root) is, /var/www.

Directory Structure of Ubuntu’s Apache Configuration
/etc/apache2
    |-- apache2.conf
    |-- conf.d
    |     |-- charset
    |     |-- localized-error-pages
    |     \-- security
    |-- envvars
    |-- httpd.conf
    |-- magic
    |-- mods-available
    |     |-- cgi.load
    |     |-- dav.load
    |     |-- dbd.load
    |     |-- imagemap.load
    |     |-- include.load
    |     |-- info.conf
    |     |-- info.load
    |     |-- ldap.load
    |     |-- ssl.conf
    |     |-- ssl.load
    |     |-- status.conf
    |     |-- status.load
    |     |-- suexec.load
    |     |-- userdir.conf
    |     |-- userdir.load
    |     |-- version.load
    |     \-- vhost_alias.load
    |-- mods-enabled
    |     |-- cgid.load -> ../mods-available/cgid.load
    |     |-- status.conf -> ../mods-available/status.conf
    |     \-- status.load -> ../mods-available/status.load
    |-- ports.conf
    |-- sites-available
    |     |-- default
    |     \-- default-ssl
    \-- sites-enabled
        \-- 000-default -> ../sites-available/default

How to check to see what modules and virtual hosts are active

# APACHE_RUN_USER=www-data APACHE_RUN_GROUP=www-data /usr/sbin/apache2 -t -D DUMP_MODULES -D DUMP_VHOSTS