默认情况下:模块是一件存在的,但是 apache 没有加载模块,所以需要自己创建一个软 连接
步骤:
ln -s /etc/apache2/mods-available/include.load /etc/apache2/mods-enabled
现在apache就可以加载模块了
然后在需要开始ssi的sites-available/filename 的配置文件中增加相应的 代码 。
例如我的配置:
vi /etc/apache2/sites-available/blogguy_cn
增加以下两行:
AddType text/html .shtml .html .htm
AddOutputFilter INCLUDES .shtml .html .htm
同时注意:
Options Indexes FollowSymLinks MultiViews +Includes 一行 +Includes一定要有,默认是有的。
配置完的配置文件大致是:
<VirtualHost *:80>
ServerAdmin wayswang@gmail.com
DocumentRoot /var/www/blogguy.cn
ServerName blogguy.cn
ServerAlias www.blogguy.cn
<Directory /var/www/blogguy.cn>
Options Indexes FollowSymLinks MultiViews Includes
AllowOverride None
Order allow,deny
allow from all
AddType text/html .shtml .html .htm
AddOutputFilter INCLUDES .shtml .html .htm
</Directory>
ErrorLog /var/log/apache2/blogguy_cn_error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog /var/log/apache2/blogguy_cn_access.log combined
</VirtualHost>
然后重启apache
service apache2 restart
可以了!
《 Ubuntu自带的apache开启ssi支持shtml 》由 第二电脑网 原创提供,转载请注明: http://www.002pc.com/master/College/Server/Apache/17975.html
查看更多关于Ubuntu自带的apache开启ssi支持shtml|配置-Apache教程的详细内容...