??xml version="1.0" encoding="utf-8" standalone="yes"?>国产精品午夜视频,亚洲免费小视频,97超碰成人http://www.aygfsteel.com/void241/category/33573.htmlzh-cnSun, 28 Jun 2009 02:51:10 GMTSun, 28 Jun 2009 02:51:10 GMT60扚w清除Squid~存的小工具http://www.aygfsteel.com/void241/archive/2009/06/26/284230.htmlvoidvoidFri, 26 Jun 2009 02:17:00 GMThttp://www.aygfsteel.com/void241/archive/2009/06/26/284230.htmlhttp://www.aygfsteel.com/void241/comments/284230.htmlhttp://www.aygfsteel.com/void241/archive/2009/06/26/284230.html#Feedback0http://www.aygfsteel.com/void241/comments/commentRss/284230.htmlhttp://www.aygfsteel.com/void241/services/trackbacks/284230.html http://www.wa.apana.org.au/~dean/squidpurge/

wget http://www.wa.apana.org.au/~dean/sources/purge-20040201-src.tar.gz
tar zxvf purge-20040201-src.tar.gz
cd purge
make
[root@cache purge]# ./purge -help
### Use at your own risk! No guarantees whatsoever. You were warned. ###

$Id: purge.cc,v 1.17 2000/09/21 10:59:53 cached Exp $
Usage: purge   [-a] [-c cf] [-d l] [-(f|F) fn | -(e|E) re] [-p h[:p]]
                [-P #] [-s] [-v] [-C dir [-H]] [-n]

-a     display a little rotating thingy to indicate that I am alive (tty only).
-c c   squid.conf location, default "/usr/local/squid/etc/squid.conf".
-C dir base directory for content extraction (copy-out mode).
-d l   debug level, an OR of different debug options.
-e re single regular expression per -e instance (use quotes!).
-E re single case sensitive regular expression like -e.
-f fn name of textfile containing one regular expression per line.
-F fn name of textfile like -f containing case sensitive REs.
-H     prepend HTTP reply header to destination files in copy-out mode.
-n     do not fork() when using more than one cache_dir.
-p h:p cache runs on host h and optional port p, default is localhost:3128.
-P #   if 0, just print matches; otherwise OR the following purge modes:
           0x01 really send PURGE to the cache.
           0x02 remove all caches files reported as 404 (not found).
           0x04 remove all weird (inaccessible or too small) cache files.
        0 and 1 are recommended - slow rebuild your cache with other modes.
-s     show all options after option parsing, but before really starting.
-v     show more information about the file, e.g. MD5, timestamps and flags.

1.清除URL中包含jackbillow.com的所有缓?br /> ./purge -p 127.0.0.1:80 -P 1 -se 'jackbillow.com'

2.清除 URL ?#8220;.mp3”l尾的缓存文Ӟ例如Q?a target="_blank">http://www.jackbillow.com/abc/test.mp3
./purge -p 127.0.0.1:80 -P 1 -se '\.mp3$'


void 2009-06-26 10:17 发表评论
]]>
Squid~存命中率调整惨痛教?/title><link>http://www.aygfsteel.com/void241/archive/2009/06/26/284229.html</link><dc:creator>void</dc:creator><author>void</author><pubDate>Fri, 26 Jun 2009 02:16:00 GMT</pubDate><guid>http://www.aygfsteel.com/void241/archive/2009/06/26/284229.html</guid><wfw:comment>http://www.aygfsteel.com/void241/comments/284229.html</wfw:comment><comments>http://www.aygfsteel.com/void241/archive/2009/06/26/284229.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/void241/comments/commentRss/284229.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/void241/services/trackbacks/284229.html</trackback:ping><description><![CDATA[<p>公司的网站用Squid 2.6STABLE2作缓存加速服务器Q缓存的命中率一直不好,最好也只能辑ֈ90%Q折腾了怹Q终于发现媄响最大的原来只是一个小参数Q不q期间也学到了不东西~</p> <p>起初Q考虑~存命中率不高,考虑是不是给Squid的内存不够,所以就加大了内存配|,2G内存的机器给Squid 1G用,试了两天,l果基本没有什么大的改变;于是调整refresh_pattern的参敎ͼ增大内容~存旉Q测试了两天Q效果也不理惟?/p> <p>从kxn的文章中知道可以使用Expires模块让Apachel文件指定缓存时_期望可以提高~存性能Q于是在服务器上Q?br /> ExpiresActive On<br /> ExpiresDefault A2592000<br /> l果W二天一早发现缓存命中率竟然比前一天还下降?个百本点Q有Ҏ了~</p> <p>于是cachemgr配置hQ详l地查squid的运行状况,发现1G的内存缓存实际只用了不到300MQ所以显然不是内存不够的问题?/p> <p>Z充分利用内存Q将maximum_object_size_in_memory调大?28KBQ让其可以缓存更大的文gQ而不是默认的8KB。顺手将ufs换成aufsQ启用异步IO?/p> <p>之后情况E有改善Q?个小时之后,内存的占用达C1GQ但命中率ƈ没有明显上升?/p> <p>于是又调整了内存的覆盖策略(memory_replacement_policyQ,听从kxn的教Ԍ使用lruQ发现变化不大,也许是我们的讉K量还不大的原因吧?/p> <p>q时候缓存命中率仍然?0%以下徘徊。是不是我们的网站结构媄响只能达到这么高呢?但是|站l构我没有办法改变,所以还是要从其他方面入手来解决问题?/p> <p>于是使用Cache Manager 仔细的查看各个统计数据,当看到In-Memory and In-Transit Objects目Ӟ发现一个问题,那就是所有的|页文g都显CNOT_IN_MEMORYQ这比较奇怪了Q问什么访问量最大的|页文g竟然没有被缓 存到内存呢?是因为文件太大还是因为文件请求的数量太少Q所以才没有被缓存呢Q于是找了一个页面作试Q用工h看了q回的大,只有40K多一些,?我的maximum_object_size_in_memory最大?28KBq有相当大的差距Q所以不可能是这个原因。于是有使用abE序对这个页 面做?000ơ请求,心想q下M~存了吧。可是查看缓存内容,依然没有Q而且不但内存中没有,p盘上也没有Q?/p> <p>x得出l论Q一定是什么原因阻止了Squid对这些网进行缓存。仔l的查In-Memory and In-Transit Objects中的内容Q发现IN_MEMORY 状态的对象基本都是jpg和gif囑փ文gQhtml,css{文本文件内容则都没有缓存?/p> <p>q两U文件有什么不同吗Q记忆中Squid也没有对q些文gcd的设定呀Qrefresh_patternҎ有的静态文件的讄也都是一致的Q所以差异不应该来源于squid本n——也是因ؓq种记忆使得我后来多费了许多的功夫~</p> <p>在Apache上找C文本文g与图像文件之间设|的差异——deflate压羃。是不是所有用deflate压羃的内定w不会~存呢?使用同样 的squid软g版本及配|文Ӟ相同的Apache软g版本和配|,快速的搭徏了一套测试环境。squid只有1収ͼ重徏其磁盘缓冲区Q重新启?squidQ观察内存中对象的变化。果Ӟ对于deflate压羃的内容,squid内存中没有缓存,盘也找不到。停止apache的deflate?能,重新h面Q立卛_squid的内存中查到了内容的~存Q这么看来是squid和deflate不太兼容了?</p> <p>好吧Q先品环境Apache的deflate停掉Q过了一D|_有两台squid的缓存命中了提高C94%Q虽然只提升?个百分点Q但是这充分验证了squid和deflate不兼容的观点?/p> <p>然而,事情到此才刚刚开始!</p> <p>NSquid真的无法~存deflate压羃的页面吗Q好吧google一下,squid+deflateQ在squid的邮件列表中扑ֈ了一?讨论deflate的东西,属于比较古老的吧,说因为deflate压羃之后Q会产生Content-Encoding: gzipq样的HTTP头部Q属于HTTP/1.1的内容,而Squidq不完全兼容HTTP/1.1之类的,需要用Transfer-Encoding 之类的代替,可是mod_deflate和mod_gzip产生的头部就是Content-EncodingQ怎么办?</p> <p>Z解决q个问题Q引入了另一个Apache的模块,mod_headersQ用它来改写HTTP应答的头部,Content-Encoding更改lTransfer-EncodingQ可是,很自然的Q页面一片ؕ码!说明此\不通啊Q?/p> <p>又以Content-Encoding为关键字Q快速的搜烦了一下squid 2.6STABLE2的源代码Q也没有发现几个地方用到q个东西Q无果?/p> <p>l箋Google之,squid+can’t cache+Content-Encoding扑ֈ一文章,其中?#8217;SQUID would never bother to cache ANYTHING that had<br /> a “Vary:” header on it.’ 看来Squid~存内容与Vary: 头部有关pR再ơ检查一下HTTPhq回的头部内容,发现对于deflate压羃的内容,拥有”Vary: Accept-Encoding”q样一个头部,而没有经qdeflate压羃的内容则没有q个头部Q这ơ看来问题比较清楚了Q因为deflate压羃?加了Vary: Accept-Encodingq个头部Q导致了内容无法被squid~存?/p> <p>那么N真的没有办法让squid~存deflate压羃之后的内容吗Q?/p> <p>Z上面的经验,很自然的惛_使用mod_headers模块的功能将Vary头抹掉Squid不就可以~存了吗Q后来一惻Iq样会有其它问题Q?1)如果用户览器不支持gzip压羃功能Q那么将无法正常的浏览网;2)其它可能很重要的Vary内容也没有了Q可能会D更大的隐患。那么这U办?不行?/p> <p>q有其它的办法吗Q再ơ的快速搜索了Squid的源文g中关于Vary的内容,在Changelog中找Cq么一条:<br /> - Full ETag/Vary support, caching responses which varies with request details (browser, language etc).<br /> 也就是说已经完全支持带ETag/Vary头部的内容缓存了。这一条出现在Changes to squid-2.6.STABLE1Q也是说在Squid2.6STABLE1已l完全实Cq个功能Q那?.6STABLE2应该没有问题Q会?会是2.6STABLE2的BUG呢,查询了一?.6pd的所有ChangelogQ没有提到此故障的信息。推断我们的故障要么׃个未知BUGDQ?要么是自己配|不当。BUG的问题我无法认Q只能先从配|入手?/p> <p>找来一?.6STABLE2带的默认配置文gQ搜索VaryQ第一条:<br /> # TAG: cache_vary<br /> # Set to off to disable caching of Vary:in objects.<br /> #<br /> #Default:<br /> # cache_vary on<br /> N我的配置文g是off不成Q赶紧检查,发现q真是offQsignQ原来就是这个问题折我Q改成onQ将Apache的Deflate配置启用Q再观察内存对象Q发现静态网늜的被~存了!</p> <p>郁闷了许久,l于可以村֏气了?/p> <p>q了一会儿Q再查看Squid的状态,发现~存命中率没有下降,E_?4%左右?/p> <p>也许Squidq有什么可挖掘的空间吧Q改天接着折腾Q?/p> <p>后记QSquid对Vary和Etag的支持属?.6的一主要改q,q一Ҏ改qSquid对HTTP/1.1标准的支持。在Squid升 ?.6之前Q也看过他的ChangelogQ但当时q不明白Vary到底有什么用途,q么一折腾Q明白了不少。看来应该把HTTP/1.1的标准再好好 研读一下?/p> <p><br /> 本文来自CSDN博客Q{载请标明出处Qhttp://blog.csdn.net/chinalinuxzend/archive/2007/09/12/1781563.aspx</p> <img src ="http://www.aygfsteel.com/void241/aggbug/284229.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/void241/" target="_blank">void</a> 2009-06-26 10:16 <a href="http://www.aygfsteel.com/void241/archive/2009/06/26/284229.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Squid上徏立SSL代理转发http://www.aygfsteel.com/void241/archive/2008/08/28/225396.htmlvoidvoidThu, 28 Aug 2008 11:33:00 GMThttp://www.aygfsteel.com/void241/archive/2008/08/28/225396.htmlhttp://www.aygfsteel.com/void241/comments/225396.htmlhttp://www.aygfsteel.com/void241/archive/2008/08/28/225396.html#Feedback0http://www.aygfsteel.com/void241/comments/commentRss/225396.htmlhttp://www.aygfsteel.com/void241/services/trackbacks/225396.html今天试了一下在squid上徏一个ssl代理转发.其实也蛮Ҏ?

  1. https_port 443 cert=/etc/squid/SSL.CRT key=/etc/squid/SSL.KEY defaultsite=ssl.php-oa.com
  2. cache_peer ssl.php-oa.com parent 80 o no-query no-digest originserver name=www
  3. cache_peer_homain www .php-oa.com

其实真的很容?是吧.有个https_port和cache_peer加上那个ssl的地址基本好?记的https_port要加defaultsite.不加会下面错

The following error was encountered:

Invalid Request

Some aspect of the HTTP Request is invalid. Possible problems:

Missing or unknown request method

Missing URL

Missing HTTP Identifier (HTTP/1.0)

Request is too large

Content-Length missing for POST or PUT requests

Illegal character in hostname; underscores are not allowed

?/p>

可以使用下面命o可以生成试用的证书Q?/p>

openssl req -new -keyout key.pem -nodes -x509 -days 365 -out cert.pem

 

如果要生成一个证书请求用于申h式证书请用下面两个命令:

1.生成U钥 openssl genrsa -out key.pem 1024
2.生成待签名证?openssl req -new -out req.csr -key key.pem

然后req.csr文g中的内容提交l证书颁发机构?/p>

void 2008-08-28 19:33 发表评论
]]>
Linux Squid安装调试中常用命令介l?/title><link>http://www.aygfsteel.com/void241/archive/2008/08/08/220798.html</link><dc:creator>void</dc:creator><author>void</author><pubDate>Thu, 07 Aug 2008 16:52:00 GMT</pubDate><guid>http://www.aygfsteel.com/void241/archive/2008/08/08/220798.html</guid><wfw:comment>http://www.aygfsteel.com/void241/comments/220798.html</wfw:comment><comments>http://www.aygfsteel.com/void241/archive/2008/08/08/220798.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/void241/comments/commentRss/220798.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/void241/services/trackbacks/220798.html</trackback:ping><description><![CDATA[<p>  <span style="color: #3366ff">1?/span><span style="color: #3366ff">初始化你?squid.conf 里配|的 cache 目录</span></p> <p>  #squid/sbin/squid -z //W一ơ启动squid服务时必输入此命o</p> <p>  如果有错误提C,h查你?cache目录的权限?/p> <p>  <span style="color: #3366ff">2、对你的squid.conf 排错Q即验证 squid.conf ?语法和配|?/span></p> <p>  #squid/sbin/squid -k parse</p> <p>  如果squid.conf 有语法或配置错误Q这里会q回提示你,如果没有q回Q恭喜,可以试启动squid?/p> <p>  <span style="color: #3366ff">3、在前台启动squidQƈ输出启动q程?/span></p> <p>  #squid/sbin/squid -N -d1</p> <p>  如果有到 ready to server requesQ恭喜,启动成功?/p> <p>  然后 ctrl + cQ停止squidQƈ以后台运行的方式启动它?/p> <p>  <span style="color: #3366ff">4、启动squid在后台运行?/span></p> <p>  #squid/sbin/squid -s</p> <p>  q时候可?ps -A 来查看系l进E,可以看到俩个 squid q程?/p> <p>  <span style="color: #3366ff">5、停?squid</span></p> <p>  #squid/sbin/squid -k shutdown</p> <p>  q个不用解释吧?/p> <p>  <span style="color: #3366ff">6、重引导修改q的 squid.conf</span></p> <p>  #squid/sbin/squid -k reconfigure</p> <p>  q个估计用的时候比较多Q当你发C的配|有不尽你意的时候,可以随时修改squid.confQ然后别忘记对你?squid.conf排错Q然后再执行此指令,卛_让运行中squid重新按照你的squid.conf 来运行?/p> <p>  <span style="color: #3366ff">7、把squidd到系l启动项</span></p> <p>  ~辑 /etc/rc.d/rc.local</p> <p>  d如下行: /usr/local/squid/sbin/squid -s</p> <p>  当然Qƈ不是每个人都喜欢q种启动方式Q你可以用你最习惯的方?或者把它安装ؓ服务?/p> <p>  再来点其他的?/p> <p>  <span style="color: #3366ff">1、修改cache ~存目录的权限?/span></p> <p>  #chown -R squid:squid /home/cache</p> <p>  我的cache~存目录?/home/cache,squid执行用户和用L?squidQsquid?/p> <p>  <span style="color: #3366ff">2、修改squid 日志目录的权?/span></p> <p>  #chown -R squid:squid /usr/local/squid/var/logs</p> <p>  q一步ƈ不是适合每一个用squid的用?意ؓ让squid有权限在该目录进行写操作 ?/p> <p>  例如生成 access.log cache.log store.log</p> <p>  <span style="color: #3366ff">3、查看你的日志文?/span></p> <p>  #more /usr/local/squid/var/logs/access.log | grep TCP_MEM_HIT</p> <p>  该指令可以看到在squidq行q程中,有那些文件被squid~存到内存中Qƈq回l访问用戗?/p> <p>  #more /usr/local/squid/var/logs/access.log | grep TCP_HIT</p> <p>  该指令可以看到在squidq行q程中,有那些文件被squid~存到cache目录中,q返回给讉K用户?/p> <p>  #more /usr/local/squid/var/logs/access.log | grep TCP_MISS</p> <p>  该指令可以看到在squidq行q程中,有那些文件没有被squid~存Q而是现重原始服务器获取ƈq回l访问用戗?/p> <p>  关于 TCP_XXXX {参数及代表的信息,请参看www.chinaunix.org彭勇华《squid中文权威指南?3.2.1 章节?/p> <p>  当然Q本例中的蓝色文字是可以修改为其他的参数Q例如你的域?www.xxxx.com Q同样可以看到access.log里关于该域名的行?/p> <p>  <span style="color: #3366ff">4、squid -k rotate 轮换squid的日志文?var/log/squid,Squid代理服务器日志文?/span></p> <p>  的增镉K度是惊人的,很容易点球满盘I间Dpȝ不能正常工作,甚至是死?Z解决日志文g增长太快的问?squid采用?轮换"的方?在squid.conf中可以通过logfile_rotate来设|文件轮换的个数,?</p> <p>  logfile_rotate 10 ,轮换的工作一般用crontab定时器完在周期性的日志轮换,例如每周六凌?:00q行日志轮换,则执行如下命? crontab -e</p> <p>  0 2 * * 6 squid -k rotate</p> <p>  脓?Squid默认的错误提CZ息ؓ英文,对于英文不好的用h?实在不方??etc/squid/squid.conf里添加如?</p> <p>  error_directory /usr/share/squid/errors/Simplify_Chinese 卛_昄中文的错误提C?/p> <img src ="http://www.aygfsteel.com/void241/aggbug/220798.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/void241/" target="_blank">void</a> 2008-08-08 00:52 <a href="http://www.aygfsteel.com/void241/archive/2008/08/08/220798.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>squid2.6下的防盗链设|?/title><link>http://www.aygfsteel.com/void241/archive/2008/08/07/220609.html</link><dc:creator>void</dc:creator><author>void</author><pubDate>Thu, 07 Aug 2008 03:40:00 GMT</pubDate><guid>http://www.aygfsteel.com/void241/archive/2008/08/07/220609.html</guid><wfw:comment>http://www.aygfsteel.com/void241/comments/220609.html</wfw:comment><comments>http://www.aygfsteel.com/void241/archive/2008/08/07/220609.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/void241/comments/commentRss/220609.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/void241/services/trackbacks/220609.html</trackback:ping><description><![CDATA[<p>#文g防盗?br /> acl legalreferer referer_regex ^http://www.linuxbyte.org ^http://[a-z].*\.linuxbyte\.org Q受保护的站点和允许的域名)<br /> acl fileurl url_regex -i \.rar$ \.zip$ \.iso$ \.bmp$ \.png$ \.gif$ \.jpg$  \.jpeg$ Q受保护的文件名后缀Q?br /> http_access deny !legalreferer fileurl</p> <p></p> <p>#对多媒体文g的防盗链,能让播放器在U播?但不能盗?<br /> acl legalplayer browser -i  ^windows-media-player  ^RealMedia  ^Mozilla ^foobar2000 ^nsplayer ^contype$ ^rma<br /> acl mfurl url_regex -i \.wma$ \.wmv$ \.mp3$ \.mp4$ \.flv$ \.avi$ \.asf$ \.mpg$ \.mpeg$ \.rmvb$ \.rm$<br /> http_access allow legalplayer mfurl<br /> http_access deny !legalreferer mfurl</p> <img src ="http://www.aygfsteel.com/void241/aggbug/220609.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/void241/" target="_blank">void</a> 2008-08-07 11:40 <a href="http://www.aygfsteel.com/void241/archive/2008/08/07/220609.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss> <footer> <div class="friendship-link"> <a href="http://www.aygfsteel.com/" title="狠狠久久亚洲欧美专区_中文字幕亚洲综合久久202_国产精品亚洲第五区在线_日本免费网站视频">狠狠久久亚洲欧美专区_中文字幕亚洲综合久久202_国产精品亚洲第五区在线_日本免费网站视频</a> </div> </footer> վ֩ģ壺 <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">ƽ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">ƽɽ</a>| <a href="http://" target="_blank">Ͽ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">Ҷ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">ƽ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">ƽԶ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">Դ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">ʲ</a>| <a href="http://" target="_blank">µ</a>| <a href="http://" target="_blank">ˮ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">Խ</a>| <a href="http://" target="_blank">ʡ</a>| <a href="http://" target="_blank">ƽ</a>| <a href="http://" target="_blank">ʯɽ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">ɽʡ</a>| <a href="http://" target="_blank">̨</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">ͼ</a>| <a href="http://" target="_blank">ξ</a>| <a href="http://" target="_blank">ɽ</a>| <a href="http://" target="_blank">«</a>| <script> (function(){ var bp = document.createElement('script'); var curProtocol = window.location.protocol.split(':')[0]; if (curProtocol === 'https') { bp.src = 'https://zz.bdstatic.com/linksubmit/push.js'; } else { bp.src = 'http://push.zhanzhang.baidu.com/push.js'; } var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(bp, s); })(); </script> </body>