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

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

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 

查看文件是否正确

LAMP 2.1Apache不记录指定文件类型日志的更多相关文章

  1. nginx不记录指定文件类型日志

    1.指定记录文件日志记录的内容. vim /usr/local/nginx/conf/nginx.conf如下部分: log_format dd '$remote_addr $http_x_forwa ...

  2. Apache 日志设置不记录指定文件类型的方法和日志轮

    Apache日志精准的记录了Web访问的记录,但对于访问量很大的站来说,日志文件过大对于分析和保存很不方便.可以在http.conf(或虚拟主机设置文件httpd-vhosts.conf)中进行设置, ...

  3. nginx不记录指定文件类型的日志

    1.指定记录文件日志记录的内容. vim /usr/local/nginx/conf/nginx.conf如下部分: log_format dd '$remote_addr $http_x_forwa ...

  4. HTML input="file" 浏览时只显示指定文件类型 xls、xlsx、csv

    html input="file" 浏览时只显示指定文件类型 xls.xlsx.csv <input id="fileSelect" type=" ...

  5. <input type="file" />浏览时只显示指定文件类型

    <input type="file" />浏览时只显示指定文件类型 <input type="file" accept="appli ...

  6. findstr 只搜寻指定文件类型

    Title:findstr 只搜寻指定文件类型 --2012-05-04 09:27 findstr /i /m /S /C:"关键字"  *.php *.asp *.jsp

  7. C# 获得目录下所有文件或指定文件类型文件(包含所有子文件夹)

    public partial class FileGet { /// <summary> /// 私有变量 /// </summary> private static List ...

  8. Python,针对指定文件类型,过滤空行和注释,统计行数

    参考网络上代码编辑而成,无技术含量,可自行定制: 目前亲测有效,若有待完善之处,还望指出! 强调:将此统计py脚本放置项目的根目录下执行即可. 1.遍历文件,递归遍历文件夹中的所有 def getFi ...

  9. python 读取指定文件夹中的指定文件类型的文件名

    import numpy as np import os path = 'F:\\wenjian'#指定文件所在路径 filetype ='.csv'#指定文件类型 def get_filename( ...

随机推荐

  1. Delphi_添加_mshtml_tlb

    1. Delphi --> Component --> Install ActiveX Contol ... --> 选择“Microsoft HTML Object Library ...

  2. openstack Neutron分析(3)—— neutron-dhcp-agent源码分析

    1.neutron dhcp3个主要部件分别为什么?2.dhcp模块包含哪些内容?3.Dnsmasq配置文件是如何创建和更新的?4.DHCP agent的信息存放在neutron数据库的哪个表中? 扩 ...

  3. Guest CPU model configuration in libvirt with QEMU/KVM

    每个hypervisor对于guest能看到的cpu model定义都不同,Xen 提供host pass through,所以guest能看到的cpu和host完全相同. QEMU/KVM中gues ...

  4. Java JDK、Tomcat、Eclipse环境配置

    Java 下载地址:http://www.oracle.com/ 根据提示一步一步进行安装,通常安装到C:\Program Files\Java,包含: 环境变量配置: JAVA_HOME:C:\Pr ...

  5. php:使用XHProf查找PHP性能瓶颈

    https://www.cnblogs.com/casatwy/archive/2013/01/17/2865241.html XHProf是facebook 开发的一个测试php性能的扩展,本文记录 ...

  6. DOM的的概述

    DOM= Document Object Model,文档对象模型,DOM可以以一种独立于平台和语言的方式访问和修改一个文档的内容和结构.换句话说,这是表示和处理一个HTML或XML文档的常用方法.有 ...

  7. asp.net 锚点

    可以使用锚点,但这里可使用灵活处理 首先获取需要滚动到的位置的id,如,可以设置一个元素(,注:要在form里),另外在form的任意位置设置 代码如下: 注:a标签里不要有内容,在回传的地方调用 代 ...

  8. nodeJs爬虫小程序练习

    //爬虫小程序 var express = require('express'); //superagent是一个http的库,可以发起get和post请求 var superagent = requ ...

  9. Redis 存储机制

    Redis存储机制分成两种Snapshot和AOF.无论是那种机制,Redis都是将数据存储在内存中. Snapshot工作原理: 是将数据先存储在内存,然后当数据累计达到某些设定的伐值的时候,就会触 ...

  10. mysql 语文成绩大于80,数学成绩大于80

    mysql> select name from test where name = any(select name from test where chengj i > 80 and xu ...