Apache 2.4 SSI on Ubuntu 13.04

apache-2.4server-side-includesubuntu-13.04

I have an Ubuntu 13.04 server that had normal, stock Apache 2.2 with SSI working. I got a bug in my ear, and installed the ppa:rhardy/apache24x PPA to get my server upgraded Apache 2.4.

While it wasn't a clean upgrade, I have gotten most of the kinks worked out.

However, I still can't figure out how to get Server-Side Includes working. Everything looks ok, but when I hit one of my sites served from this server that uses SSI, it doesn't work.

I have /etc/apache2/mods-enabled/include.load symlinked to /etc/apache2/mods-available/include.load

My site's config file looks like:

<VirtualHost *>
    ServerAdmin webmaster@myserver.com
    ServerName www.myserver.com
    ServerAlias myserver.com

    DocumentRoot /var/www/myserver
    <Directory />
        Options +Indexes +FollowSymLinks +IncludesNOEXEC
        AllowOverride None
        XBitHack On
        AddType text/html .shtml
        AddOutputFilter INCLUDES .shtml
    </Directory>
</VirtualHost>

Inside /var/www/myserver:

-rwxr-xr-x 1 mike mike  776 Feb 20  2012 index.shtml*

And the contents of the file start with an SSI:

<!--#include virtual="/include/header.html"-->

I have restarted the server after all configuration changes, and still don't have SSI working. What am I missing?

Thanks.

Best Answer

It appears that there is a difference in how Apache 2.2 handles <Directory> entries that align with DocumentRoot vs. how 2.4 does.

In 2.2, the following code:

DocumentRoot /var/www/myserver
<Directory />
    [...]
</Directory>

would apply any of the directives (such as Options and XBitHack) to the /var/www/myserver directory and files therein.

In 2.4, the configuration needs to change to this:

DocumentRoot /var/www/myserver
<Directory /var/www/myserver>
    [...]
</Directory>

and then apache2ctl restart, and then SSIs will work again.