简体   繁体   中英

Apache SSI not working

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM