为了提高系统的访问速度,需要减少Apache日志操作,下面是Apache日志过滤的参考样例:
# filter the localhost visit
SetEnvIf Remote_Addr "127\.0\.0\.1" dontlog
# filter some special directories
SetEnvIf Request_URI "^/system/.*$" dontlog
SetEnvIf Request_URI "^/export/.*$" dontlog
SetEnvIf Request_URI "^/resources/.*$" dontlog
# filter the intranet visit
SetEnvIf Remote_Addr "211\.167\.51\.199" dontlog
# filter the google bot
SetEnvIf Remote_Addr "66\.249\.6[4-9]\.[0-9]+" dontlog
SetEnvIf Remote_Addr "66\.249\.[7-8][0-9]\.[0-9]+" dontlog
SetEnvIf Remote_Addr "66\.249\.9[0-5]\.[0-9]+" dontlog
# filter the microsoft bot: 65.52.0.0 - 65.55.255.255
SetEnvIf Remote_Addr "65\.5[2-5]\.[0-9]+\.[0-9]+" dontlog
CustomLog logs/access_log common env=!dontlog
阅读(1152) | 评论(1) | 转发(0) |