首页 > 代码库 > Apache 配置不记录指定文件类型的日志

Apache 配置不记录指定文件类型的日志

[root@localhost ~]# vim /usr/local/apache2/conf/extra/httpd-vhosts.conf<VirtualHost *:80>    DocumentRoot "/data/www"    ServerName www.test.com    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    ErrorLog "logs/test.com_error_log"    CustomLog "logs/test.com_access_log" combined env=!image-request  </VirtualHost>
[root@localhost ~]# /usr/local/apache2/bin/apachectl -t[root@localhost ~]# /usr/local/apache2/bin/apachectl graceful

 

 

 

 

    

Apache 配置不记录指定文件类型的日志