国产探花免费观看_亚洲丰满少妇自慰呻吟_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下 應該類似。
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 阿克陶县| 闵行区| 旬阳县| 阜南县| 晋江市| 阿拉尔市| 仁布县| 克山县| 曲阜市| 深州市| 抚顺县| 南通市| 克什克腾旗| 无极县| 积石山| 昭觉县| 常山县| 肃北| 忻城县| 惠安县| 宜阳县| 涞水县| 四会市| 津南区| 延长县| 彰化县| 九江市| 云梦县| 屯昌县| 双辽市| 巨野县| 永春县| 郴州市| 肥城市| 沧源| 渑池县| 鄂州市| 仁布县| 寻甸| 东平县| 台安县|