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

首頁 > 網站 > 建站經驗 > 正文

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

2019-11-02 16:33:23
字體:
來源:轉載
供稿:網友
通常我們是在{$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下 應該類似。

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 浑源县| 嘉荫县| 石城县| 祁东县| 中江县| 芒康县| 和林格尔县| 石楼县| 承德市| 南汇区| 丰都县| 克什克腾旗| 崇义县| 措勤县| 太湖县| 泸州市| 栾城县| 措勤县| 博湖县| 汤阴县| 达尔| 临桂县| 淳化县| 南华县| 武汉市| 绵阳市| 光泽县| 庆安县| 华池县| 乐业县| 晋中市| 旬邑县| 伊通| 海盐县| 台江县| 南部县| 昌黎县| 当雄县| 丹寨县| 威宁| 清远市|