Apache SSI not working
Asked Answered
J

1

5

I am running an Apache (version 2.2.22) web server on an Ubuntu 12.04 server. SSI is not working. The classic <!--#echo var="DATE_LOCAL" --> in an index.shtml page is not interpreted. In /etc/apache2/httpd.conf I have put:

Options +Includes 
AddType text/html .shtml
AddHandler server-parsed .shtml
AddOutputFilter INCLUDES .shtml

and in /etc/apache2/sites-available/default :

    DocumentRoot /var/www
    <Directory />
            Options Indexes FollowSymLinks MultiViews +ExecCGI +Includes
            AllowOverride All
            AddHandler cgi-script .cgi .pl .py
            Order allow,deny
            allow from all
    </Directory>

    ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
    <Directory "/usr/lib/cgi-bin">
            AllowOverride None
            Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
            Order allow,deny
            Allow from all
    </Directory>

    <IfModule mod_dir.c>
         DirectoryIndex index.shtml index.html index.php
    </IfModule>

moreover, the error.log gives me:

[Wed May 07 13:51:23 2014] [notice] Apache/2.2.22 (Ubuntu) PHP/5.3.10-1ubuntu3.11 with Suhosin-Patch configured -- resuming normal operations
[Wed May 07 13:51:26 2014] [error] an unknown filter was not added: includes
[Wed May 07 13:51:27 2014] [error] an unknown filter was not added: includes

Thanks in advance for any help :)

Jaine answered 7/5, 2014 at 11:56 Comment(1)
This question may belong on Ask Ubuntu? Either way, I think it definitely is helpful, though I needed a bit more understanding to get my Apache SSI working: #19201022Exeunt
J
12

I found the problem: I simply had to load the include module. In practice I only had to a2enmod include and it fixed the problem.

Sorry for the stupid question. I leave it for those who could spend a whole day looking for such an evident thing, like me...

Jaine answered 7/5, 2014 at 16:6 Comment(2)
Note you also need mod_perl (perl.load), which is also not enabled by default. include.load alone isn't enough.Marcos
Now it seems I also need AddOutputFilter INCLUDES .html. I'm pretty sure I didn't need this in 2016 on my old version.Marcos

© 2022 - 2024 — McMap. All rights reserved.