中国IT动力,最新最全的IT技术教程
最新100篇 | 推荐100篇 | 专题100篇 | 排行榜 | 搜索 | 在线API文档
首 页 | 程序开发 | 操作系统 | 软件应用 | 图形图象 | 网络应用 | 精文荟萃 | 教育认证 | 硬件维护 | 未整理篇 | 站长教程
ASP JS PHP工程 ASP.NET 网站建设 UML J2EESUN .NET VC VB VFP 网络维护 数据库 DB2 SQL2000 Oracle Mysql
服务器 Win2000 Office C DreamWeaver FireWorks Flash PhotoShop 上网宝典 CorelDraw 协议大全 网络安全 微软认证
硬件维护  CPU  主板  硬盘  内存  显卡  显示器  键盘鼠标  声卡音箱  打印机  机箱电源  BIOS  网卡  C#  Java  Delphi  vs.net2005
  当前位置:> 操作系统 > 服务器 > Web服务器
Apache的log文件长得太快了
作者:未知 时间:2005-09-13 17:24 出处:ChinaUnix.net 责编:chinaitpower
              摘要:Apache的log文件长得太快了

Apache的log文件长得太快了 

我的apache服务器的log文件长得很快。
我想定期把一个阶段的log文件,放到另外一个目录里做备份
比如,每星期把log文件的全部内容放到另外一个文件里,让当前的log文件大小为0。每星期如此重复。

该怎么做?
手动怎么做?
有什么自动的办法么?

多谢

 deathcult 回复于:2003-09-21 14:45:01
man rotatelogs

 lzv 回复于:2003-09-22 10:35:20
[url]http://httpd.apache.org/docs/misc/FAQ.html#rotate[/url]

The simple answer: by piping the transfer log into an appropriate log file rotation utility.

The longer answer: In the src/support/ directory, you will find a utility called rotatelogs which can be used like this:

   TransferLog "|/path/to/rotatelogs /path/to/logs/access_log 86400"
to enable daily rotation of the log files.
A more sophisticated solution of a logfile rotation utility is available under the name cronolog from Andrew Ford's site at [url]http://www.cronolog.org/[/url]. It can automatically create logfile subdirectories based on time and date, and can have a constant symlink point to the rotating logfiles. (As of version 1.6.1, cronolog is available under the Apache License). Use it like this:

   CustomLog "|/path/to/cronolog --symlink=/usr/local/apache/logs/access_log /usr/local/apache/logs/%Y/%m/access_log" combined

 xiaoxiaoke 回复于:2004-02-15 20:50:23
强烈建议采用cronolog工具,可以针对不同周期来轮循,而且对webaliaze工具也支持得很好

关闭本页
 
首页 | 投资与合作 | 服务条款 | 隐私政策 | 收藏本站 | 设为首页 | 新用户注册 | 免责声明 | 使用帮助
Copyright ©2005-2008 chinaitpower.com All rights reserved. www.chinaitpower.com 版权所有