zoukankan      html  css  js  c++  java
  • LAMP 2.1Apache不记录指定文件类型日志

    访问日志只需要记地址,不用记录图片。

    对无用的图片日志做标记,针对标记做限制。打开

    vim /usr/local/apache2/conf/extra/httpd-vhosts.conf

       ErrorLog "logs/denny.com-error_log"
       CustomLog "|/usr/local/apache2/bin/rotatelogs -l  /usr/local/apache2/logs/denny.com-access_%Y%m%d_log 86400" combined

    改成

       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/denny.com-error_log"
       CustomLog "|/usr/local/apache2/bin/rotatelogs -l  /usr/local/apache2/logs/denny.com-access_%Y%m%d_log 86400" combined env=!image-request

    查看文件是否正确,重启。

    apachectl -t
    /usr/local/apache2/bin/apachectl restart

    查看日志

    less /usr/local/apache2/logs/denny.com-access_20151209_log 

    查看文件是否正确

  • 相关阅读:
    android 源码
    android 保护
    电池信息 显示
    RGB、HSB、HSL 互相转换算法
    网页美工
    css 设计标准
    js 封闭 小结
    格式转换工具
    网页设计规范
    瀑布流分析
  • 原文地址:https://www.cnblogs.com/wangshaojun/p/5031167.html
Copyright © 2011-2022 走看看