国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 網站 > Apache > 正文

限制 Apache日志文件大小的方法

2024-08-27 18:28:17
字體:
來源:轉載
供稿:網友
通常我們是在{$apache}/conf/httpd.conf中設置Apache的參數,然而我們并沒有發現可以設置日志文件大小的配置指令,通過參考http://httpd.apache.org/docs/2.0/programs/rotatelogs.html,可以用apache 自己的程序 rotatelogs.exe(位于 {$apache}/bin/目錄下),來限制日志文件的大小。
Usage: rotatelogs [-l] [offset minutes from UTC] or
Add this:
TransferLog "|rotatelogs /some/where 86400"
or
TransferLog "|rotatelogs /some/where 5M"
to httpd.conf. The generated name will be /some/where.nnnn where nnnn is the system time at which the log nominally starts (N.B. if using a rotation time, the time will always be a multiple of the rotation time, so you can synchronizecron scripts with it). At the end of each rotation time or when the file size is reached a new log is started.
在 Windows 下的設置例子如下:
# 限制錯誤日志文件為 1M
ErrorLog "|bin/rotatelogs.exe -l logs/error-%Y-%m-%d.log 1M"
# 每天生成一個錯誤日志文件
#ErrorLog "|bin/rotatelogs.exe -l logs/error-%Y-%m-%d.log 86400"
# 限制訪問日志文件為 1M
CustomLog "|bin/rotatelogs.exe -l logs/access-%Y-%m-%d.log 1M" common
# 每天生成一個訪問日志文件
#CustomLog "|bin/rotatelogs.exe -l logs/access-%Y-%m-%d.log 86400" common
linux/Unix下 應該類似。
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 峡江县| 介休市| 扶余县| 紫云| 青河县| 南丰县| 贵溪市| 铜川市| 翁源县| 枞阳县| 房产| 临颍县| 新闻| 油尖旺区| 马龙县| 漳州市| 新晃| 邢台市| 旅游| 新竹市| 哈巴河县| 宣汉县| 迭部县| 青川县| 盈江县| 收藏| 元阳县| 潍坊市| 浦东新区| 开阳县| 乌海市| 两当县| 安阳市| 合江县| 澄江县| 江门市| 巴彦淖尔市| 天台县| 噶尔县| 吴桥县| 湖南省|