iis php apache nginx,在Apache、IIS和Nginx开启如何SSI?

论坛 期权论坛 编程之家     
选择匿名的用户   2021-6-1 12:25   725   0

一些网站系统可能用到了SSI,下面就分别介绍在Apache和IIS开启如何SSI?

Apache(Linux / Windows 环境通用)

配置 httpd.conf(在 Apache 安装目录下的 conf/ 目录下),看有没有这两行,没有就加上:

AddType text/html .shtml

AddOutputFilter INCLUDES .shtml

接下来到你的虚拟主机配置项里,配置如下的一行:

Options -Indexes FollowSymLinks Includes

这个看情况,自己比对一下,有没有漏掉哪个单词。

最后附一个虚拟主机的参考配置(提示:不要直接拷贝):

ServerName cmstop.run

DocumentRoot "D:\SERVER\www\cmstop.run"

AddType text/html .shtml

AddOutputFilter INCLUDES .shtml

Options -Indexes FollowSymLinks MultiViews Includes

DirectoryIndex index.shtml index.html index.php

AllowOverride All

Order allow,deny

Allow from all

AddType application/x-httpd-php .php

AddType application/x-httpd-php-source .phps

ServerSignature On

Windows 2003 下的 IIS

windows 2003 安装好 IIS 之后默认是支持 .shtml 的,只要在 “WEB服务扩展” 允许 “在服务器前端的包含文件” 即可,重启 IIS 使配置生效。

Windows 2000 下的 IIS

打开 IIS,在要配置的网站上点击右键,选择属性,并在接下来的窗口中点击主目录,再点击右下方的配置,打开应用程序配置界面,如果列表中不存在 .shtml 和 .shtm,则需要自己手动添加,点击 添加 按钮,在打开的窗口中输入:

可执行文件:C:\WINDOWS\system32\inetsrv\ssinc.dll

扩展名:.shtml或.shtm

限制为:GET,POST

勾选“脚本引擎”和“确认文件是否存在”;

一路确定下去即可完成,之后重启 IIS 使配置生效。

Nginx下开启SSI

这个最简单,在 nginx 的 http 配置节中,添加如下的一行即可:

http

{

...

ssi on;

...

}

之后记得重启 Nginx。

分享到 :
0 人收藏
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

积分:3875789
帖子:775174
精华:0
期权论坛 期权论坛
发布
内容

下载期权论坛手机APP