SSI Technic

SSI Technic

1. What are SSI
SSI(Server Side Includes) are directives that are placed in HTML pages. They let you add dynamically generated content
to an existing HTML page, without having to serve the entire page via a CGI program, or other dynamic technology.

2. Configuring your server to permit SSI
SSI will use mod_include. So we should first enable this module on my ubuntu system.
>sudo a2enmod include

Change the configuration
>cd /etc/apache2/sites-available
>vi default
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews +Includes
AllowOverride None
Order allow,deny
allow from all
AddType text/html .shtml
AddOutputFilter INCLUDES .shtml
</Directory>

3. sample html files to manage the layout of htmls
desk.shtml:
<html>
<head>
<title>E-Menu</title>
</head>
<body>
<!--#include virtual="common/header.shtml" -->
This is the body<br />
<!--#include virtual="common/footer.shtml" -->
</body>
</html>

And the other 2 files are as follow, header.shtml, footer.shtml:
This is footer<br />

This is header<br />

4. sample html files to show the parameters
env.shtml:
<!--#set var="name" value="sillycat" -->

desk.shtml:
<!--#cinlude virtual="common/env.shtml" -->
Hello, <!--#echo var="name" -->

references:
http://httpd.apache.org/docs/2.2/howto/ssi.html
http://jumu013.blog.163.com/blog/static/10316130020092310439198/
http://ubuntu.flowconsult.at/en/apache2-ssi-installation/
http://steveyoung.wordpress.com/2007/02/04/apache2-ssi-server-side-includes/
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值