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

首頁 > 網站 > Apache > 正文

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

2024-08-27 18:25:20
字體:
來源:轉載
供稿:網友
通常我們是在{$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下 應該類似。
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 马边| 德清县| 绥化市| 汶川县| 汶上县| 无锡市| 黄冈市| 沾化县| 邮箱| 左云县| 平遥县| 甘孜县| 永清县| 通城县| 哈巴河县| 汶上县| 界首市| 许昌市| 湖北省| 宿迁市| 达拉特旗| 寿宁县| 乐亭县| 喜德县| 景德镇市| 凉城县| 贺州市| 和龙市| 巢湖市| 梁山县| 万州区| 西畴县| 安义县| 瑞丽市| 黄大仙区| 安岳县| 桃源县| 淳化县| 松原市| 阿城市| 章丘市|