我在 Ubuntu 12.04 服务器上运行 Apache(版本 2.2.22)网络服务器。 SSI 不工作。经典<!--#echo var="DATE_LOCAL" -->
在 index.shtml 页面中不被解释。在 /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
在此先感谢您的帮助:)
最佳答案
我发现了问题:我只需要加载 include
模块。实际上,我只需要 a2enmod include
就可以解决问题。
抱歉这个愚蠢的问题。我把它留给那些可以花一整天时间寻找如此明显的东西的人,比如我......
关于linux - Apache SSI 不工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23517165/