Skip to content

Commit 7a5655d

Browse files
author
liuyu
committedJul 1, 2014
message
1 parent eb1a9cc commit 7a5655d

File tree

363 files changed

+95067
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

363 files changed

+95067
-0
lines changed
 

‎2010/12/17/apache-etag-expires-gzip/index.html

+408
Large diffs are not rendered by default.
+393
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,393 @@
1+
2+
<!DOCTYPE HTML>
3+
<html lang="zh-CN">
4+
<head>
5+
<meta charset="UTF-8">
6+
7+
<title>Apache filter log | Liuyu Blog</title>
8+
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=3, minimum-scale=1">
9+
10+
<meta name="author" content="Liu Yu">
11+
12+
<meta name="description" content="Apache过滤掉无需记录的日志方法。
13+
在httpd.conf的
14+
LogFormat &amp;quot;%{X-Forwarded-For}i %l %u %t \&amp;quot;%r\&amp;quot; %&amp;amp;gt;s %b \&amp;quot;%{Referer}i\&amp;quot; \&amp;quot;%{User-A">
15+
16+
17+
18+
19+
20+
<link rel="icon" href="/img/favicon.ico">
21+
22+
23+
<link rel="apple-touch-icon" href="/img/pacman.jpg">
24+
<link rel="apple-touch-icon-precomposed" href="/img/pacman.jpg">
25+
26+
<link rel="stylesheet" href="/css/style.css" type="text/css">
27+
</head>
28+
29+
<body>
30+
<header>
31+
<div>
32+
33+
<div id="imglogo">
34+
<a href="/"><img src="/img/logo.svg" alt="Liuyu Blog" title="Liuyu Blog"/></a>
35+
</div>
36+
37+
<div id="textlogo">
38+
<h1 class="site-name"><a href="/" title="Liuyu Blog">Liuyu Blog</a></h1>
39+
<h2 class="blog-motto">Puppet in action</h2>
40+
</div>
41+
<div class="navbar"><a class="navbutton navmobile" href="#" title="菜单">
42+
</a></div>
43+
<nav class="animated">
44+
<ul>
45+
<ul>
46+
47+
<li><a href="/">Home</a></li>
48+
49+
<li><a href="/archives">Archives</a></li>
50+
51+
<li>
52+
53+
<form class="search" action="//google.com/search" method="get" accept-charset="utf-8">
54+
<label>Search</label>
55+
<input type="text" id="search" name="q" autocomplete="off" maxlength="20" placeholder="搜索" />
56+
<input type="hidden" name="q" value="site:bubbyroom.com">
57+
</form>
58+
59+
</li>
60+
</ul>
61+
</nav>
62+
</div>
63+
64+
</header>
65+
<div id="container">
66+
<div id="main" class="post" itemscope itemprop="blogPost">
67+
<article itemprop="articleBody">
68+
<header class="article-info clearfix">
69+
<h1 itemprop="name">
70+
71+
<a href="/2010/12/17/apache-exclude-log/" title="Apache filter log" itemprop="url">Apache filter log</a>
72+
</h1>
73+
<p class="article-author">By
74+
75+
<a href="http://bubbyroom.com" title="Liu Yu">Liu Yu</a>
76+
</p>
77+
<p class="article-time">
78+
<time datetime="2010-12-17T10:51:14.000Z" itemprop="datePublished">12月 17 2010</time>
79+
更新日期:<time datetime="2014-07-01T05:23:52.000Z" itemprop="dateModified">7月 1 2014</time>
80+
81+
</p>
82+
</header>
83+
<div class="article-content">
84+
85+
86+
<div id="toc" class="toc-article">
87+
<strong class="toc-title">文章目录</strong>
88+
89+
</div>
90+
91+
<p>Apache过滤掉无需记录的日志方法。</p>
92+
<p>在httpd.conf的</p>
93+
<p><code>LogFormat &quot;%{X-Forwarded-For}i %l %u %t \&quot;%r\&quot; %&amp;gt;s %b \&quot;%{Referer}i\&quot; \&quot;%{User-Agent}i\&quot;&quot; combined</code></p>
94+
<p>后面加入如下:</p>
95+
<pre><code><span class="preprocessor"># filter the localhost visit</span>
96+
SetEnvIf Remote_Addr <span class="string">"127\.0\.0\.1"</span> dontlog
97+
<span class="preprocessor"># filter some special directories</span>
98+
SetEnvIf Request_URI <span class="string">"^ZendPlatform.*$"</span> dontlog
99+
SetEnvIf Request_URI \.healthcheck\.html$ dontlog
100+
SetEnvIf Remote_Addr <span class="string">"::1"</span> dontlog
101+
SetEnvIf Request_URI <span class="string">"\.getPing.php$"</span> dontlog
102+
SetEnvIf Request_URI <span class="string">"^/error\.html$"</span> dontlog
103+
SetEnvIf Request_URI <span class="string">"\.gif$"</span> dontlog
104+
SetEnvIf Request_URI <span class="string">"\.jpg$"</span> dontlog
105+
SetEnvIf Request_URI <span class="string">"\.css$"</span> dontlog
106+
</code></pre><p>其它根据自己的需要做一些调整。</p>
107+
<p>另一种日志不记录图片的方法</p>
108+
<pre><code><span class="attribute">SetEnv dontlog 1
109+
CustomLog logs/access_log combined env</span>=<span class="string">!dontlog</span>
110+
</code></pre>
111+
</div>
112+
<footer class="article-footer clearfix">
113+
114+
<div class="article-tags">
115+
116+
<span></span> <a href="/tags/apache/">apache</a>
117+
</div>
118+
119+
120+
<div class="article-categories">
121+
<span></span>
122+
<a class="article-category-link" href="/categories/Webserver/">Webserver</a>
123+
</div>
124+
125+
126+
127+
<div class="article-share" id="share">
128+
129+
<div data-url="http://bubbyroom.com/2010/12/17/apache-exclude-log/" data-title="Apache filter log | Liuyu Blog" data-tsina="null" class="share clearfix">
130+
</div>
131+
132+
</div>
133+
</footer>
134+
</article>
135+
136+
<nav class="article-nav clearfix">
137+
138+
<div class="prev" >
139+
<a href="/2010/12/17/apache-mod_cband/" title="Apache bandwidth Limit mod_cband ">
140+
<strong>PREVIOUS:</strong><br/>
141+
<span>
142+
Apache bandwidth Limit mod_cband </span>
143+
</a>
144+
</div>
145+
146+
147+
<div class="next">
148+
<a href="/2010/12/17/apache-referer/" title="Apache referer AccessKey">
149+
<strong>NEXT:</strong><br/>
150+
<span>Apache referer AccessKey
151+
</span>
152+
</a>
153+
</div>
154+
155+
</nav>
156+
157+
158+
</div>
159+
<div class="openaside"><a class="navbutton" href="#" title="显示侧边栏"></a></div>
160+
161+
<div id="toc" class="toc-aside">
162+
<strong class="toc-title">文章目录</strong>
163+
164+
</div>
165+
166+
<div id="asidepart">
167+
<div class="closeaside"><a class="closebutton" href="#" title="隐藏侧边栏"></a></div>
168+
<aside class="clearfix">
169+
170+
171+
<div class="categorieslist">
172+
<p class="asidetitle">分类</p>
173+
<ul>
174+
175+
<li><a href="/categories/Cache/" title="Cache">Cache<sup>1</sup></a></li>
176+
177+
<li><a href="/categories/Commands/" title="Commands">Commands<sup>15</sup></a></li>
178+
179+
<li><a href="/categories/Databases/" title="Databases">Databases<sup>5</sup></a></li>
180+
181+
<li><a href="/categories/Faq/" title="Faq">Faq<sup>21</sup></a></li>
182+
183+
<li><a href="/categories/Howtoforge/" title="Howtoforge">Howtoforge<sup>3</sup></a></li>
184+
185+
<li><a href="/categories/Lives/" title="Lives">Lives<sup>2</sup></a></li>
186+
187+
<li><a href="/categories/Monitoring/" title="Monitoring">Monitoring<sup>6</sup></a></li>
188+
189+
<li><a href="/categories/Programming/" title="Programming">Programming<sup>7</sup></a></li>
190+
191+
<li><a href="/categories/Puppet/" title="Puppet">Puppet<sup>11</sup></a></li>
192+
193+
<li><a href="/categories/Webserver/" title="Webserver">Webserver<sup>18</sup></a></li>
194+
195+
<li><a href="/categories/cdn/" title="cdn">cdn<sup>6</sup></a></li>
196+
197+
</ul>
198+
</div>
199+
200+
201+
202+
<div class="tagslist">
203+
<p class="asidetitle">标签</p>
204+
<ul class="clearfix">
205+
206+
<li><a href="/tags/1032/" title="1032">1032<sup>1</sup></a></li>
207+
208+
<li><a href="/tags/1236/" title="1236">1236<sup>1</sup></a></li>
209+
210+
<li><a href="/tags/403/" title="403">403<sup>1</sup></a></li>
211+
212+
<li><a href="/tags/Cache-control/" title="Cache-control">Cache-control<sup>2</sup></a></li>
213+
214+
<li><a href="/tags/Cluster-bacst/" title="Cluster-bacst">Cluster-bacst<sup>1</sup></a></li>
215+
216+
<li><a href="/tags/E752x/" title="E752x">E752x<sup>1</sup></a></li>
217+
218+
<li><a href="/tags/Lives/" title="Lives">Lives<sup>1</sup></a></li>
219+
220+
<li><a href="/tags/Monitoring/" title="Monitoring">Monitoring<sup>1</sup></a></li>
221+
222+
<li><a href="/tags/Python-Imaging-Library/" title="Python Imaging Library">Python Imaging Library<sup>1</sup></a></li>
223+
224+
<li><a href="/tags/Smokeping/" title="Smokeping">Smokeping<sup>1</sup></a></li>
225+
226+
<li><a href="/tags/Zabbix/" title="Zabbix">Zabbix<sup>1</sup></a></li>
227+
228+
<li><a href="/tags/acl/" title="acl">acl<sup>2</sup></a></li>
229+
230+
<li><a href="/tags/allcommands/" title="allcommands">allcommands<sup>1</sup></a></li>
231+
232+
<li><a href="/tags/apache/" title="apache">apache<sup>8</sup></a></li>
233+
234+
<li><a href="/tags/arp/" title="arp">arp<sup>1</sup></a></li>
235+
236+
<li><a href="/tags/awk/" title="awk">awk<sup>4</sup></a></li>
237+
238+
<li><a href="/tags/bash/" title="bash">bash<sup>2</sup></a></li>
239+
240+
<li><a href="/tags/binding/" title="binding">binding<sup>1</sup></a></li>
241+
242+
<li><a href="/tags/binlog/" title="binlog">binlog<sup>1</sup></a></li>
243+
244+
<li><a href="/tags/bnx2/" title="bnx2">bnx2<sup>1</sup></a></li>
245+
246+
</ul>
247+
</div>
248+
249+
250+
<div class="rsspart">
251+
<a href="null" target="_blank" title="rss">RSS 订阅</a>
252+
</div>
253+
254+
</aside>
255+
</div>
256+
</div>
257+
<footer><div id="footer" >
258+
259+
<div class="line">
260+
<span></span>
261+
<div class="author"></div>
262+
</div>
263+
264+
265+
<div class="social-font" class="clearfix">
266+
267+
268+
269+
270+
</div>
271+
<p class="copyright">Powered by <a href="http://zespia.tw/hexo/" target="_blank" title="hexo">hexo</a> and Theme by <a href="https://github.com/A-limon/pacman" target="_blank" title="Pacman">Pacman</a> © 2014
272+
273+
<a href="http://bubbyroom.com" target="_blank" title="Liu Yu">Liu Yu</a>
274+
275+
</p>
276+
</div>
277+
</footer>
278+
<script src="/js/jquery-2.1.0.min.js"></script>
279+
<script type="text/javascript">
280+
$(document).ready(function(){
281+
$('.navbar').click(function(){
282+
$('header nav').toggleClass('shownav');
283+
});
284+
var myWidth = 0;
285+
function getSize(){
286+
if( typeof( window.innerWidth ) == 'number' ) {
287+
myWidth = window.innerWidth;
288+
} else if( document.documentElement && document.documentElement.clientWidth) {
289+
myWidth = document.documentElement.clientWidth;
290+
};
291+
};
292+
var m = $('#main'),
293+
a = $('#asidepart'),
294+
c = $('.closeaside'),
295+
o = $('.openaside');
296+
$(window).resize(function(){
297+
getSize();
298+
if (myWidth >= 1024) {
299+
$('header nav').removeClass('shownav');
300+
}else
301+
{
302+
m.removeClass('moveMain');
303+
a.css('display', 'block').removeClass('fadeOut');
304+
o.css('display', 'none');
305+
306+
$('#toc.toc-aside').css('display', 'none');
307+
308+
}
309+
});
310+
c.click(function(){
311+
a.addClass('fadeOut').css('display', 'none');
312+
o.css('display', 'block').addClass('fadeIn');
313+
m.addClass('moveMain');
314+
});
315+
o.click(function(){
316+
o.css('display', 'none').removeClass('beforeFadeIn');
317+
a.css('display', 'block').removeClass('fadeOut').addClass('fadeIn');
318+
m.removeClass('moveMain');
319+
});
320+
$(window).scroll(function(){
321+
o.css("top",Math.max(80,260-$(this).scrollTop()));
322+
});
323+
});
324+
</script>
325+
326+
<script type="text/javascript">
327+
$(document).ready(function(){
328+
var ai = $('.article-content>iframe'),
329+
ae = $('.article-content>embed'),
330+
t = $('#toc'),
331+
h = $('article h2')
332+
ah = $('article h2'),
333+
ta = $('#toc.toc-aside'),
334+
o = $('.openaside'),
335+
c = $('.closeaside');
336+
if(ai.length>0){
337+
ai.wrap('<div class="video-container" />');
338+
};
339+
if(ae.length>0){
340+
ae.wrap('<div class="video-container" />');
341+
};
342+
if(ah.length==0){
343+
t.css('display','none');
344+
}else{
345+
c.click(function(){
346+
ta.css('display', 'block').addClass('fadeIn');
347+
});
348+
o.click(function(){
349+
ta.css('display', 'none');
350+
});
351+
$(window).scroll(function(){
352+
ta.css("top",Math.max(140,320-$(this).scrollTop()));
353+
});
354+
};
355+
});
356+
</script>
357+
358+
359+
<script type="text/javascript">
360+
$(document).ready(function(){
361+
var $this = $('.share'),
362+
url = $this.attr('data-url'),
363+
encodedUrl = encodeURIComponent(url),
364+
title = $this.attr('data-title'),
365+
tsina = $this.attr('data-tsina');
366+
var html = [
367+
'<a href="#" class="overlay" id="qrcode"></a>',
368+
'<div class="qrcode clearfix"><span>扫描二维码分享到微信朋友圈</span><a class="qrclose" href="#share"></a><strong>Loading...Please wait</strong><img id="qrcode-pic" data-src="http://s.jiathis.com/qrcode.php?url=' + encodedUrl + '"/></div>',
369+
'<a href="#textlogo" class="article-back-to-top" title="Top"></a>',
370+
'<a href="https://www.facebook.com/sharer.php?u=' + encodedUrl + '" class="article-share-facebook" target="_blank" title="Facebook"></a>',
371+
'<a href="#qrcode" class="article-share-qrcode" title="QRcode"></a>',
372+
'<a href="https://twitter.com/intent/tweet?url=' + encodedUrl + '" class="article-share-twitter" target="_blank" title="Twitter"></a>',
373+
'<a href="http://service.weibo.com/share/share.php?title='+title+'&url='+encodedUrl +'&ralateUid='+ tsina +'&searchPic=true&style=number' +'" class="article-share-weibo" target="_blank" title="Weibo"></a>',
374+
'<span title="Share to"></span>'
375+
].join('');
376+
$this.append(html);
377+
$('.article-share-qrcode').click(function(){
378+
var imgSrc = $('#qrcode-pic').attr('data-src');
379+
$('#qrcode-pic').attr('src', imgSrc);
380+
$('#qrcode-pic').load(function(){
381+
$('.qrcode strong').text(' ');
382+
});
383+
});
384+
});
385+
</script>
386+
387+
388+
389+
390+
391+
392+
</body>
393+
</html>

0 commit comments

Comments
 (0)
Please sign in to comment.