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
查看文件是否正确
LAMP 2.1Apache不记录指定文件类型日志的更多相关文章
- nginx不记录指定文件类型日志
1.指定记录文件日志记录的内容. vim /usr/local/nginx/conf/nginx.conf如下部分: log_format dd '$remote_addr $http_x_forwa ...
- Apache 日志设置不记录指定文件类型的方法和日志轮
Apache日志精准的记录了Web访问的记录,但对于访问量很大的站来说,日志文件过大对于分析和保存很不方便.可以在http.conf(或虚拟主机设置文件httpd-vhosts.conf)中进行设置, ...
- nginx不记录指定文件类型的日志
1.指定记录文件日志记录的内容. vim /usr/local/nginx/conf/nginx.conf如下部分: log_format dd '$remote_addr $http_x_forwa ...
- HTML input="file" 浏览时只显示指定文件类型 xls、xlsx、csv
html input="file" 浏览时只显示指定文件类型 xls.xlsx.csv <input id="fileSelect" type=" ...
- <input type="file" />浏览时只显示指定文件类型
<input type="file" />浏览时只显示指定文件类型 <input type="file" accept="appli ...
- findstr 只搜寻指定文件类型
Title:findstr 只搜寻指定文件类型 --2012-05-04 09:27 findstr /i /m /S /C:"关键字" *.php *.asp *.jsp
- C# 获得目录下所有文件或指定文件类型文件(包含所有子文件夹)
public partial class FileGet { /// <summary> /// 私有变量 /// </summary> private static List ...
- Python,针对指定文件类型,过滤空行和注释,统计行数
参考网络上代码编辑而成,无技术含量,可自行定制: 目前亲测有效,若有待完善之处,还望指出! 强调:将此统计py脚本放置项目的根目录下执行即可. 1.遍历文件,递归遍历文件夹中的所有 def getFi ...
- python 读取指定文件夹中的指定文件类型的文件名
import numpy as np import os path = 'F:\\wenjian'#指定文件所在路径 filetype ='.csv'#指定文件类型 def get_filename( ...
随机推荐
- dr01_SetColor
1. TGraphicUnit.SetColor 2. 3.
- js模板方法
模板方法模式,定义一个操作中的算法的骨架,而将一些步骤延迟到子类中.模板方法使得子类可以不改变一个算法的结构即可重定义该算法的某些特定步骤.模板方法模式把不变行为搬到超类中,从而去除了子类中的重复代码 ...
- js 实现自动调出键盘
在app中,在页面加载完成之后,给输入框添加一个focus,不能自动调出软键盘,可以用以下方式实现: //触发键盘 $("#content").on("touchstar ...
- 184. Department Highest Salary
问题描述 解决方案 select b.Name Department,a.Name Employee,a.Salary from ( select e1.Salary,e1.Name,e1.Depar ...
- 有些事情不要强求 PS:日常收集语录
有些事情不要强求 1.有些事,我们明知道是错的,也要去坚持,因为不甘心:有些人,我们明知道是爱的,也要去放弃,因为没结局:有时候,我们明知道没路了,却还在前行,因为习惯了. 2.以为蒙上了眼睛,就可以 ...
- ebs R12 支持IE11
如果不考虑升级jdk到1.7的话,可以使用oracle推荐的方法. 1.兼容模式 2.Toolkit to Disable Automatic Delivery of Internet Explore ...
- LeetCode OJ:Contains DuplicateII(是否包含重复II)
Given an array of integers and an integer k, find out whether there are two distinct indices i and j ...
- [Unity3D]EZGUI 操作简单介绍
官方的GUI根本无法跟EZGUI比,无论是资源还是易用性还是速度.EZGUI基于Mesh不占DrawCall.EZGUI是自动合并Mesh成为一个物体,并且贴图自动制作Atlas.所以效率高,CPU消 ...
- boost bind function用法说明
目录(?)[+] 1 bind/function 引 (1)头文件 bind函数#include <boost/bind.hpp> function使用头文件#include <bo ...
- mount: error mounting /dev/root on /sysroot as ext3: Invalid argument
/************************************************************************ * mount: error mounting /d ...