<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
<channel>
<title><![CDATA[DZEND--C#学习乐园]]></title>
<link>http://www.dzend.com/</link>
<description><![CDATA[创造机会的人是勇者；等待机会的人是愚者]]></description>
<language>zh-cn</language>
<copyright><![CDATA[Copyright 2005 PBlog2 v2.4]]></copyright>
<webMaster><![CDATA[jiangdazheng@163.com(寻梦)]]></webMaster>
<generator>PBlog2 v2.4</generator> 
<image>
	<title>DZEND--C#学习乐园</title> 
	<url>http://www.dzend.com/images/logos.gif</url> 
	<link>http://www.dzend.com/</link> 
	<description>DZEND--C#学习乐园</description> 
</image>

			<item>
			<link>http://www.dzend.com/default.asp?id=196</link>
			<title><![CDATA[在SSH Linux中文解决乱码的技巧]]></title>
			<author>jiangdazheng@163.com(admin)</author>
			<category><![CDATA[squid]]></category>
			<pubDate>Thu,12 Nov 2009 21:10:37 +0800</pubDate>
			<guid>http://www.dzend.com/default.asp?id=196</guid>	
		<description><![CDATA[修改/etc/sysconfig/i18n文件，将其改成以下内容： <br />LANG=&quot;zh_CN.GB18030&quot;<br />LANGUAGE=&quot;zh_CN.GB18030:zh_CN.GB2312:zh_CN&quot;<br />SUPPORTED=&quot;zh_CN.UTF-8:zh_CN:zh:en_US.UTF-8:en_US:en&quot;<br />SYSFONT=&quot;latarcyrheb-sun16&quot; <br />]]></description>
		</item>
		
			<item>
			<link>http://www.dzend.com/default.asp?id=195</link>
			<title><![CDATA[test]]></title>
			<author>jiangdazheng@163.com(admin)</author>
			<category><![CDATA[squid]]></category>
			<pubDate>Thu,12 Nov 2009 21:09:00 +0800</pubDate>
			<guid>http://www.dzend.com/default.asp?id=195</guid>	
		<description><![CDATA[test]]></description>
		</item>
		
			<item>
			<link>http://www.dzend.com/default.asp?id=194</link>
			<title><![CDATA[rhel5下安装GCC]]></title>
			<author>jiangdazheng@163.com(admin)</author>
			<category><![CDATA[squid]]></category>
			<pubDate>Thu,12 Nov 2009 21:05:49 +0800</pubDate>
			<guid>http://www.dzend.com/default.asp?id=194</guid>	
		<description><![CDATA[<style type="text/css">
.UBBPanel{border:1px solid #B4A79C;background:#FCF9EF;border-left:3px solid;}
.UBBTitle{font-weight:bold;padding:4px;background:#F7EFD6 url('http://www.dzend.com/skins/OURB2C/ubbback.gif') no-repeat 400px 0px;
border-bottom:1px dotted #B4A79C;
}
.UBBContent{padding:6px;line-height:160%;}
</style>今天安装GCC时报错,错误如下:<br />
<div class="UBBPanel">
<div class="UBBTitle"><img alt="程序代码" src="http://www.dzend.com/images/code.gif" /> 程序代码</div>
<div class="UBBContent"><br />error: Failed dependencies:<br />cpp = 4.1.1-52.el5 is needed by gcc-4.1.1-52.el5.i386<br />libgomp = 4.1.1-52.el5 is needed by gcc-4.1.1-52.el5.i386<br />libgomp.so.1 is needed by gcc-4.1.1-52.el5.i386<br /></div>
</div>
<br /><br />找了好久的资料,最后终于找到一些相关的,先安装<br />1.libgomp <br />2.cpp<br />3.gcc<br />]]></description>
		</item>
		
			<item>
			<link>http://www.dzend.com/default.asp?id=193</link>
			<title><![CDATA[squid 2.6之Web反向代理加速实做/防盗链/防盗用/防爬虫]]></title>
			<author>jiangdazheng@163.com(admin)</author>
			<category><![CDATA[squid]]></category>
			<pubDate>Tue,16 Dec 2008 10:05:02 +0800</pubDate>
			<guid>http://www.dzend.com/default.asp?id=193</guid>	
		<description><![CDATA[<font size="2">2.6相对2.5有了一些改变，大家可以去看：http://www.squid-cache.org/Versions/v2/2.6/<br /><br />　　1. 下载squid2.6 http://www.squid-cache.org/Versions/v2/2.6/squid-2.6.STABLE1-20060726.tar.gz<br /><br />　　2. 安装：<br /><br /></font>
<div class="altbg2" id="code0" style="CLEAR: both; BORDER-RIGHT: #698cc3 1px solid; PADDING-RIGHT: 10px; BORDER-TOP: #698cc3 1px solid; PADDING-LEFT: 10px; PADDING-BOTTOM: 10px; MARGIN: 3px 2em 2em; BORDER-LEFT: #698cc3 1px solid; WORD-BREAK: break-all; PADDING-TOP: 5px; BORDER-BOTTOM: #698cc3 1px solid; FONT-FAMILY: fixedsys">wwwtest137#tar xzvf squid-2.6.STABLE1-20060726.tar.gz<br />wwwtest137#cd squid-2.6.STABLE1-20060726<br />wwwtest137#configure --prefix=/usr/local/squid --enable-dlmalloc --with-pthreads --enable-poll --disable-internal-dns --enable-stacktrace --enable-removal-policies=&quot;heap,lru&quot; --enable-delay-pools --enable-storeio=&quot;aufs,coss,diskd,ufs&quot;<br />wwwtest137#make <br />wwwtest137#make install</div>
　　安装完成了。<br />　　因为是测试的，所以相关的参数可能并不是比较完善的，但是使用是没有问题的。<br /><br />　　3. 配置：以下是部分关键配置，其他与2.5的相同<br /><br />
<div class="altbg2" id="code1" style="CLEAR: both; BORDER-RIGHT: #698cc3 1px solid; PADDING-RIGHT: 10px; BORDER-TOP: #698cc3 1px solid; PADDING-LEFT: 10px; PADDING-BOTTOM: 10px; MARGIN: 3px 2em 2em; BORDER-LEFT: #698cc3 1px solid; WORD-BREAK: break-all; PADDING-TOP: 5px; BORDER-BOTTOM: #698cc3 1px solid; FONT-FAMILY: fixedsys">#squid.conf<br />#服务器IP 192.168.1.1<br />#监听服务器的80端口，透明代理，支持域名和IP的虚拟主机<br />http_port 192.168.1.1:80 transparent vhost vport<br /><br />#限制同一IP客户端的最大连接数<br />acl OverConnLimit maxconn 16<br />http_access deny OverConnLimit<br /><br />#防止天涯盗链，转嫁给百度<br />acl tianya referer_regex -i tianya<br />http_access deny tianya<br />deny_info http://www.baidu.com/logs.gif tianya<br /><br />#防止被人利用为HTTP代理，设置允许访问的IP地址<br />acl myip dst 192.168.1.1 <br />http_access deny !myip<br /><br />#防止百度机器人爬死服务器<br />acl AntiBaidu req_header User-Agent Baiduspider<br />http_access deny AntiBaidu<br /><br />#允许本地管理<br />acl Manager proto cache_object<br />acl Localhost src 127.0.0.1 192.168.1.1<br />http_access allow Manager Localhost<br />http_access deny Manager<br /><br />#仅仅允许80端口的代理<br />acl Safe_ports port 80 # http<br />http_access deny !Safe_ports<br />http_access allow all<br /><br />#Squid信息设置<br />visible_hostname www.test137.com<br />cache_mgr webmaster@test137.com<br /><br />#基本设置<br />cache_effective_user squid<br />cache_effective_group squid<br />tcp_recv_bufsize 65535 bytes<br /><br />#2.5的反向代理加速配置<br />#httpd_accel_host 127.0.0.1<br />#httpd_accel_port 80<br />#httpd_accel_single_host on<br />#httpd_accel_uses_host_header on<br />#httpd_accel_with_proxy on<br />#2.6的反向代理加速配置<br />#代理到本机的80端口的服务，仅仅做为原始内容服务器<br />cache_peer 127.0.0.1 parent 80 0 no-query originserver<br /><br />#错误文档<br />error_directory /usr/local/squid/share/errors/Simplify_Chinese<br /><br />#单台使用，不使用该功能<br />icp_port 0</div>
　　4. http服务器配合设置:<br />http服务器，监听到127.0.0.1的80端口。<br /><br />　　5. 数据走向：<br />访问者=&gt;192.168.1.1:80=&gt;127.0.0.1:80<br /><br />　　6. 测试：<br />/usr/local/squid/sbin/squid -z<br />/usr/local/squid/sbin/squid -NCd1<br />　　好了，现在访问你的服务器看看，已经好了。<br /><br />　　为了测试是否可用，把http服务器给停了，你就可以看到squid2.6的信息了。<br /><br />　　另外，我们设置：<br />SQUID监听外部IP的80端口<br />HTTP服务器监听本机127.0.0.1的80端口<br />这样子不用任何防火墙参与，即可完成web反向代理加速。<br />]]></description>
		</item>
		
			<item>
			<link>http://www.dzend.com/default.asp?id=192</link>
			<title><![CDATA[.net 2.0的URL重写导致的Bug及其解决方法]]></title>
			<author>jiangdazheng@163.com(admin)</author>
			<category><![CDATA[asp.net]]></category>
			<pubDate>Sun,28 Sep 2008 11:20:23 +0800</pubDate>
			<guid>http://www.dzend.com/default.asp?id=192</guid>	
		<description><![CDATA[<p>最近在服务器的日志中出现许多Web事件的警告信息。时间间隔非常规律，一分钟出现一至两次，其错误信息摘取关键部分如下：</p>
<p>事件类型:&nbsp;&nbsp;&nbsp; 警告<br />事件来源:&nbsp;&nbsp;&nbsp; ASP.NET 2.0.50727.0<br />事件种类:&nbsp;&nbsp;&nbsp; Web 事件<br />事件 ID:&nbsp;&nbsp;&nbsp; 1309<br />日期:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 2008-1-13<br />事件:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 14:43:41<br />用户:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; N/A<br />描述:<br />事件代码: 3005<br />事件消息: 发生了未处理的异常。<br />事件时间: 2008-1-13 14:43:41<br />事件时间(UTC): 2008-1-13 6:43:41<br />事件 ID: f94c4a45b696449db6df2a3d571059e3<br />事件序列: 110527<br />事件匹配项: 9121<br />事件详细信息代码: 0</p>
<p><span id="more-27"></span>异常信息:<br />&nbsp;&nbsp;&nbsp; 异常类型: HttpException<br />&nbsp;&nbsp;&nbsp; 异常消息: 无法使用前导 .. 在顶级目录上退出。<br />请求信息:<br />&nbsp;&nbsp;&nbsp; 请求 URL: <a href="http://dormforce.net/Music/*****.aspx?id=7085&amp;id2=633358175566250000">http://dormforce.net/Music/*****.aspx?id=7085&amp;id2=633358175566250000</a><br />&nbsp;&nbsp;&nbsp; 请求路径: /Music/*****.aspx<br />&nbsp;&nbsp;&nbsp; 用户主机地址: 66.249.66.38<br />&nbsp;&nbsp;&nbsp; 用户:&nbsp;<br />&nbsp;&nbsp;&nbsp; 是否已经过身份验证: False<br />&nbsp;&nbsp;&nbsp; 身份验证类型:&nbsp;<br />&nbsp;&nbsp;&nbsp; 线程帐户名: NT AUTHORITY\NETWORK SERVICE<br />线程信息:<br />&nbsp;&nbsp;&nbsp; 线程 ID: 1<br />&nbsp;&nbsp;&nbsp; 线程帐户名: NT AUTHORITY\NETWORK SERVICE<br />&nbsp;&nbsp;&nbsp; 是否正在模拟: False<br />&nbsp;&nbsp;&nbsp; 堆栈跟踪:&nbsp;&nbsp;&nbsp; 在 System.Web.Util.UrlPath.ReduceVirtualPath(String path)<br />&nbsp;&nbsp; 在 System.Web.Util.UrlPath.Reduce(String path)<br />&nbsp;&nbsp; 在 System.Web.Util.UrlPath.Combine(String appPath, String basepath, String relative)<br />&nbsp;&nbsp; 在 System.Web.HttpResponse.ApplyAppPathModifier(String virtualPath)<br />&nbsp;&nbsp; 在 System.Web.UI.HtmlControls.HtmlForm.GetActionAttribute()<br />&nbsp;&nbsp; 在 System.Web.UI.HtmlControls.HtmlForm.RenderAttributes(HtmlTextWriter writer)<br />&nbsp;&nbsp; 在 System.Web.UI.HtmlControls.HtmlControl.RenderBeginTag(HtmlTextWriter writer)<br />&nbsp;&nbsp; 在 System.Web.UI.HtmlControls.HtmlForm.Render(HtmlTextWriter output)<br />&nbsp;&nbsp; 在 System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter)<br />&nbsp;&nbsp; 在 System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter)<br />&nbsp;&nbsp; 在 System.Web.UI.HtmlControls.HtmlForm.RenderControl(HtmlTextWriter writer)<br />&nbsp;&nbsp; 在 System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children)<br />&nbsp;&nbsp; 在 System.Web.UI.Control.RenderChildren(HtmlTextWriter writer)<br />&nbsp;&nbsp; 在 System.Web.UI.Page.Render(HtmlTextWriter writer)<br />&nbsp;&nbsp; 在 System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter)<br />&nbsp;&nbsp; 在 System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter)<br />&nbsp;&nbsp; 在 System.Web.UI.Control.RenderControl(HtmlTextWriter writer)<br />&nbsp;&nbsp; 在 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)</p>
<p>最初以为是源代码中的问题，打开源码仔细分析没有找到逻辑上的错误，不得其解。查找主机的IP地址，发现居然是GoogleBot 搜寻引擎机器人，后来在网上看到一篇文章，<a href="http://todotnet.com/archive/2006/07/01/7472.aspx">Get GoogleBot to crash your .NET 2.0 site</a></p>
<p>才知道这是由于ASP.NET 2.0 本身的一个bug造成的。</p>
<p>解决方法不复杂，在根目录建立一个App_Browsers文件夹，在里面写一个以.browser扩展名的文件，并对里面的文件进行相应的设置，对于现在遇到的这个问题，我的设置如下：</p>
<p>&lt;!&ndash;</p>
<p>For Mozilla/5.0</p>
<p>&ndash;&gt;</p>
<p>&lt;browsers&gt;<br />&lt;browser id=&rdquo;bot&rdquo; parentID=&rdquo;Mozilla&rdquo;&gt;<br />&lt;identification&gt;<br />&lt;userAgent match=&rdquo;.&rdquo; /&gt;<br />&lt;/identification&gt;<br />&lt;capabilities&gt;<br />&lt;capability name=&rdquo;browser&rdquo; value=&rdquo;bot&rdquo; /&gt;<br />&lt;capability name=&rdquo;Version&rdquo; value=&rdquo;4.0&Prime; /&gt;<br />&lt;capability name=&rdquo;MajorVersion&rdquo; value=&rdquo;4&Prime; /&gt;<br />&lt;capability name=&rdquo;MinorVersionString&rdquo; value=&rdquo;&quot; /&gt;<br />&lt;capability name=&rdquo;MinorVersion&rdquo; value=&rdquo;.0&Prime; /&gt;<br />&lt;capability name=&rdquo;activexcontrols&rdquo; value=&rdquo;true&rdquo; /&gt;<br />&lt;capability name=&rdquo;backgroundsounds&rdquo; value=&rdquo;true&rdquo; /&gt;<br />&lt;capability name=&rdquo;cookies&rdquo; value=&rdquo;true&rdquo; /&gt;<br />&lt;capability name=&rdquo;css1&Prime; value=&rdquo;true&rdquo; /&gt;<br />&lt;capability name=&rdquo;css2&Prime; value=&rdquo;true&rdquo; /&gt;<br />&lt;capability name=&rdquo;ecmascriptversion&rdquo; value=&rdquo;1.2&Prime; /&gt;<br />&lt;capability name=&rdquo;frames&rdquo; value=&rdquo;true&rdquo; /&gt;<br />&lt;capability name=&rdquo;javaapplets&rdquo; value=&rdquo;true&rdquo; /&gt;<br />&lt;capability name=&rdquo;javascript&rdquo; value=&rdquo;true&rdquo; /&gt;<br />&lt;capability name=&rdquo;jscriptversion&rdquo; value=&rdquo;5.0&Prime; /&gt;<br />&lt;capability name=&rdquo;supportsCallback&rdquo; value=&rdquo;true&rdquo; /&gt;<br />&lt;capability name=&rdquo;supportsFileUpload&rdquo; value=&rdquo;true&rdquo; /&gt;<br />&lt;capability name=&rdquo;supportsMultilineTextBoxDisplay&rdquo; value=&rdquo;true&rdquo; /&gt;<br />&lt;capability name=&rdquo;supportsMaintainScrollPositionOnPostback&rdquo; value=&rdquo;true&rdquo; /&gt;<br />&lt;capability name=&rdquo;supportsVCard&rdquo; value=&rdquo;true&rdquo; /&gt;<br />&lt;capability name=&rdquo;supportsXmlHttp&rdquo; value=&rdquo;true&rdquo; /&gt;<br />&lt;capability name=&rdquo;tables&rdquo; value=&rdquo;true&rdquo; /&gt;<br />&lt;capability name=&rdquo;vbscript&rdquo; value=&rdquo;true&rdquo; /&gt;<br />&lt;capability name=&rdquo;w3cdomversion&rdquo; value=&rdquo;1.0&Prime; /&gt;<br />&lt;capability name=&rdquo;xml&rdquo; value=&rdquo;true&rdquo; /&gt;<br />&lt;capability name=&rdquo;tagwriter&rdquo; value=&rdquo;System.Web.UI.HtmlTextWriter&rdquo; /&gt;<br />&lt;/capabilities&gt;<br />&lt;/browser&gt;<br />&lt;/browsers&gt;</p>
<p>&nbsp; 其实这个Bug不解决，GoogleBot就搜不到某些页面了。（貌似也没什么关系-_-）</p>
<p>下面把原文也引用一下：（注意一下，原文中的App_browser少了一个s)</p>
<p><a href="http://todotnet.com/archive/2006/07/01/7472.aspx">Get GoogleBot to crash your .NET 2.0 site</a></p>
<p>If you&rsquo;re developing in ASP.NET 2.0 and you&rsquo;re using url rewriting, you should proceed with caution. Especially if you value your ranking in search engines. I&rsquo;m posting this as a follow up and with reference to the original find on <a href="http://blogs.developpeur.org/nix/archive/2006/07/01/DOTNET_2_GoogleBot_Crash_Bug_Pas_seulement_googlebot.aspx">this post</a>. The issue came about <a href="http://communityserver.org/forums/536640/ShowThread.aspx#536640">in a thread</a> on the Community Server 2.0 forums. I was fast to post a solution to the problem, but obviously, it&rsquo;s more about working around the issue than actually solving the root cause.</p>
<p>Url rewriting is mostly used to make URL&rsquo;s more friendly to read. Also, if you have migrated from one site to another and you want accommodate people still linking to old urls, rewriting is a common practice. Nonetheless, if you use this on a public internet website, it won&rsquo;t be long until you see the following exceptions listed in your Event Log:</p>
<p><strong>&nbsp;&nbsp; Exception type: HttpException </strong><strong><br /></strong><strong>Exception message: Cannot use a leading .. to exit above the top directory. </strong><strong><br /></strong>&hellip;<br /><strong>&nbsp;&nbsp; Stack trace:&nbsp;&nbsp;&nbsp; at System.Web.Util.UrlPath.ReduceVirtualPath(String path)</strong><strong><br /></strong>&hellip;</p>
<p>For any site of significance, and <a href="http://www.codes-sources.com/">www.codes-sources.com</a> is most certainly one of them, this exception was logged more than 2000 times &hellip; every hour. Now, that&rsquo;s something to notice, right? And the effect on your ranking in the search engines? Well, within a few days, your site is either kicked out completely from the index or the index contains nothing more than the url of your site without content. Nobody looking for content you may have on your site will be directed to it. Worried? Read on.</p>
<p>My personal instinct would be: it&rsquo;s something I did wrong. So one takes a long time trying to figure out what that is. But in fact, it&rsquo;s a bug in a .NET component that&rsquo;s not easy to trace and reproduce. If you don&rsquo;t check the event logs every once in a while, it can surely be missed. Let&rsquo;s take a look at what&rsquo;s going on:</p>
<p>A first note to people trying to reproduce the issue, the bug does not appear using Cassini (the built-in web server in Visual Studio 2005). You need to have a running IIS 6 web server on Windows 2003. Doesn&rsquo;t matter if it&rsquo;s in a VPC or on an actual server.</p>
<p>If you&rsquo;re using url rewriting in .NET 2.0, you have the Context.RewritePath method at your disposal. <a href="http://redir.codes-sources.com/fichiers/nix/urlrewrite_dotnet_2_googlebot_crash_bug.zip">Here&rsquo;s a sample project for testing</a>.</p>
<p>1. First you create a page, say <strong>page.aspx</strong></p>
<p>2. In this page, you can put whatever you want; it doesn&rsquo;t really matter. For example:</p>
<p>&lt;%=Request(&rdquo;ID&rdquo;)%&gt;</p>
<p>3. Then you add your rewriting HttpModule, with the following implementation:</p>
<p>Public Class Rewriter</p>
<p>Implements System.Web.IHttpModule</p>
<p>Public Sub Dispose() Implements System.Web.IHttpModule.Dispose</p>
<p>End Sub</p>
<p>Public Sub Init(ByVal context As System.Web.HttpApplication) Implements System.Web.IHttpModule.Init</p>
<p>AddHandler context.BeginRequest, AddressOf Me.HandleBeginRequest</p>
<p>End Sub</p>
<p>Private Sub HandleBeginRequest(ByVal [source] As [Object], ByVal e As EventArgs)</p>
<p>Dim app As System.Web.HttpApplication = CType([source], System.Web.HttpApplication)</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; app.Context.RewritePath(&ldquo;~/page.aspx?ID=1&rdquo;, <strong>False</strong>) &lsquo; sidenote, same effect when using &ldquo;/page.aspx?ID=1&rdquo;</p>
<p>End Sub</p>
<p>End Class</p>
<p>As you can see, it&rsquo;s a simple example rewriting all urls to page.aspx?ID=1. It&rsquo;s does not serve a specific function, other than show the problem at hand. Now, add the HttpModule in the Web.Config file.</p>
<p>With Fiddler (available at <a href="http://www.fiddlertool.com/">www.fiddlertool.com</a>), you can create web requests and analyze the result in very good detail. It&rsquo;s especially useful in this case, as you can create a request specific for certain user-agents. So <a href="http://todotnet.com/archive/2006/07/01/www.fiddlertool.com">download the tool</a> and setup your ASP.NET 2.0 site on an IIS 6.0 environment. One thing to note as well, is that this site needs to be running under its own hostheader, not as a virtual directory.<br />Once installed, you take your web browser and go to</p>
<p><a href="http://localsitename/default.aspx">http://localsitename/default.aspx</a></p>
<p>The page default.aspx will be rewritten as page.aspx?ID=1 and everything works just fine.</p>
<p>Now, open up Fiddler and create the following request:</p>
<p><em>Accept: */*</em><em><br /></em><em>Accept-Encoding: gzip, x-gzip</em><em><br /></em><em>User-Agent: <strong>Mozilla/4.0</strong></em><em><br /></em><br />Set the url to</p>
<p><a href="http://localsitename/default.aspx">http://localsitename/default.aspx</a></p>
<p>and hit Execute. You should get status code 200, meaning OK. Now set the url to</p>
<p><a href="http://localsitename/justafolder/default.aspx">http://localsitename/justafolder/default.aspx</a></p>
<p>and after you hit OK, again, you will get a 200 code. No problems so far.</p>
<p>Now, change the request to</p>
<p><em>User-Agent: Mozilla/<strong>5.0</strong></em><br />instead of <em>User-Agent: Mozilla/<strong>4.0 </strong></em></p>
<p>Hit Execute and bang&hellip; error 500, indicating an application error.<br />Here&rsquo;s a list of user-agent entries that will result in an error:</p>
<p><em>Mozilla/1.0</em><br /><em>Mozilla/2.0</em><br /><em>Mozilla/5.0</em><br /><em>Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)</em><br /><em>Mozilla/5.0 (compatible; Yahoo! Slurp; <a href="http://help.yahoo.com/help/us/ysearch/slurp">http://help.yahoo.com/help/us/ysearch/slurp</a>)</em><br /><em>Yahoo-Blogs/v3.9 (compatible; Mozilla 4.0; MSIE 5.5; </em><a href="http://help.yahoo.com/help/us/ysearch/crawling/crawling-02.html"><em>http://help.yahoo.com/help/us/ysearch/crawling/crawling-02.html</em></a><em> )</em><br /><em>Mozilla/2.0 (compatible; Ask Jeeves/Teoma; +http://sp.ask.com/docs/about/tech_crawling.html)</em><br /><em>Mozilla/5.0 (compatible; BecomeBot/3.0; MSIE 6.0 compatible; +http://www.become.com/site_owners.html)</em><br /><em>Mozilla/5.0 (compatible; Konqueror/&hellip;. <u>(Tous les users agent de Konqueror que j&rsquo;ai test&eacute;s plantent)</u></em><u><br /></u>Etc&hellip;</p>
<p><strong>Some funny details:<br /></strong><em>Mozilla/5.0 (Windows; U; Windows NT 5.1; fr; rv:1.8.0.1) Gecko/20060111 Firefox/1.5.0.1 </em><strong><em>&lt;= no error</em></strong><em><br /><em>Mozilla/5.0 (Windows; U; Windows NT 5.1; fr; rv:1.8.0.1) </em><strong>&lt;= error 500!</strong></em><strong> </strong></p>
<p>Ok, so let&rsquo;s try to explain what happens. If you call RewritePath with the rebaseClientPath parameter set to &ldquo;True&rdquo;, the virtual path is reset. So why set it to False? Well, the setting of rebaseClientPath affects the action-tag of a form.</p>
<p>If I have an url <a href="http://mysite/myfolder/mypage.aspx">http://mysite/myfolder/mypage.aspx</a> which is rewritten to <a href="http://mysite/page.aspx?id=mypage">http://mysite/page.aspx?id=mypage</a>, the form tag will we set as follows.</p>
<p>With rebaseClientPath set to true:</p>
<p><em>&lt;form name=&rdquo;form1&Prime; method=&rdquo;post&rdquo; action=&rdquo;<strong>page.aspx?ID=mapage</strong>&rdquo; id=&rdquo;form1&Prime;&gt;</em></p>
<p>But with rebaseClientPath set to false:</p>
<p><em>&lt;form name=&rdquo;form1&Prime; method=&rdquo;post&rdquo; action=&rdquo;<strong>../page.aspx?ID=mapage</strong>&rdquo; id=&rdquo;form1&Prime;&gt;</em></p>
<p>In case of a postback, the action in the latter situation (with rebaseClientPath set to false) is correct. Not in the first instance, because there is no page.aspx in the subfolder /myfolder.</p>
<p>Now, a workaround would be to manually set the UrlPostback to the correct location, but the ramafications are significant, and may affect the execution of the javascript manipulation the UrlPostback on a number of browsers.</p>
<p>What&rsquo;s really troublesome is that it affects only the production version of a website. It&rsquo;s not visible during development (usually you don&rsquo;t let searchengines index your development and test environment, right?). Also, it happens only under IIS 6.0, using ASP.NET 2.0. And the only variable in this case is the user agent with which the site is accessed.</p>
<p>Now we know what the issue is, how do we resolve it? Well, doing it yourself is not easy and without risk, but here goes.</p>
<p>It has to do with the capabilities of the user-agent. When the site is hit by a user-agent having Mozilla/5.0 in the string, ASP.NET will be using System.Web.UI.Html<strong>32</strong>TextWriter. I&rsquo;ve traced the bug with <a href="http://www.avicode.com/">Intercept Studio</a> and can confirm this. If you use another user-agent, for example Mozilla/4.0, System.Web.UI.HtmlTextWriter will be used. This is called <a href="http://aspnet.4guysfromrolla.com/demos/printPage.aspx?path=/articles/050504-1.aspx">adaptive rendering</a>, which can lead to <a href="http://scottonwriting.net/sowblog/posts/1125.aspx">weird behavior</a>.</p>
<p>So the problem lies in Html<strong>32</strong>TextWriter, but it&rsquo;s unclear where this goes wrong exactly. The exception is thrown in System.Web.Util.UrlPath.ReduceVirtualPath(), but by the time the stack reaches this method, we&rsquo;re already six method calls away from the last usage of Html32TextWriter (being used in System.Web.UI.HtmlControls.HtmlForm.RenderAttributes). If you have time to walk the stack with <a href="http://www.aisto.com/roeder/dotnet/">Reflector</a>, go ahead. There are about 23 method calls in all.</p>
<p>You may want to wait for a fix to come from Microsoft, but if you can&rsquo;t wait that long, there&rsquo;s a hack solution to try for yourself. Say for instance you want to fix the issue with the Yahoo searchbot, Yahoo! Slurp (you would need to apply this to all user-agents in a similar fashion.)</p>
<p>Since Visual Studio 2005 we have the capability to create .browser files. These .browser files contain a definition of the capabilities of browsers. In your web project, add a folder called &ldquo;App_Browser&rdquo; and create a new file (i.e.: yahooslurp.browser). In this file, you put</p>
<p>&lt;!&ndash;</p>
<p>Mozilla/5.0 (compatible; Yahoo! Slurp; http://help.yahoo.com/help/us/ysearch/slurp)</p>
<p>&ndash;&gt;</p>
<p>&lt;browsers&gt;<br />&lt;browser id=&rdquo;<strong>Slurp</strong>&rdquo; parentID=&rdquo;<strong>Mozilla</strong>&ldquo;&gt;<br />&lt;identification&gt;<br />&lt;userAgent match=&rdquo;<strong>Slurp</strong>&rdquo; /&gt;<br />&lt;/identification&gt;<br />&lt;capabilities&gt;<br />&lt;capability name=&rdquo;browser&rdquo; value=&rdquo;<strong>Yahoo!Slurp</strong>&rdquo; /&gt;<br />&lt;capability name=&rdquo;Version&rdquo; value=&rdquo;4.0&Prime; /&gt;<br />&lt;capability name=&rdquo;MajorVersion&rdquo; value=&rdquo;4&Prime; /&gt;<br />&lt;capability name=&rdquo;MinorVersionString&rdquo; value=&rdquo;&quot; /&gt;<br />&lt;capability name=&rdquo;MinorVersion&rdquo; value=&rdquo;.0&Prime; /&gt;<br />&lt;capability name=&rdquo;activexcontrols&rdquo; value=&rdquo;true&rdquo; /&gt;<br />&lt;capability name=&rdquo;backgroundsounds&rdquo; value=&rdquo;true&rdquo; /&gt;<br />&lt;capability name=&rdquo;cookies&rdquo; value=&rdquo;true&rdquo; /&gt;<br />&lt;capability name=&rdquo;css1&Prime; value=&rdquo;true&rdquo; /&gt;<br />&lt;capability name=&rdquo;css2&Prime; value=&rdquo;true&rdquo; /&gt;<br />&lt;capability name=&rdquo;ecmascriptversion&rdquo; value=&rdquo;1.2&Prime; /&gt;<br />&lt;capability name=&rdquo;frames&rdquo; value=&rdquo;true&rdquo; /&gt;<br />&lt;capability name=&rdquo;javaapplets&rdquo; value=&rdquo;true&rdquo; /&gt;<br />&lt;capability name=&rdquo;javascript&rdquo; value=&rdquo;true&rdquo; /&gt;<br />&lt;capability name=&rdquo;jscriptversion&rdquo; value=&rdquo;5.0&Prime; /&gt;<br />&lt;capability name=&rdquo;supportsCallback&rdquo; value=&rdquo;true&rdquo; /&gt;<br />&lt;capability name=&rdquo;supportsFileUpload&rdquo; value=&rdquo;true&rdquo; /&gt;<br />&lt;capability name=&rdquo;supportsMultilineTextBoxDisplay&rdquo; value=&rdquo;true&rdquo; /&gt;<br />&lt;capability name=&rdquo;supportsMaintainScrollPositionOnPostback&rdquo; value=&rdquo;true&rdquo; /&gt;<br />&lt;capability name=&rdquo;supportsVCard&rdquo; value=&rdquo;true&rdquo; /&gt;<br />&lt;capability name=&rdquo;supportsXmlHttp&rdquo; value=&rdquo;true&rdquo; /&gt;<br />&lt;capability name=&rdquo;tables&rdquo; value=&rdquo;true&rdquo; /&gt;<br />&lt;capability name=&rdquo;vbscript&rdquo; value=&rdquo;true&rdquo; /&gt;<br />&lt;capability name=&rdquo;w3cdomversion&rdquo; value=&rdquo;1.0&Prime; /&gt;<br />&lt;capability name=&rdquo;xml&rdquo; value=&rdquo;true&rdquo; /&gt;<br />&lt;capability name=&rdquo;tagwriter&rdquo; value=&rdquo;<strong>System.Web.UI.HtmlTextWriter</strong>&rdquo; /&gt;<br />&lt;/capabilities&gt;<br />&lt;/browser&gt;<br />&lt;/browsers&gt;</p>
<p>Now, restart your website and redo the tests with Fiddler, setting the user-agent to</p>
<p><em>Mozilla/5.0 (compatible; Yahoo! Slurp; </em><em><a href="http://help.yahoo.com/help/us/ysearch/slurp">http://help.yahoo.com/help/us/ysearch/slurp</a></em><em>) </em></p>
<p>Voil&agrave;, no more 500 error message. Repeat the steps for the different user-agents out there.</p>
<p>There may be other possibilities to fix this problem, but this one seems to be the most straightforward to implement and doesn&rsquo;t require you to recompile the code. With solutions like CommunityServer, you simply don&rsquo;t have this option anyway. It will suffice to add the App_Browser folder and the various .browser files to the root folder of the website and it will work.</p>
<p>At the end of the <a href="http://blogs.developpeur.org/nix/archive/2006/07/01/DOTNET_2_GoogleBot_Crash_Bug_Pas_seulement_googlebot.aspx">original post by Nix</a>, there are some closing remarks. For example, if you create the site as a virtual directory under a website root, the problem does not appear. Changing the user-agent in a header, as suggested by <a href="http://blogs.developpeur.org/nix/archive/2006/06/29/Google_ne_vous_aime_pas_Vous_utilisez_CommunityServer_2_0_Alors_c_est_normal_.aspx">Poppyto</a>, might work, but the consequences are uncertain. Also, you would need to recompile.</p>
<p>Now, you might think, oh well, just add the appropriate .browser files and we&rsquo;re done. But that&rsquo;s a bit short sighted. You never know when Google or any other search-engine decides to change the user-agent string. Your first notification would come from the exception messages in your event log. I manage about 7 big Windows 2003 servers in our datacenter. Perhaps not much, but I know what issues can come along every once in a while). Both as a developer and a system administrator, I would rather prevent issues, than handle them afterwards.</p>
<p>If you want to debate the issue, please go to the <a href="http://communityserver.org/forums/536640/ShowThread.aspx#536640">thread</a> at the <a href="http://communityserver.org/forums/536640/ShowThread.aspx#536640">Community Server forums</a>.</p>
<p>PS: Why did I write this post? Well, the <a href="http://blogs.developpeur.org/nix/archive/2006/07/01/DOTNET_2_GoogleBot_Crash_Bug_Pas_seulement_googlebot.aspx">entire explanation </a>is written in French, and not everyone can read this. Also, Nix and I know each other and he&rsquo;s been helpful on a number of occasions, so if there&rsquo;s anything I can do in return, like explaining the issue in English, I&rsquo;m more than happy to help. Finally, this problem needs a proper solution, and the sites and servers I host can be just as much affected. I was fortunate not to have too much url rewriting in my sites, but that doesn&rsquo;t affect the scope of the issue.</p>]]></description>
		</item>
		
			<item>
			<link>http://www.dzend.com/default.asp?id=191</link>
			<title><![CDATA[服务器的大用户量的承载方案 Nginx Squid Apache PHP MySQL]]></title>
			<author>jiangdazheng@163.com(admin)</author>
			<category><![CDATA[squid]]></category>
			<pubDate>Fri,12 Sep 2008 10:47:09 +0800</pubDate>
			<guid>http://www.dzend.com/default.asp?id=191</guid>	
		<description><![CDATA[<p>服务器的大用户量的承载方案</p>
<p>一、前言 <br />二、编译安装 <br />三、 安装MySQL、memcache <br />四、 安装Apache、PHP、eAccelerator、php-memcache <br />五、 安装Squid <br />六、后记 </p>
<p>&nbsp;</p>
<p>一、前言，准备工作<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 当前，LAMP开发模式是WEB开发的首选，如何搭建一个高效、可靠、稳定的WEB服务器一直是个热门主题，本文就是这个主题的一次尝试。<br />我们采用的架构图如下：</p>
<p>引用--------&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ----------&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -------------&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ---------&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ------------<br />| 客户端 | ===&gt; |负载均衡器| ===&gt; |反向代理/缓存| ===&gt; |WEB服务器| ===&gt; |数据库服务器|<br />--------&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ----------&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -------------&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ---------&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ------------<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Nginx&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Squid&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Apache,PHP&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MySQL<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; eAccelerator/memcache准备工作：<br />引用服务器： Intel(R) Xeon(TM) CPU 3.00GHz * 2, 2GB mem, SCISC 硬盘<br />操作系统：CentOs4.4，内核版本2.6.9-22.ELsmp，gcc版本3.4.4<br />软件：<br />Apache 2.2.3（能使用MPM模式）<br />PHP 5.2.0（选用该版本是因为5.2.0的引擎相对更高效）<br />eAccelerator 0.9.5（加速PHP引擎，同时也可以加密PHP源程序）<br />memcache 1.2.0（用于高速缓存常用数据）<br />libevent 1.2a（memcache工作机制所需）<br />MySQL 5.0.27（选用二进制版本，省去编译工作）<br />Nginx 0.5.4（用做负载均衡器）<br />squid-2.6.STABLE6（做反向代理的同时提供专业缓存功能）</p>
<p>二、编译安装<br />一、) 安装Nginx<br />1.) 安装<br />Nginx发音为[engine x]，是由俄罗斯人Igor Sysoev建立的项目,基于BSD许可。据说他当初是F5的成员之一，英文主页：<a href="http://nginx.net">http://nginx.net</a>。俄罗斯的一些大网站已经使用它超过两年多了，一直表现不凡。<br />Nginx的编译参数如下：</p>
<p>[root@localhost]#./configure --prefix=/usr/local/server/nginx --with-openssl=/usr/include \<br />--with-pcre=/usr/include/pcre/ --with-http_stub_status_module --without-http_memcached_module \<br />--without-http_fastcgi_module --without-http_rewrite_module --without-http_map_module \<br />--without-http_geo_module --without-http_autoindex_module<br />在这里，需要说明一下，由于Nginx的配置文件中我想用到正则，所以需要 pcre 模块的支持。我已经安装了 pcre 及 pcre-devel 的rpm包，但是 Ngxin 并不能正确找到 .h/.so/.a/.la 文件，因此我稍微变通了一下：</p>
<p>[root@localhost]#mkdir /usr/include/pcre/.libs/<br />[root@localhost]#cp /usr/lib/libpcre.a /usr/include/pcre/.libs/libpcre.a<br />[root@localhost]#cp /usr/lib/libpcre.a /usr/include/pcre/.libs/libpcre.la<br />然后，修改 objs/Makefile 大概在908行的位置上，注释掉以下内容：</p>
<p>./configure --disable-shared<br />接下来，就可以正常执行 make 及 make install 了。</p>
<p>2.) 修改配置文件 /usr/local/server/nginx/conf/nginx.conf<br />以下是我的 nginx.conf 内容，仅供参考：</p>
<p>#运行用户<br />user&nbsp;&nbsp; nobody nobody;<br />#启动进程<br />worker_processes&nbsp;&nbsp; 2;<br />#全局错误日志及PID文件<br />error_log&nbsp;&nbsp; logs/error.log notice;<br />pid&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; logs/nginx.pid;<br />#工作模式及连接数上限<br />events {<br />use epoll;<br />worker_connections&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1024;<br />}<br />#设定http服务器，利用它的反向代理功能提供负载均衡支持<br />http {<br />#设定mime类型<br />include&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; conf/mime.types;<br />default_type&nbsp;&nbsp; application/octet-stream;<br />#设定日志格式<br />log_format main&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; '$remote_addr - $remote_user [$time_local] '<br />'&quot;$request&quot; $status $bytes_sent '<br />'&quot;$http_referer&quot; &quot;$http_user_agent&quot; '<br />'&quot;$gzip_ratio&quot;';<br />log_format download '$remote_addr - $remote_user [$time_local] '<br />'&quot;$request&quot; $status $bytes_sent '<br />'&quot;$http_referer&quot; &quot;$http_user_agent&quot; '<br />'&quot;$http_range&quot; &quot;$sent_http_content_range&quot;';<br />#设定请求缓冲<br />client_header_buffer_size&nbsp;&nbsp;&nbsp;&nbsp; 1k;<br />large_client_header_buffers&nbsp;&nbsp; 4 4k;<br />#开启gzip模块<br />gzip on;<br />gzip_min_length&nbsp;&nbsp; 1100;<br />gzip_buffers&nbsp;&nbsp;&nbsp;&nbsp; 4 8k;<br />gzip_types&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; text/plain;<br />output_buffers&nbsp;&nbsp; 1 32k;<br />postpone_output&nbsp;&nbsp; 1460;<br />#设定access log<br />access_log&nbsp;&nbsp; logs/access.log&nbsp;&nbsp; main;<br />client_header_timeout&nbsp;&nbsp; 3m;<br />client_body_timeout&nbsp;&nbsp;&nbsp;&nbsp; 3m;<br />send_timeout&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 3m;<br />sendfile&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; on;<br />tcp_nopush&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; on;<br />tcp_nodelay&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; on;<br />keepalive_timeout&nbsp;&nbsp; 65;<br />#设定负载均衡的服务器列表<br />upstream mysvr {<br />#weigth参数表示权值，权值越高被分配到的几率越大<br />#本机上的Squid开启3128端口<br />server 192.168.8.1:3128 weight=5;<br />server 192.168.8.2:80&nbsp;&nbsp; weight=1;<br />server 192.168.8.3:80&nbsp;&nbsp; weight=6;<br />}<br />#设定虚拟主机<br />server {<br />listen&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 80;<br />server_name&nbsp;&nbsp;&nbsp;&nbsp; 192.168.8.1 <a href="http://www.yejr.com">www.yejr.com</a>;<br />charset gb2312;<br />#设定本虚拟主机的访问日志<br />access_log&nbsp;&nbsp; logs/www.yejr.com.access.log&nbsp;&nbsp; main;<br />#如果访问 /img/*, /js/*, /css/* 资源，则直接取本地文件，不通过squid<br />#如果这些文件较多，不推荐这种方式，因为通过squid的缓存效果更好<br />location ~ ^/(img|js|css)/&nbsp;&nbsp; {<br />root&nbsp;&nbsp;&nbsp;&nbsp; /data3/Html;<br />expires 24h;<br />}<br />#对 &quot;/&quot; 启用负载均衡<br />location / {<br />proxy_pass&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href="http://mysvr">http://mysvr</a>;<br />proxy_redirect&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; off;<br />proxy_set_header&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Host $host;<br />proxy_set_header&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; X-Real-IP $remote_addr;<br />proxy_set_header&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; X-Forwarded-For $proxy_add_x_forwarded_for;<br />client_max_body_size&nbsp;&nbsp;&nbsp;&nbsp; 10m;<br />client_body_buffer_size 128k;<br />proxy_connect_timeout&nbsp;&nbsp; 90;<br />proxy_send_timeout&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 90;<br />proxy_read_timeout&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 90;<br />proxy_buffer_size&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 4k;<br />proxy_buffers&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 4 32k;<br />proxy_busy_buffers_size 64k;<br />proxy_temp_file_write_size 64k;<br />}<br />#设定查看Nginx状态的地址<br />location /NginxStatus {<br />stub_status&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; on;<br />access_log&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; on;<br />auth_basic&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;NginxStatus&quot;;<br />auth_basic_user_file&nbsp;&nbsp; conf/htpasswd;<br />}<br />}<br />}<br />备注：conf/htpasswd 文件的内容用 apache 提供的 htpasswd 工具来产生即可，内容大致如下：<br />3.) 查看 Nginx 运行状态<br />输入地址 <a href="http://192.168.8.1/NginxStatus/">http://192.168.8.1/NginxStatus/</a>，输入验证帐号密码，即可看到类似如下内容：<br />Active connections: 328<br />server accepts handled requests<br />9309&nbsp;&nbsp;&nbsp;&nbsp; 8982&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 28890<br />Reading: 1 Writing: 3 Waiting: 324</p>
<p>第一行表示目前活跃的连接数<br />第三行的第三个数字表示Nginx运行到当前时间接受到的总请求数，如果快达到了上限，就需要加大上限值了。<br />第四行是Nginx的队列状态</p>
<p>三、 安装MySQL、memcache </p>
<p>&nbsp;</p>
<p>1.) 安装MySQL，步骤如下：<br />[root@localhost]#tar zxf mysql-standard-5.0.27-linux-i686.tar.gz -C /usr/local/server<br />[root@localhost]#mv /usr/local/server/mysql-standard-5.0.27-linux-i686 /usr/local/server/mysql<br />[root@localhost]#cd /usr/local/server/mysql<br />[root@localhost]#./scripts/mysql_install_db --basedir=/usr/local/server/mysql \<br />--datadir=/usr/local/server/mysql/data --user=nobody<br />[root@localhost]#cp /usr/local/server/mysql/support-files/my-large.cnf \<br />/usr/local/server/mysql/data/my.cnf</p>
<p>2.) 修改 MySQL 配置，增加部分优化参数，如下：<br />[root@localhost]#vi /usr/local/server/mysql/data/my.cnf</p>
<p>主要内容如下：<br />[mysqld]<br />basedir = /usr/local/server/mysql<br />datadir = /usr/local/server/mysql/data<br />user&nbsp;&nbsp;&nbsp;&nbsp; = nobody<br />port&nbsp;&nbsp;&nbsp;&nbsp; = 3306<br />socket&nbsp;&nbsp; = /tmp/mysql.sock<br />wait_timeout&nbsp;&nbsp;&nbsp;&nbsp; = 30<br />long_query_time=1<br />#log-queries-not-using-indexes = TRUE<br />log-slow-queries=/usr/local/server/mysql/slow.log<br />log-error = /usr/local/server/mysql/error.log<br />external-locking = FALSE<br />key_buffer_size = 512M<br />back_log&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = 400<br />table_cache&nbsp;&nbsp;&nbsp;&nbsp; = 512<br />sort_buffer_size = 2M<br />join_buffer_size = 4M<br />read_buffer_size = 2M<br />read_rnd_buffer_size&nbsp;&nbsp;&nbsp;&nbsp; = 4M<br />myisam_sort_buffer_size = 64M<br />thread_cache_size&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = 32<br />query_cache_limit&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = 2M<br />query_cache_size&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = 64M<br />thread_concurrency&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = 4<br />thread_stack&nbsp;&nbsp;&nbsp;&nbsp; = 128K<br />tmp_table_size&nbsp;&nbsp; = 64M<br />binlog_cache_size&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = 2M<br />max_binlog_size = 128M<br />max_binlog_cache_size&nbsp;&nbsp; = 512M<br />max_relay_log_size&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = 128M<br />bulk_insert_buffer_size = 8M<br />myisam_repair_threads&nbsp;&nbsp; = 1<br />skip-bdb<br />#如果不需要使用innodb就关闭该选项<br />#skip-innodb<br />innodb_data_home_dir&nbsp;&nbsp;&nbsp;&nbsp; = /usr/local/server/mysql/data/<br />innodb_data_file_path&nbsp;&nbsp; = ibdata1:256M;ibdata2:256M:autoextend<br />innodb_log_group_home_dir&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = /usr/local/server/mysql/data/<br />innodb_log_arch_dir&nbsp;&nbsp;&nbsp;&nbsp; = /usr/local/server/mysql/data/<br />innodb_buffer_pool_size = 512M<br />innodb_additional_mem_pool_size = 8M<br />innodb_log_file_size&nbsp;&nbsp;&nbsp;&nbsp; = 128M<br />innodb_log_buffer_size&nbsp;&nbsp; = 8M<br />innodb_lock_wait_timeout&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = 50<br />innodb_flush_log_at_trx_commit&nbsp;&nbsp; = 2<br />innodb_file_io_threads&nbsp;&nbsp; = 4<br />innodb_thread_concurrency&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = 16<br />innodb_log_files_in_group&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = 3</p>
<p>以上配置参数请根据具体的需要稍作修改。运行以下命令即可启动 MySQL 服务器：<br />/usr/local/server/mysql/bin/mysqld_safe \<br />--defaults-file=/usr/local/server/mysql/data/my.cnf &amp;</p>
<p>由于 MySQL 不是安装在标准目录下，因此必须要修改 mysqld_safe 中的 my_print_defaults 文件所在位置，才能通过<br />mysqld_safe 来启动 MySQL 服务器。<br />3.) memcache + libevent 安装编译安装：<br />[root@localhost]#cd libevent-1.2a<br />[root@localhost]#./configure --prefix=/usr/ &amp;&amp; make &amp;&amp; make install<br />[root@localhost]#cd ../memcached-1.2.0<br />[root@localhost]#./configure --prefix=/usr/local/server/memcached --with-libevent=/usr/<br />[root@localhost]#make &amp;&amp; make install</p>
<p>备注：如果 libevent 不是安装在 /usr 目录下，那么需要把 libevent-1.2a.so.1 拷贝/链接到 /usr/lib 中，否则<br />memcached 无法正常加载。运行以下命令来启动 memcached：<br />[root@localhost]#/usr/local/server/memcached/bin/memcached \<br />-l 192.168.8.1 -d -p 10000 -u nobody -m 128</p>
<p>表示用 daemon 的方式启动 memcached，监听在 192.168.8.1 的 10000 端口上，运行用户为 nobody，为其分配<br />128MB 的内存。</p>
<p>四、 安装Apache、PHP、eAccelerator、php-memcache </p>
<p>&nbsp;</p>
<p>四、) 安装Apache、PHP、eAccelerator、php-memcache由于Apache<br />2下的php静态方式编译十分麻烦，因此在这里采用动态模块(DSO)方式。1.) 安装Apache 2.2.3<br />[root@localhost]#./configure --prefix=/usr/local/server/apache --disable-userdir --disable-actions \<br />--disable-negotiation --disable-autoindex --disable-filter --disable-include --disable-status \<br />--disable-asis --disable-auth --disable-authn-default --disable-authn-file --disable-authz-groupfile \<br />--disable-authz-host --disable-authz-default --disable-authz-user --disable-userdir \<br />--enable-expires --enable-module=so</p>
<p>备注：在这里，取消了一些不必要的模块，如果你需要用到这些模块，那么请去掉部分参数。<br />2.) 安装PHP 5.2.0<br />[root@localhost]#./configure --prefix=/usr/local/server/php --with-mysql \<br />--with-apxs2=/usr/local/server/apache/bin/apxs --with-freetype-dir=/usr/ --with-png-dir=/usr/ \<br />--with-gd=/usr/ --with-jpeg-dir=/usr/ --with-zlib --enable-magic-quotes --with-iconv \<br />--without-sqlite --without-pdo-sqlite --with-pdo-mysql --disable-dom --disable-simplexml \<br />--enable-roxen-zts<br />[root@localhost]#make &amp;&amp; make install</p>
<p>备注：如果不需要gd或者pdo等模块，请自行去掉。<br />3.) 安装eAccelerator-0.9.5<br />[root@localhost]#cd eAccelerator-0.9.5<br />[root@localhost]#export PHP_PREFIX=/usr/local/server/php<br />[root@localhost]#$PHP_PREFIX/bin/phpize<br />[root@localhost]#./configure --enable-eaccelerator=shared --with-php-config=$PHP_PREFIX/bin/php-config<br />[root@localhost]#make &amp;&amp; make install</p>
<p>4.) 安装memcache模块<br />[root@localhost]#cd memcache-2.1.0<br />[root@localhost]#export PHP_PREFIX=/usr/local/server/php<br />[root@localhost]#$PHP_PREFIX/bin/phpize<br />[root@localhost]#./configure --enable-eaccelerator=shared --with-php-config=$PHP_PREFIX/bin/php-config<br />[root@localhost]#make &amp;&amp; make install</p>
<p>5.) 修改 php.ini 配置然后修改 php.ini，修改/加入类似以下内容：<br />extension_dir = &quot;/usr/local/server/php/lib/&quot;<br />extension=&quot;eaccelerator.so&quot;<br />eaccelerator.shm_size=&quot;32&quot;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ;设定eaccelerator的共享内存为32MB<br />eaccelerator.cache_dir=&quot;/usr/local/server/eaccelerator&quot;<br />eaccelerator.enable=&quot;1&quot;<br />eaccelerator.optimizer=&quot;1&quot;<br />eaccelerator.check_mtime=&quot;1&quot;<br />eaccelerator.debug=&quot;0&quot;<br />eaccelerator.filter=&quot;*.php&quot;<br />eaccelerator.shm_max=&quot;0&quot;<br />eaccelerator.shm_ttl=&quot;0&quot;<br />eaccelerator.shm_prune_period=&quot;3600&quot;<br />eaccelerator.shm_only=&quot;0&quot;<br />eaccelerator.compress=&quot;1&quot;<br />eaccelerator.compress_level=&quot;9&quot;<br />eaccelerator.log_file = &quot;/usr/local/server/apache/logs/eaccelerator_log&quot;<br />eaccelerator.allowed_admin_path = &quot;/usr/local/server/apache/htdocs/ea_admin&quot;<br />extension=&quot;memcache.so&quot;</p>
<p>在这里，最好是在apache的配置中增加默认文件类型的cache机制，即利用apache的expires模块，新增类似如下几行：<br />ExpiresActive On<br />ExpiresByType text/html &quot;access plus 10 minutes&quot;<br />ExpiresByType text/css &quot;access plus 1 day&quot;<br />ExpiresByType image/jpg &quot;access 1 month&quot;<br />ExpiresByType image/gif &quot;access 1 month&quot;<br />ExpiresByType image/jpg &quot;access 1 month&quot;<br />ExpiresByType application/x-shockwave-flash &quot;access plus 3 day&quot;</p>
<p>这么设置是由于我的这些静态文件通常很少更新，因此我选择的是&quot;access&quot;规则，如果更新相对比较频繁，可以改用&quot;modification&quot;规则;或者也可以用&quot;access&quot;规则，但是在文件更新的时候，执行一下&quot;touch&quot;命令，把文件的时间刷新一下即可。</p>
<p>&nbsp;</p>
<p>五、 安装Squid </p>
<p>&nbsp;</p>
<p>五、) 安装Squid<br />[root@localhost]#./configure --prefix=/usr/local/server/squid --enable-async-io=100 --disable-delay-pools --disable-mem-gen-trace --disable-useragent-log --enable-kill-parent-hack --disable-arp-acl --enable-epoll --disable-ident-lookups --enable-snmp --enable-large-cache-files --with-large-files<br />[root@localhost]#make &amp;&amp; make install</p>
<p>或使用如下安装方法：<br />[root@localhost]#yum install squid</p>
<p>如果是2.6的内核，才能支持epoll的IO模式，旧版本的内核则只能选择poll或其他模式了;另外，记得带上支持大文件的选项，否则在access<br />log等文件达到2G的时候就会报错。设定 squid 的配置大概如下内容：<br />#设定缓存目录为 /var/cache1 和 /var/lib/squid，每次处理缓存大小为128MB，当缓存空间使用达到95%时<br />#新的内容将取代旧的而不直接添加到目录中，直到空间又下降到90%才停止这一活动<br />#/var/cache1 最大1024MB，/var/lib/squid 最大 5000MB，都是 16*256 级子目录<br />cache_dir aufs /var/cache1 1024 16 256<br />cache_dir aufs /var/lib/squid 5000 16 256<br />cache_mem 128 MB<br />cache_swap_low 90<br />cache_swap_high 95<br />#设置存储策略等<br />maximum_object_size 4096 KB<br />minimum_object_size 0 KB<br />maximum_object_size_in_memory 80 KB<br />ipcache_size 1024<br />ipcache_low 90<br />ipcache_high 95<br />cache_replacement_policy lru<br />memory_replacement_policy lru<br />#设置超时策略<br />forward_timeout 20 seconds<br />connect_timeout 15 seconds<br />read_timeout 3 minutes<br />request_timeout 1 minutes<br />persistent_request_timeout 15 seconds<br />client_lifetime 15 minutes<br />shutdown_lifetime 5 seconds<br />negative_ttl 10 seconds<br />#限制一个ip最大只能有16个连接<br />acl OverConnLimit maxconn 16<br />http_access deny OverConnLimit<br />#限制baidu spider访问<br />#acl AntiBaidu req_header User-Agent Baiduspider<br />#http_access deny AntiBaidu<br />#常规设置<br />visible_hostname cache.yejr.com<br />cache_mgr <a href="http://www.dzend.com/mailto:webmaster@yejr.com">webmaster@yejr.com</a><br />client_persistent_connections off<br />server_persistent_connections on<br />cache_effective_user nobody<br />cache_effective_group nobody<br />tcp_recv_bufsize 65535 bytes<br />half_closed_clients off<br />#设定不缓存的规则<br />hierarchy_stoplist cgi-bin<br />acl QUERY urlpath_regex cgi-bin<br />cache deny QUERY<br />#不要相信ETag 因为有gzip<br />acl apache rep_header Server ^Apache<br />broken_vary_encoding allow apache<br />#设置access log，并且令其格式和apache的格式一样，方便awstats分析<br />emulate_httpd_log&nbsp;&nbsp; on<br />logformat apache %&gt;a %ui %un [%tl] &quot;%rm %ru HTTP/%rv&quot; %Hs %</p>
<p>初始化和启动squid<br />[root@localhost]#/usr/local/server/squid/sbin/squid -z<br />[root@localhost]#/usr/local/server/squid/sbin/squid</p>
<p>第一条命令是先初始化squid缓存哈希子目录，只需执行一次即可。</p>
<p>六、后记 </p>
<p><br />六、后记一、)想要启用squid所需的改变想要更好的利用squid的cache功能，不是把它启用了就可以的，我们需要做以下几个调整：<br />1、启用apache的 mod_expires 模块，修改 httpd.conf，加入以下内容：<br />#expiresdefault &quot;modification plus 2 weeks&quot;expiresactive<br />onexpiresbytype text/html &quot;access plus 10 minutes&quot;expiresbytype<br />image/gif &quot;modification plus 1 month&quot;expiresbytype image/jpeg &quot;modification<br />plus 1 month&quot;expiresbytype image/png &quot;modification plus 1<br />month&quot;expiresbytype text/css &quot;access plus 1 day&quot;expiresbytype<br />application/x-shockwave-flash &quot;access plus 3 day&quot;<br />以上配置的作用是规定各种类型文件的cache规则，对那些图片/flash等静态文件总是cache起来，可根据各自的需要做适当调整。<br />2、修改 php.ini 配置，如下：<br />session.cache_limiter = nocache<br />以上配置的作用是默认取消php中的cache功能，避免不正常的cache产生。<br />3、修改应用程序例如，有一个php程序页面static.php，它存放着某些查询数据库后的结果，并且数据更新并不频繁，于是，我们就可以考虑对其cache。只需在static.php中加入类似如下代码：<br />header('Cache-Control: max-age=86400<br />,must-revalidate');header('Pragma:');header('Last-Modified: ' .<br />gmdate('D, d M Y H:i:s') . ' GMT' );header(&quot;Expires: &quot; .gmdate ('D, d M Y<br />H:i:s', time() + '86400' ). ' GMT');<br />以上代码的意思是，输出一个http头部信息，让squid知道本页面默认缓存时长为一天。<br />二、)squidclient简要介绍<br />*取得squid运行状态信息： squidclient -p 80 mgr:info<br />*取得squid内存使用情况： squidclient -p 80 mgr:mem<br />*取得squid已经缓存的列表： squidclient -p 80 mgr:objects. use it carefully,it may crash<br />*取得squid的磁盘使用情况： squidclient -p 80 mgr:diskd<br />*强制更新某个url：squidclient -p 80 -m PURGE <a href="http://www.yejr.com/static.php">http://www.yejr.com/static.php</a><br />*更多的请查看：squidclient-h 或者 squidclient -p 80 mgr:</p>
<p><a href="http://www.unixtech.cn/read.php?tid=1179"></a></p>]]></description>
		</item>
		
			<item>
			<link>http://www.dzend.com/default.asp?id=190</link>
			<title><![CDATA[squid 2.6版安装配置]]></title>
			<author>jiangdazheng@163.com(admin)</author>
			<category><![CDATA[squid]]></category>
			<pubDate>Thu,21 Aug 2008 14:55:03 +0800</pubDate>
			<guid>http://www.dzend.com/default.asp?id=190</guid>	
		<description><![CDATA[<p>1、 下载squid 2.6版的软件 <br />官方网址：<a href="http://www.squid-cache.org/">http://www.squid-cache.org/</a>&nbsp; <br />到那里去下载最新版的 squid软件 <br />将此软件包上传至 web主机。并在主机上将下载下来的软件包解压。如果你下载的 gz<br />包的话。就用tar&nbsp;&nbsp;&nbsp; zxvf&nbsp;&nbsp; XXXXX.gz (XXXX.gz 为你下载来的软件包名)&nbsp; 如果你下载的是 gz2<br />包。那么就用&nbsp; tar&nbsp;&nbsp;&nbsp; jxvf&nbsp;&nbsp; XXXX.gz2(XXXX.gz2 为你下载来的软件包名) <br />2、 进入你解压出来的那个目录。然后执行编译安装 <br />./configure&nbsp;&nbsp; <br />--exec_prefix=/usr/local/squid&nbsp;&nbsp; <br />--bindir=/usr/sbin&nbsp;&nbsp; <br />--libexecdir=/usr/lib/squid&nbsp;&nbsp; <br />--sysconfdir=/etc/squid&nbsp;&nbsp; <br />--enable-poll&nbsp;&nbsp; <br />--enable-snmp&nbsp;&nbsp; <br />--enable-removal-policies=&quot;heap,lru&quot;&nbsp;&nbsp; <br />--enable-storeio=&quot;aufs,coss,diskd,null,ufs&quot;&nbsp;&nbsp; <br />--enable-ssl&nbsp;&nbsp; <br />--with-openssl=/usr/kerberos&nbsp;&nbsp; <br />--enable-delay-pools&nbsp;&nbsp; <br />--enable-linux-netfilter&nbsp;&nbsp; <br />--with-pthreads --enable-auth=&quot;basic&quot;&nbsp;&nbsp; <br />--with-winbind-auth-challenge&nbsp;&nbsp; <br />--enable-useragent-log&nbsp;&nbsp; <br />--enable-referer-log&nbsp;&nbsp; <br />--disable-dependency-tracking&nbsp;&nbsp; <br />--enable-cachemgr-hostname=localhost&nbsp;&nbsp; <br />--disable-ident-lookups&nbsp;&nbsp; <br />--enable-truncate&nbsp;&nbsp; <br />--enable-underscores&nbsp;&nbsp; <br />--datadir=/usr/share/squid&nbsp;&nbsp; <br />--enable-basic-auth-helpers=&quot;NCSA&quot;&nbsp;&nbsp; <br />--enable-err-language=&quot;Simplify_Chinese&quot;&nbsp;&nbsp; <br />--enable-default-err-language=&quot;Simplify_Chinese&quot; <br />编译完后再执行 <br />make <br />make install <br />好了。安装完毕后,修改目录权限,默认是以&quot;nobody&quot;用户运行squid.所以我们要为<br />/usr/local/squid/var&nbsp; 设置相应的权限,否则会报以下错误 <br />FATAL: Failed to make swap directory /usr/local/squid/var/cache: (13) Permission denied <br />Squid Cache (Version 2.5.STABLE13): Terminated abnormally. <br />CPU Usage: 0.000 seconds = 0.000 user + 0.000 sys <br />Maximum Resident Size: 0 KB <br />Page faults with physical i/o: 4 <br />或者以下错误 <br />FATAL: Cannot open '/usr/local/squid/var/logs/access.log' for writing. <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; The parent directory must be writeable by the <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; user 'nobody', which is the cache_effective_user <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; set in squid.conf. <br />最简单的处理办法就是 <br />chown -R nobody:nobody /usr/local/squid/var <br />ok,生成缓存目录 <br />/usr/local/squid/sbin/squid -z <br />然后启动squid,测试一下是否成功 <br />/usr/local/squid/bin/Runcache&nbsp;&nbsp; <br />默认端口是3128,用ie测试一下,如果能看到中文的拒绝访问错误提示,就说明安装正确,<br />并且已经使用. <br />&nbsp;<br />以后就可以直接/usr/local/squid/bin/Runcache&nbsp;&nbsp; &amp;&nbsp; 后台运行即可,&nbsp;&nbsp; <br />现在我们开始讲如何配置 squid.conf 文件 <br />visible_hostname localhost #你的主机名可以是localhost <br />http_port 211.XX.XX.XXX:80 vhost vport #你需要做 squid服务器的IP及端口号 <br />icp_port 0 <br />cache_mem 900 MB #squid&nbsp; 所使用的内存 <br />cache_swap_low 90 #缓存最低使用<br />cache_swap_high 95 #缓存最高使用 <br />maximum_object_size 20000 KB #当大于200000K 时不对文件进<br />maximum_object_size_in_memory 4096 KB #放入内存的最小大小<br />cache_dir ufs /dev/shm/tmp 1000 16 256 #这里我们会在后面再讲<br />&nbsp;&nbsp; <br />cache_store_log none <br />cache_vary on #apache 的一个新特性。 <br />emulate_httpd_log on #日志 <br />cache_mgr <a href="http://www.dzend.com/mailto:tpsys@126.com">tpsys@126.com</a> #设置管理员的邮箱<br />logfile_rotate 0 #日志不保存 <br />logformat combined %&gt;a %ui %un [%tl] &quot;%rm %ru HTTP/%rv&quot; %Hs %&lt;st &quot;%{Referer}&gt;h&quot; <br />&quot;%{User-Agent}&gt;h&quot; %Ss:%Sh #日志格式 <br />pid_filename /home/squid/squid.pid #pid文件 <br />cache_log /home/squid/var/logs/cache.log #日志 <br />access_log /home/squid/var/logs/access.log combined #日志 <br />acl all src 0.0.0.0/0.0.0.0&nbsp;&nbsp; #允许所有地址访问 <br />acl QUERY urlpath_regex cgi-bin .php .cgi .avi .wmv .rm .ram .mpg .mpeg .zip .exe .rar&nbsp; 对这一些<br />扩名的文件不缓存<br />cache deny QUERY<br />acl picurl url_regex -i \.bmp$ \.png$ \.jpg$ \.gif$ \.jpeg$ \.rm$ #主要是防盗连。 <br />acl mystie1 referer_regex -i .5i.la #对5i.la防盗连 <br />http_access allow mystie1 picurl <br />acl mystie3 referer_regex -i .wg333.com#对 wg333.com防盗连 <br />http_access allow mystie3 picurl <br />acl mystie4 referer_regex -i .99doc.com#对99doc.com防盗连 <br />http_access allow mystie4 picurl <br />acl mystie2 referer_regex -i .orasos.com#对 orasos.com防盗连 <br />http_access allow mystie2 picurl<br />acl nullref referer_regex -i ^$ <br />http_access allow nullref <br />acl hasref referer_regex -i .+ <br />http_access deny hasref picurl <br />&nbsp;&nbsp; <br />acl Safe_ports port 80 # http #&nbsp; 开放80端口允许进来。 <br />acl Safe_ports port 21 # ftp #&nbsp; 开放21端口允许进来。 <br />http_access deny !Safe_ports <br />tcp_recv_bufsize 65535 bytes<br />acl OverConnLimit maxconn 36&nbsp;&nbsp; #同一个客户端最多只允许连入36 个连接<br />http_access deny OverConnLimit <br />acl tianya referer_regex -i tianya <br />http_access deny tianya <br />deny_info <a href="http://www.baidu.com/logs.gif">http://www.baidu.com/logs.gif</a> tianya <br />&nbsp;&nbsp; <br />refresh_pattern -i .html 1440 100% 129600 reload-into-ims&nbsp;&nbsp; #对HTML 进行缓存 <br />refresh_pattern -i .shtml 1440 100% 129600 reload-into-ims #对SHTML进行缓存<br />refresh_pattern -i .htm 1440 100% 129600 reload-into-ims #对HTM进行缓存 <br />refresh_pattern -i .gif 1440 100% 129600 reload-into-ims #对GIF进行缓存 <br />refresh_pattern -i .swf 1440 100% 129600 reload-into-ims #对SWF进行缓存 <br />refresh_pattern -i .png 1440 100% 129600 reload-into-ims #对 PNG进行缓存 <br />refresh_pattern -i .bmp 1440 100% 129600 reload-into-ims #对BMP进行缓存 <br />refresh_pattern -i .css 1440 100% 129600 reload-into-ims#对 CSS进行缓存&nbsp;&nbsp; <br />refresh_pattern -i .jpg 1440 100% 129600 reload-into-ims #对 JPG 进行缓存 <br />refresh_pattern -i .txt 1440 100% 129600 reload-into-ims #对TXT进行缓存 <br />refresh_pattern -i .rhtml 1440 100% 129600 reload-into-ims #对RHTML进行缓存<br />refresh_pattern -i .xml 1440 100% 129600 reload-into-ims #对XML进行缓存 <br />#以下内容和squid 2.5有所不一样。2.6 中需要通过 cache_peer来设定指向主机，如果你需要<br />做虚拟主机的话。你可以省略 name=a&nbsp; 这个关建字&nbsp; 举例说明<br />cache_peer 192.168.8.105 parent 80 0 no-query originserver name=a&nbsp;&nbsp; <br />#每一个name 关建字。必须要和下面的 cache_peer_domain&nbsp; 一起来使用。 <br />cache_peer 192.168.8.161 parent 888 0 no-query originserver name=b <br />#这里的888&nbsp; 和&nbsp; 808&nbsp; 分别指的是你的apache&nbsp; 或者 IIS&nbsp; 绑定的主机头里的端口号。我们这里<br />是为了安全，所以不采用80端口 <br />cache_peer 192.168.8.88&nbsp; parent 808 0 no-query originserver name=c <br />#808后面的0 为 icp_port 0&nbsp; 这什值。我们目前用不到。所以先不管。你只要写0 就行<br />cache_peer_domain b .orasos.com <br />#比如这一句话的意思就是。当orasos.com这外域来访问 squid时。Squid通确定他使用的是<br />什么域名&nbsp; 这里使用的是 orasos.com&nbsp; 然后来查询 cache_peer_domain&nbsp; 中有没有这个域名。如<br />果有则取这个域名的cache_peer的name&nbsp; 值&nbsp;&nbsp; 我们这里是b&nbsp; 然后再和cache_peer中去比对。<br />有没有name=b这个主机指向。如果有，就从这个主机指向那里取数据 <br />cache_peer_domain a .5i.la <br />cache_peer_domain a .99doc.com <br />cache_peer_domain a .wg333.com <br />cache_effective_user nobody <br />cache_effective_group nobody<br />好了。写了这么多。安装和配置就搞定了。 <br />如果你能看的明白话。我想你装一个Squid起来的话。是绝对不会在问题了的。</p>
<p>&nbsp;</p>]]></description>
		</item>
		
			<item>
			<link>http://www.dzend.com/default.asp?id=189</link>
			<title><![CDATA[批量清除Squid缓存的小工具]]></title>
			<author>jiangdazheng@163.com(admin)</author>
			<category><![CDATA[squid]]></category>
			<pubDate>Mon,11 Aug 2008 23:18:35 +0800</pubDate>
			<guid>http://www.dzend.com/default.asp?id=189</guid>	
		<description><![CDATA[很实用的一个清除squid缓存的小工具：<br/><a href="http://www.wa.apana.org.au/~dean/squidpurge/" target="_blank">http://www.wa.apana.org.au/~dean/squidpurge/</a><br/><br/>wget <a href="http://www.wa.apana.org.au/~dean/sources/purge-20040201-src.tar.gz" target="_blank">http://www.wa.apana.org.au/~dean/sources/purge-20040201-src.tar.gz</a><br/>tar zxvf purge-20040201-src.tar.gz<br/>cd purge<br/>make<br/>[root@cache purge]# ./purge -help<br/>### Use at your own risk! No guarantees whatsoever. You were warned. ###<br/><br/>$Id: purge.cc,v 1.17 2000/09/21 10:59:53 cached Exp $<br/>Usage: purge   [-a] [-c cf] [-d l] [-(f|F) fn | -(e|E) re] [-p h[:p]]<br/>                [-P #] [-s] [-v] [-C dir [-H]] [-n]<br/><br/>-a     display a little rotating thingy to indicate that I am alive (tty only).<br/>-c c   squid.conf location, default &#34;/usr/local/squid/etc/squid.conf&#34;.<br/>-C dir base directory for content extraction (copy-out mode).<br/>-d l   debug level, an o&#114; of different debug options.<br/>-e re single regular expression per -e instance (use quotes!).<br/>-E re single case sensitive regular expression like -e.<br/>-f fn name of textfile containing one regular expression per line.<br/>-F fn name of textfile like -f containing case sensitive REs.<br/>-H     prepend HTTP reply header to destination files in copy-out mode.<br/>-n     do not fork() when using more than one cache_dir.<br/>-p h:p cache runs on host h and optional port p, default is localhost:3128.<br/>-P #   if 0, just print matches; otherwise o&#114; the following purge modes:<br/>           0x01 really send PURGE to the cache.<br/>           0x02 remove all caches files reported as 404 (not found).<br/>           0x04 remove all weird (inaccessible o&#114; too small) cache files.<br/>        0 and 1 are recommended - slow rebuild your cache with other modes.<br/>-s     show all options after option parsing, but before really starting.<br/>-v     show more information about the file, e.g. MD5, timestamps and flags.<br/><br/>1.清除URL中包含jackbillow.com的所有缓存<br/>./purge -p 127.0.0.1:80 -P 1 -se &#39;jackbillow.com&#39;<br/><br/>2.清除 URL 以“.mp3”结尾的缓存文件，例如：<a href="http://www.dzend.com/abc/test.mp3" target="_blank">http://www.dzend.com/abc/test.mp3</a><br/>./purge -p 127.0.0.1:80 -P 1 -se &#39;\.mp3$&#39;<br/>]]></description>
		</item>
		
			<item>
			<link>http://www.dzend.com/default.asp?id=188</link>
			<title><![CDATA[Squid中文权威指南]]></title>
			<author>jiangdazheng@163.com(admin)</author>
			<category><![CDATA[squid]]></category>
			<pubDate>Sun,10 Aug 2008 22:57:40 +0800</pubDate>
			<guid>http://www.dzend.com/default.asp?id=188</guid>	
		<description><![CDATA[<a href="http://home.arcor.de/jeffpang/squid/chap01.html" target="_blank">http://home.arcor.de/jeffpang/squid/chap01.html</a>]]></description>
		</item>
		
			<item>
			<link>http://www.dzend.com/default.asp?id=187</link>
			<title><![CDATA[rhel5基本命令]]></title>
			<author>jiangdazheng@163.com(admin)</author>
			<category><![CDATA[squid]]></category>
			<pubDate>Tue,05 Aug 2008 22:19:18 +0800</pubDate>
			<guid>http://www.dzend.com/default.asp?id=187</guid>	
		<description><![CDATA[2 基本命令使用<br/><br/><br/>2.1 VI<br/><br/>进入编辑状态：i<br/>退出编辑状态：Esc<br/>到第一行：gg<br/>到最後一行：G<br/>到某一行：xxG<br/>到行首：0<br/>到行末：$<br/>复制：yy<br/>贴上：p<br/>复原：u<br/>删整行：dd<br/>删除全部内容：dG<br/>显示行数：:set nu<br/>不显示行数：:set nonu<br/>搜寻：/、再次搜寻：n<br/>储存：:w<br/>离开：:q<br/>储存兼离开：:wq 或 shift+zz <br/>强制离开（不储存）：:q!<br/><br/>2.2 yum<br/><br/>更新：yum up&#100;ate<br/>安装：yum install xxx<br/>移除：yum remove xxx<br/>清除已经安装过的档案（/var/cache/yum/）：yum clean all<br/>搜寻：yum search xxx<br/>列出所有档案：yum list<br/>查询档案讯息：yum info xxx<br/><br/>群组安装功能：<br/><br/>yum grouplist<br/>yum groupinstall &#34;Web Server&#34;<br/><br/><br/>2.3 rpm<br/><br/>安装：rpm -ivh xxx <br/>移除：rpm -e xxx <br/>升级：rpm -Uvh xxx<br/><br/>查询：<br/>查询所有安装的包： rpm -qa <br/>查询某个包：rpm -qa | grep xxx<br/>rpm -qi xxx<br/>查询软件的安装路径：rpm -ql xxx<br/>rpm -qc xxx<br/>查询某个文件是那个rpm包产生：rpm -qf /etc/yum.conf<br/>rpm -qpi xxx<br/><br/>2.4 chkconfig<br/><br/>查看所有服务：chkconfig --list<br/>查看3启动的状态：chkconfig --list | grep 3n<br/>把某些服务设置为启动：chkconfig --level 345 xxx on<br/>把某些服务设置当前启动：chkconfig xxx on<br/>列出某项服务：chkconfig --list xxx<br/><br/><br/>2.5 查看系统状态<br/><br/>查看系统使用字符集：echo $LANG $LANGUAGE<br/>环境变量：set<br/><br/><br/>2.6 解压<br/><br/>如果是以gz結尾的如：test.tar.gz<br/>tar zxvf test.tar.gz<br/><br/>如果是以bz或bz2結尾如：test.tar.bz2<br/>tar jxvf test.tar.bz2<br/><br/><br/>2.7 基本信息查看和修改<br/><br/>查看 IP：ifconfig<br/>修改 IP：<br/>运行命令：system-config-network-tui<br/>或修改：/etc/sysconfig/network-scripts/ifcfg-eth0<br/><br/>FQDN 设定：<br/>hostname<br/>more /etc/hosts<br/>more /etc/sysconfig/network <br/>修改计算机名字<br/>1：vi /etc/sysconfig/network<br/>2：vi /etc/hosts<br/>如果通过 <br/>hostname xxx<br/>来修改计算机名字，则重新启动后就不起作用<br/><br/>DNS 设定：<br/>vi /etc/resolv.conf<br/>nameserver 192.168.1.1<br/>nameserver 202.106.195.68<br/><br/>重新启动网卡：<br/>/etc/rc.d/init.d/network restart<br/><br/><br/>3 登陆后设置<br/><br/><br/>3.1 关闭selinux<br/><br/>1：运行命令setup，可以在图形化界面进行关闭<br/>2：vi /etc/sysconfig/selinux<br/>SELINUX=enforcing 改成--&gt; SELINUX=disabled<br/><br/><br/>3.2 关闭不需要服务<br/><br/>1：运行命令setup<br/>2：运行命令ntsysv<br/>只启用下面9个服务（autofs是为了方便使用光驱，其实可以不启用这个服务）<br/>acpid<br/>anacron <br/>autofs<br/>cpuspeed<br/>crond<br/>network<br/>sshd<br/>syslog <br/>yum-up&#100;atesd<br/><br/>3.3 配置ssh<br/><br/>修改两个地方<br/>vi /etc/ssh/sshd.config<br/>#PermitRootLogin yes 改为 <br/>PermitRootLogin yes<br/><br/>#UseDNS yes 改为 <br/>UseDNS no<br/><br/><br/>3.4 配置yum<br/><br/><br/>mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.save<br/>vi /etc/yum.repos.d/CentOS-Base.repo<br/><br/>######################<br/><br/>[base]<br/>name=CentOS-5 - Base<br/>repo=os<br/>baseurl=http://centos.ustc.edu.cn/centos/5.1/os/$basearch/<br/>gpgcheck=1<br/>gpgkey=http://centos.ustc.edu.cn/centos/RPM-GPG-KEY-CentOS-5<br/><br/>[up&#100;ate]<br/>name=CentOS-5 - Up&#100;ates<br/>baseurl=http://centos.ustc.edu.cn/centos/5.1/up&#100;ates/$basearch/<br/>gpgcheck=1<br/>gpgkey=http://centos.ustc.edu.cn/centos/RPM-GPG-KEY-CentOS-5<br/><br/>[addons]<br/>name=CentOS-5 - Addons<br/>baseurl=http://centos.ustc.edu.cn/centos/5.1/addons/$basearch/<br/>gpgcheck=1<br/>gpgkey=http://centos.ustc.edu.cn/centos/RPM-GPG-KEY-CentOS-5<br/><br/>[extras]<br/>name=CentOS-5 - Extras<br/>baseurl=http://centos.ustc.edu.cn/centos/5.1/extras/$basearch/<br/>gpgcheck=1<br/>gpgkey=http://centos.ustc.edu.cn/centos/RPM-GPG-KEY-CentOS-5<br/><br/>[centosplus]<br/>name=CentOS-5 - Plus<br/>baseurl=http://centos.ustc.edu.cn/centos/5.1/centosplus/$basearch/<br/>gpgcheck=1<br/>enabled=0<br/>gpgkey=http://centos.ustc.edu.cn/centos/RPM-GPG-KEY-CentOS-5<br/><br/>[contrib]<br/>name=CentOS-5 - Contrib<br/>baseurl=http://centos.ustc.edu.cn/centos/5.1/contrib/$basearch/<br/>gpgcheck=1<br/>enabled=0<br/>gpgkey=http://centos.ustc.edu.cn/centos/RPM-GPG-KEY-CentOS-5<br/>###################<br/><br/><br/>rpm --import <a href="http://centos.ustc.edu.cn/centos/5.1/os/i386/RPM-GPG-KEY-CentOS-5" target="_blank">http://centos.ustc.edu.cn/centos/5.1/os/i386/RPM-GPG-KEY-CentOS-5</a><br/><br/>yum up&#100;ate<br/><br/><br/><br/>4 ：编译前准备<br/><br/>4.1 安装编译器gcc<br/>最小化安装，没有安装编译器<br/>yum install gcc<br/><br/>4.2 gcc-c++<br/>如果不安装，在编译mysql的时候会出现【exec: g++: not found】错误<br/>yum install gcc-c++<br/><br/>5：安装软件<br/><br/>5.1安装mysql<br/><br/>1:去下载一个ncurses-5.6.tar.gz，<br/>tar zxvf ncurses-5.6.tar.gz<br/>cd ncurses-5.6 <br/>./configure --prefix=/usr --with-shared --without-debug<br/>make<br/>make install clean<br/><br/><br/>2：安装mysql <br/>tar -zxvf mysql-5.0.51a.tar.gz <br/>cd mysql-5.0.51a<br/>./configure --with-mysqld-user=mysql --prefix=/usr/local/mysql5 --with-extra-charset=all --without-isam --exec-prefix=/usr/local/mysql5<br/>echo $?<br/>make &amp;&amp; make install<br/><br/><br/>3：初始化数据库：<br/>groupadd mysql<br/>useradd -g mysql mysql<br/>scripts/mysql_install_db<br/>cp /usr/local/mysql5/share/mysql/my-medium.cnf /usr/local/mysql5/var/my.cnf <br/>cp /usr/local/mysql5/share/mysql/mysql.server /etc/init.d/mysqld <br/>chkconfig --add mysqld <br/>chkconfig --level 2345 mysqld on<br/>chown mysql:mysql -R /usr/local/mysql5/<br/>service mysqld start<br/>ln -s /usr/local/mysql5/bin/mysql /sbin/mysql <br/>ln -s /usr/local/mysql5/bin/mysqladmin /sbin/mysqladmin<br/><br/><br/>4：设定mysql密码<br/>mysqladmin -uroot password &#34;123456&#34;<br/><br/><br/>5：让系统找到mysql（如果必要的话）： <br/>PATH=$PATH:/usr/local/mysql5/bin <br/>export PATH <br/>echo &#34;/usr/local/mysql5/lib/mysql&#34; &gt;&gt; /etc/ld.so.conf <br/>ldconfig<br/><br/>6：:测试 <br/>netstat -nplt | grep mysql<br/>ps aux|grep mysql<br/><br/>5.2 安装apache<br/><br/>1：编译安装<br/>tar zxvf httpd-2.2.8.tar.gz <br/>cd httpd-2.2.8<br/>./configure --prefix=/usr/local/apache2 --enable-so --enable-rewrite<br/>echo $?<br/>make &amp;&amp; make install<br/>/usr/local/apache2/bin/apachectl configtest<br/>/usr/local/apache2/bin/apachectl start<br/>/usr/local/apache/bin/apachectl stop<br/>2：修改默认启动页<br/>vi /usr/local/apache2/conf/httpd.conf<br/>DirectoryIndex index.html 改为<br/>DirectoryIndex index.html index.htm default.htm default.html index.php index.php3 index.jsp<br/>#ServerName www.example.com:80 改为<br/>ServerName www.example.com:80<br/><br/>3：apache 开机启动的办法<br/>1：#echo &#34;/usr/local/apache/bin/apachectl start&#34; &gt;&gt;/etc/rc.local(系统启动时服务自动启动)<br/>2:创建一个httpd启动脚本，内容如下：<br/>cp /usr/local/apache2/bin/apachectl /etc/init.d/httpd<br/>vi /etc/init.d/httpd<br/>在第三行添加以下内容<br/>#chkconfig:345 85 15<br/>#description: Start and stops the Apache HTTP Server.<br/><br/>chmod +x /etc/rc.d/init.d/httpd<br/>chkconfig --add httpd<br/><br/>修改乱码<br/>步骤1： <br/>在httpd.conf中将Include conf/extra/httpd-autoindex这个模块的注释去掉<br/>@vi /usr/local/apache/conf/httpd.conf<br/>步骤2： <br/>在httpd-autoindex.conf中加入IndexOptions Charset=UTF-8<br/>@vi /usr/local/apache/conf/extra/httpd-autoindex.conf<br/><br/>5.3 安装GD<br/><br/>1：安装ZLIB2<br/><br/>######zlib#############<br/><br/>tar zxvf zlib-1.2.3.tar.gz<br/>cd zlib-1.2.3<br/>./configure<br/>make<br/>make install clean<br/><br/>2：安装PNG<br/><br/>##########libpng###########<br/><br/>tar zxvf libpng-1.2.26.tar.gz<br/>cd libpng-1.2.26<br/><br/>cp scripts/makefile.linux ./makefile<br/>./configure --prefix=/usr/local/libpng<br/><br/>make<br/>make install clean<br/><br/>3：安装freetype<br/><br/>##########freetype#########<br/><br/>cd freetype-2.3.5 <br/>./configure <br/>make<br/>make install<br/><br/>4：安装JPEG6<br/><br/><br/>#########jpeg###############<br/><br/>tar zxvf jpegsrc.v6b.tar.gz<br/>cd jpeg-6b<br/>mkdir -pv /usr/local/jpeg/{,bin,lib,include,man/man1,man1}<br/>./configure --prefix=/usr/local/jpeg --enable-shared --enable- static<br/>make<br/>make install<br/><br/>5：安装GD<br/>########GD###########<br/><br/>tar zxvf gd-2.0.35.tar.gz<br/>cd gd-2.0.35<br/>./configure --with-png --with-freetype --with-jpeg=/usr/local/jpeg/<br/><br/>make<br/>make install<br/><br/>5.4 安装php<br/><br/>1：安装LIBXML2<br/>#####libxml2 #####<br/><br/>tar zxvf libxml2-2.6.31.tar.gz<br/>cd libxml2-2.6.31<br/>./configure --prefix=/usr/local/libxml2<br/>make<br/>make install<br/>cp xml2-config /usr/bin<br/><br/>2：:安装PHP5.2.5<br/><br/>#########php##########<br/><br/>tar zxvf php-5.2.5.tar.gz <br/>cd php-5.2.5<br/>./configure --prefix=/usr/local/php5 --with-mysql=/usr/local/mysql5 --with-apxs2=/usr/local/apache2/bin/apxs --with-jpeg-dir=/usr/local/jpeg --with-freetype-dir=/usr/local/include/freetype2 --with-zlib --with-png-dir=usr/local/libpng12 --with-libxml-dir=/usr/local/libxml2 --with-gd --enable-ftp --enable-sockets<br/>make<br/>make test<br/><br/>make install<br/><br/><br/>3：配置<br/>cp php.ini-dict /usr/local/php5/lib/php.ini<br/>编辑httpd.conf<br/>/usr/local/apache2/conf/httpd.conf<br/>加载php模块，去掉注释,我的版本是缺省就启用的。<br/>LoadModule php5_module        modules/libphp5.so<br/><br/>加上下面两行<br/>AddType application/x-httpd-php .php .phtml<br/>AddType application/x-httpd-php-source .phps<br/><br/><br/>5.5 安装zend<br/><br/>tar -zxvf ZendOptimizer-3.0.0-linux-glibc23- x86_64.tar.gz<br/>cd ZendOptimizer-3.0.0-linux-glibc23-x86_64<br/>./install<br/><br/>5.6 安装phpmyadmin<br/><br/>cp -rf phpMyAdmin-v2.11.5.2 /usr/local/apache2/htdocs/phpmyadmin<br/><br/>cd /usr/local/apache2/htdocs/phpmyadmin/<br/><br/>cp config.sample.inc.php config.inc.php<br/>vi config.inc.php<br/>$cfg[&#39;blowfish_secret&#39;] = &#39;&#39;改为<br/>$cfg[&#39;blowfish_secret&#39;] = &#39;dd&#39;<br/><br/>只要不为空就可以了，这样就可以登陆，如果还有问题，就修改一下语言就解决“配置文件现在需要绝密的短语密码(blowfish_secret)”这个错误了。<br/>]]></description>
		</item>
		
</channel>
</rss><a href="http://www.77276566.cn">小鱼BLOG</a>
<a href="http://www.68cs.com">传奇世界私服</a>
<a href="http://www.sf1111.com">传奇世界私服</a>
<a href="http://www.gamesenetcom.cn">魔域私服</a>
<a href="http://www.955620.cn">传世私服</a>
<a href="http://www.955680.cn">传世私服</a>
<a href="http://www.955650.cn">传奇私服</a>
<a href="http://www.tnbju.cn">传世私服</a>
<a href="http://www.fkjia.cn">传奇世界私服</a>
<a href="http://www.gxyju.cn">传奇世界私服</a>
<a href="http://www.4qy.cn">魔域私服</a>
<a href="http://www.4qz.cn">魔域私服</a>
<a href="http://qosoo.cn">机战私服</a>
<a href="http://www.mzpet.com">传奇世界私服</a> 
<a href="http://www.zhizuntl.cn">天龙八部私服</a> 
