Apache SSI无法正常工作

时间:2014-05-07 11:56:50

标签: linux apache apache2 ubuntu-12.04 ssi

我在Ubuntu 12.04服务器上运行Apache(版本2.2.22)Web服务器。 SSI不起作用。不解释 index.shtml 页面中的经典<!--#echo var="DATE_LOCAL" -->。在 /etc/apache2/httpd.conf 中我放了:

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

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

此外, error.log 给了我:

[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

提前感谢您的任何帮助:)

1 个答案:

答案 0 :(得分:9)

我发现了问题:我只需要加载include模块。在实践中,我只需要a2enmod include并解决了问题。

抱歉这个愚蠢的问题。我留给那些可以花一整天寻找像我这样明显的事情的人......