我在Apache日志中得到以下错误信息:
unable to include potential exec "header.html" in parsed file /Users/sikusiku/Sites/ss-git/homepage.shtml
我基本上尝试从home .shtml中包含header.html。我在homepage.html中使用了非常基本的指令(header.html和主页)。Shtml 位于文档根目录):
<!--#include virtual="header.html" -->
我想我已经正确地打开了SSI在我的httpd.conf:
Options Indexes FollowSymLinks ExecCGI Includes
...
AddType text/html .shtml
...
# XBitHack doesn't have anything to do with this, but I added it anyway.
XBitHack on
我错过什么了吗?是否包含的文件,即header.html需要配置不同?
我刚刚用apache2在ubuntu server 11.10上修复了这个问题。
我的/etc/apache2/sites-available/默认文件
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
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>
ErrorLog ${APACHE_LOG_DIR}/error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/access.log combined
Alias /doc/ "/usr/share/doc/"
<Directory "/usr/share/doc/">
Options Indexes MultiViews FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
Allow from 127.0.0.0/255.0.0.0 ::1/128
</Directory>
</VirtualHost>
我把/var/www目录指令中的AllowOverride None改为All。
我的。htaccess文件在/var/www/.htaccess:
Options +Includes
AddType text/html .shtml
AddOutputFilter INCLUDES .shtml
最后我确定包含。加载是在mod_enabled文件夹中,这是加载mod_includes。所以模块。
sudo ln -s /etc/apache2/mods-available/include.load /etc/apache2/mods-enabled/include.load
创建到包含的符号链接。加载mod -available.
最后重启apache
sudo service apache2 restart
这让它对我有用,希望你也能让它工作。
——托马斯。