原文地址:
http://blog.sina.com.cn/s/blog_551393a90100p4tx.htmlLoadModule setenvif_module modules/mod_setenvif.so
SetEnvIf Request_URI "^/enterprise/main\.php.*$" dontlog
CustomLog d:/logs/%Y%m%d.log combined env=!dontlog
参考资料:
正则表达式30分钟入门教程
Apache的环境变量
转载内容:
为了提高系统的访问速度,需要减少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
posted on 2012-02-14 15:50
漂漂 阅读(1017)
评论(0) 编辑 收藏 引用