Apache中ssi的配置方法

本文详细介绍了如何在Apache服务器上启用SSI(Server Side Includes)功能。主要内容包括:修改httpd.conf文件来支持.html和.shtml文件的SSI处理,以及如何正确设置目录选项以允许Includes。按照步骤操作后,重启Apache即可生效。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Apache默认不支持ssi,需要修改httpd.conf文件
1、查找
#AddType text/html .shtml
#AddHandler server-parsed .shtml

将前边的#注释符去掉
 
2、查找
<Directory "d:/APM_Setup/htdocs"> </Directory>
这里是网站根目录设置选项,(路径会有所不同)
Option 选项后加 Includes
例如:
<Directory "d:/APM_Setup/htdocs">
#
# This may also be "None", "All", or any combination of "Indexes",
# "Includes", "FollowSymLinks", "ExecCGI", or "MultiViews".
#
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.
#
    Options FollowSymLinks MultiViews ExecCGI Includes
#
# This controls which options the .htaccess files in directories can
# override. Can also be "All", or any combination of "Options", "FileInfo",
# "AuthConfig", and "Limit"
#
    AllowOverride None
#
# Controls who can get stuff from this server.
#
    Order allow,deny
    Allow from all
</Directory>

3、保存httpd.conf修改,重起apache
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值