博客导读网 |
一个让你随便看看的地方 |
给网页自动添加头部的apache模块mod_layout推荐LinuxPig.com |
||
|
如果想为服务器上所有的网页添加一些特定的内容,可以考虑使用 apache 的mod_layout模块。
官方地址: http://www.musc.edu/webserver/mod_layout.html
但是他们的现在连接已经坏了,而且找到的几个版本在64为的系统上安装总是有问题,这里提供一个好用的版本: mod_layout-5.1.tar 这个版本经过测试在多个版本的centos上均运行正常。
【安装】 安装时候只需要将apache的 axps 放到PATH当中,然后直接 make && make install 就搞定了。(其他的版本安装很麻烦)
【配置方法】
//定义匹配的类型
AddOutputFilter LAYOUT html
AddOutputFilter LAYOUT htm
AddOutputFilter LAYOUT shtml
AddOutputFilter LAYOUT php
//指定 header / footer 页面
LayoutHeader /data1/www/htdocs/header/iframe_header.html
LayoutIgnoreURI /header/* //排除header目录
LayoutIgnoreURI /*/linuxpig_com_noheader_*/* //排除特定目录
【完整的定义类似这样】
<Directory "/data1/www/htdocs">
Options FollowSymLinks
Order allow,deny
Allow from all
# config for mod_layout module by huliang@linuxpig.com
AddOutputFilter LAYOUT html
AddOutputFilter LAYOUT htm
AddOutputFilter LAYOUT shtml
AddOutputFilter LAYOUT php
#AddOutputFilterByType LAYOUT;DEFLATE text/html
LayoutHeader /data1/www/htdocs/header/iframe_header.html
LayoutIgnoreURI /header/*
LayoutIgnoreURI /*/linuxpig_com_noheader_*/*
# config for mod_layout module by huliang@linuxpig.com
# 输出gzip压缩,也很有用啊,:-)
SetOutputFilter DEFLATE
BrowserMatch ^Mozilla/4 gzip-only-text/ht
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
Header append Vary User-Agent env=!dont-vary
</Directory>
您可能感兴趣的文章 |
||
| 原文地址:http://item.feedsky.com/~feedsky/LinuxPig_com/~8174374/431527653/6278143/1/item.html |
| © 2010 博客导读网 BlogABC.NET 本站所有内容皆由网友推荐而来,所有博文的版权归原作者所有,如有冒犯,请邮件告知。uncracker#gmail.com |