Cronolog在Windows + Apache下的安装

上一篇 / 下一篇  2007-12-29 10:10:37

查看( 111 ) / 评论( 1 )
Cronolog在Windows + Apache下的安装

原文:http://server.it168.com/server/2007-12-27/200712270901079.shtml

Apache 的日志默认是直接写入一个独立的 log 文件。如果网站流量大,日志文件很快就会变得很庞大;而 AWStats 等日志分析软件,要求日志文件以天的格式保存。cronolog 正好可以解决这个问题:它可以对 Apache 的日志按需要进行截断处理(cronolog 也是Apache推荐使用的日志工具之一),是使用 AWStats 进行日志分析的基础。这是cronolog 官方网站 http://www.cronolog.org/ 上的介绍:

    cronolog is a simple filter program that reads log file entries from standard input and writes each entry to the output file specified by a filename template and the current date and time. When the expanded filename changes, the current file is closed and a new one opened. cronolog is intended to be used in conjunction with a Web server, such as Apache, to split the access log into daily or monthly logs.

    如何在 Linux+Apache 环境下安装 cronolog 的文章很多,此文简单地说明一下 cronolog 在 Windows + Apache 下的安装:
    1. 首先到 cronolog 的网站 http://www.cronolog.org/下载。注意应该下载 Win 32 version (ZIP file) 的版本。目前最新的 win 32 version 是 1.6.1。

    2. 将 zip 文件下载之后,将 cronolog.exe 解压并复制到 Apache 的 bin 目录

    3. 在 apache 的配置文件 httpd.conf 中, 修改以下代码:

    4. CustomLog "|bin/cronolog.exe logs/access_%Y%m%d.log" combined
    ErrorLog "|bin/cronolog.exe logs/error_%Y%m%d.log"
    也可以在虚拟主机配置中使用,例如:
    <VirtualHost *:80>
    ServerName www.xiaohui.com
    CustomLog "|bin/cronolog.exe logs/xiaohui.com/access_%Y%m%d.log" combined
    ErrorLog "|bin/cronolog.exe logs/xiaohui.com/error_%Y%m%d.log"
    </VirtualHost>

    5. 重新启动 Apache.

    6. 其他设置说明,请见下载包中的 README 文件。

    注:本文经作者xiaohui.com授权IT168服务器频道刊登,原文链接:www.xiaohui.com

TAG:

太陽微繫統'sBlog sun029 发布于2008-01-04 00:00:51
谢谢分享!
我来说两句

(可选)

日历

« 2008-12-25  
 123456
78910111213
14151617181920
21222324252627
28293031   

数据统计

  • 访问量: 13720
  • 日志数: 146
  • 影音数: 2
  • 建立时间: 2007-08-01
  • 更新时间: 2008-07-30

RSS订阅

Open Toolbar