1.编辑虚拟主机文件
vim /usr/local/apache2/conf/extra/httpd-vhosts.conf
SetEnvIf Request_URI ".*\.gif$" image-request
SetEnvIf Request_URI ".*\.jpg$" image-request
SetEnvIf Request_URI ".*\.png$" image-request
SetEnvIf Request_URI ".*\.bmp$" image-request
SetEnvIf Request_URI ".*\.swf$" image-request
SetEnvIf Request_URI ".*\.js$" image-request
SetEnvIf Request_URI ".*\.css$" image-request
CustomLog "|/usr/local/apache2/bin/rotatelogs -l /usr/local/apache2/logs/xrc.com-access_%Y%m%d_log 86400" combined env=! image-request----加入这行
原文地址:http://11706174.blog.51cto.com/11696174/1787421