10月 012008
 

编辑httpd.conf 设置如下:


SetEnv IMAG 1

CustomLog logs/access_log combined env=!IMAG

这样记录文件access_log就不会记录ico|gif|jpg|png|bmp|swf的访问记录,同样也可以加上css|js才过滤css和js文件,效果很好.
但是这种记录限制只限制于做虚拟主机的时候没有同时设定记录文件的时候会参照这个方式记录在access_log文件里.不过httpd.conf里默认还有另外一个类似不记录虚拟主机日志的日志文件.

(设定:服务器是windows20003,装有apache2.3 php5 mysql zend gd)

参照:
    #
    # The location and format of the access logfile (Common Logfile Format).
    # If you do not define any access logfiles within a
    # container, they will be logged here.  Contrariwise, if you *do*
    # define per-
access logfiles, transactions will be
    # logged therein and *not* in this file.
    #
    CustomLog logs/access.log common
这样会重复记录一个文件access.log ,所以可以注释掉上面那一行:
#CustomLog logs/access.log common Continue reading »