<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title><![CDATA[Wilson Chiao's Web-blog]]></title> 
<link>http://my.clicknow.cn/index.php</link> 
<description><![CDATA[My Live Record, FootPrint]]></description> 
<language>zh-cn</language> 
<copyright><![CDATA[Wilson Chiao's Web-blog]]></copyright>
<item>
<link>http://my.clicknow.cn/read.php/219.htm</link>
<title><![CDATA[服务器托管的门道]]></title> 
<author>点击生活 &lt;&gt;</author>
<category><![CDATA[服务器]]></category>
<pubDate>Thu, 15 Jul 2010 13:02:34 +0000</pubDate> 
<guid>http://my.clicknow.cn/read.php/219.htm</guid> 
<description>
<![CDATA[ 
	<p>首次托管服务器经验 </p><p>随着个人创业及小型公司企业的增多，使用服务器提供相关资讯、下载、邮件等服务已经不再是什么新鲜的事情，像近年来网络创业的个人用户也非常多，在网上的众多提供娱乐影音下载、论坛BBS等主机实际上相当一部分就是个人提供的。很多原来在家中架设服务器提供服务的用户已经感到环境的压力，特别是对于一些有已经有收费服务的服务器，更是需要有良好的环境（全天候的空调环境及稳定的电力供应等），所以选择主机托管的情况也越来越多了。不过由于主机托管目前在国内还处不太成熟的状态，很多准备办理托管的朋友对此也是一知半解，下面笔者根据自身的经验，来说一说托管主机需要准备些什么，要用什么样的标准去挑托管商，在实际操作时要注意些什么事项等等，特别是在选择托管商方面，笔者来往的朋友之中许多人的业务与服务器托管有关，自己也曾多次将服务器托管到不同的机房，亲身经历加上耳闻目睹，可说对&ldquo;选择一个放心的托管商&rdquo;这个话题深有感触。 </p><p>一、托管前的准备－－精打细算，在机房你才知道什么叫寸土如金 </p><p>1、托管能带来那些好处 </p><p>现在许多单位还在用虚拟主机，不仅价格贵，而且由于与别的网站共用一台服务器，所以速度、带宽受到诸多影响，托管服务器能带来很多好处，首先，不受别人影响，网站更加稳定高速；其次，由于获得了服务器的完全控制权，可以运行许多原来不能运行的程序和服务；再次，还大大增强了数据的安全性，想想看，自己的数据总是放在别人电脑里，总觉得不踏实，这下不必担心了。 </p><p>对于那些打算靠服务器创业掘金的朋友，服务器的利用价值就更大了，可以对外提供诸如、电影下载、网络游戏、网络社区、企业邮局、虚拟主机等多种服务，其中最常见的是虚拟主机，现在虚拟主机虽然遍地皆是，不过空间大一些可运行数据库的高档型虚拟主机价格还是不便宜的，例如一个支持数据库的500M虚拟主机空间，收费多在1000元以上，一台拥有120G硬盘的服务器，理论上可以开200多个这种空间，当然实际是不可能的，就算开只开十分之一，开20个这种空间，那么收费也在2万元，还可以同时开各种低档的空间，现在许多非IT类的企业网站都是静态的产品展示性网站，而且访问量很低，占用系统资源和带宽很少，同时开几百个不是问题，假如每个100M，收费100元，那么又可以收费1万元，这样算下来，就已经收费3万元，减去服务器硬件投入5000元，再减去服务器托管费用5000元/年，一年下来还有2万元毛利润！如果同时托管10台服务器呢？第二年呢，就没有硬件成本了，最多增加一块120G的硬盘，才几百元，算算利润。呵呵，实际上，许多朋友还同时开办许多其他服务，例如企业邮局、电影下载会员收费等等，一台服务器弄好了真是一个聚宝盆啊。 </p><p>2、托管服务器选择什么类型更好？ </p><p>很多朋友都知道在机房租个位置不便宜。对于很多个人或者小型公司企业来说，在初期的投资虽然想尽可能省，但是却要学会如何去省，不该省的可别省了。托管主机建议是托管1U的机架式服务器，虽然初期硬件成本高一点，但是长远看还是这样比较合算，因为电信机房的托管费都是按照1U每年多少钱来计算的，假如你的服务器个头太高，无疑就要多付出更多的托管费用，例如，在北京某机房，托管1U服务器4000元/年，托管2U服务器就要6000元/年，由此可见，1U服务器在主机托管领域的应用是很有实际意义的。托管1U服务器与托管其他种类的服务器（例如2U服务器、塔式服务器等）相比，托管费肯定是最便宜的。所以，要去托管，就请先把你塔式服务器里的配件拿出来，装进1U服务器机箱里，这能为您省下一大笔银子，想想，服务器是要托管很多年的啊，得省多少钱啊。 </p><p>二、&ldquo;纸上谈兵&rdquo;－－如何挑选一个好的托管商 </p><p>经典疑问：贵是否一定就好？ </p><p>很多朋友问我，选哪个托管商好？如果您是学法律的，那我问你，我要打个官司，选哪个律师行好？如果您是汽车行业的，我要买汽车，那我问你买什么汽车好？是不是觉得一言难尽，你肯定会说：&ldquo;这先看你是什么情况，有什么具体要求。。。&rdquo;一大堆这样的道理。我们中国有句老话&ldquo;一分钱一分货&rdquo;，那是不是把这个原则套到所有事物身上都正确呢？按照一些人的说法&ldquo;别瞎挑了，选贵的一定不会错&rdquo;，笔者坚定地说，这样是观点是错的！我不说服务器托管的例子，说汽车的吧，大家更为熟悉，如果别人问你买什么汽车好，你说挑贵的就不错，那中国不是全都跑大奔宝马法拉利了？好的定义不是单方面的，消费者去选购产品或者选购服务，是双方的事情，不同需求的客户自然会有不同的选择，开的士的司机都知道法拉利起步及速度都够快，但是事实上满街跑的都是捷达夏利什么的，就是这个道理。所以托管主机你别盲目去选贵的就行，就像用法拉利拉客，拉一辈子还赚不回本。 </p><p>经典误区：盲目一味追求低价 </p><p>答案大家想必猜得到，便宜未必没好货。不过即使是这样，笔者还是建议不要采用那种超级便宜的托管商，便宜中的好货有是有，但是机率太低了，还是放弃吧。这可是个硬道理，要不到时吃亏就后悔莫及了。 </p><p>1、低价服务商变数大得惊人 </p><p>现在市场上，主机托管的价格参差不一，同样托管1U主机，贵的开价8000元/年，便宜的只要2000元/年，之所以这样，因素很多，虽然不能说贵的就一定好，但是也千万不要以为越便宜越好。那么低价的服务商差在哪了？其实当中有一个很重要的因素就是服务商的规模，是不是能够始终如一地经营，因为现在做托管服务门槛较低，管理的也不是很严格，两个大学生到机房租一个机柜就可以搞，但是小公司、个人服务的不稳定因素太多，以我的经验基本上半年左右80％就要有变化，一旦遇到经济波动或者机房租金上调利润太少，撒手不管了，或者乱换地方，乱换IP，就惨了，不要以为这很少见，其实现在这种情况是多数。 </p><p>2、跑路事件时有发生 </p><p>许多小公司的技术力量太弱，这在维护十几台服务器的时候还不明显，一旦靠低价吸引来的客户多了，弊端就显示出来了，比如几十台服务器的时候，一两个技术员维护起来就很困难了。客户多了，问题自然也就多起来，死机、重启、速度慢、去机房检修线路、带客户去机房、杀毒、机房出问题等等，无论什么问题，客户都觉得是托管的问题，客户半夜三更打手机咆哮是常事，本来收钱就少，一旦后续托管的少了，资金周转只出不进，还得继续维护这些服务器到年底，你说能不烦吗？烦透了，手机一关，爱谁谁了，呵呵。这可不新鲜，前几天就有一个哥们扔下40多台机器，跑去度假去了，手机一停万事皆休。肺腑之言，希望能给朋友们一些帮助。 </p><p>当然，我并没有贬低小公司的意思，我觉得只要小公司认真做事，负责任，有耐力，是完全可以选择的，但是有些事情真的不以人的意志为转移，我看到很多小公司，开始雄心万丈，不到半年，多数不到3个月，就出大问题。因为这期间正是客户多不多少不少，麻烦事情多的阶段，很多公司挺不过去，就倒了。有时候真的挺不过去啊，你想想就两个人，半夜来电话，服务器出问题，就要去机房，这边客户电话不断，气势汹汹，那边机房拖拖拉拉，有问题不解决，您说能不倒闭吗？ </p><p>再次奉劝那些要托管主机的朋友，如果您将来服务器上是要放置上百个企业的网站资料，那就要小心行事，一旦出问题，只要有一两家企业因为服务器中断，告到工商局，你就惨了，轻则罚款，重则关门，所以尽量要选择有实力的规范的大公司，至少不会最后不接电话而上演人间蒸发。 </p><p>三、实战经验－－轻松四招教你挑选 </p><p>第一招：第一次托管不妨先看ICP证 </p><p>如果您是第一次托管，想要靠这台服务器创业，掘出人生第一桶金，那么首先绝对不要考虑没有icp许可证的&ldquo;小公司&rdquo;，要锁定资质好，规模大，名气大，信誉高的大公司，这是基本原则，就算多花几千元也值得，这个将来你就会明白为什么。 </p><p>第二招：尽量跨过不必要的中间商（中介） </p><p>尽量跨过不必要的中间商，少绕弯子，这倒不全是为了省钱（当然这也是其中因素之一），因为中间商越多，将来的不稳定因素就越多，可能发生互相推诿，很难办。要尽量找到那些直接从机房租用机柜的托管服务商。有朋友问是不是最好直接托管到机房最好？我认为也未尝不可，不过有时候直接托管到机房，价格要比通过中间商贵很多，因为机房主要是针对那些租用机柜的公司，对零星的托管服务器的客户不是很重视，服务上也不一定赶得上好的托管服务商。 </p><p>第三招：先别急着考察机房，建议先考察服务商 </p><p>记住，不要约服务商在机房见面，因为考察机房是其次，考察服务商才是根本，要去服务商的公司看看，房子大不大？人多不多？规模行不行？技术行不行？历史长不长？一般服务商都迫不及待约你去看豪华的机房，但是记住，机房再豪华，人家机房也不会给你负任何责任，出了问题你只有找服务商。 </p><p>不要选择没有固定电话、固定场所的网站做托管，特别不要理睬那些只留小灵通、神州行、QQ号码、E-mail的人，这类人员随时会人间蒸发，别看他们网上电话与你谈得火热，到了正经事的时候就含糊了，所以千万别把机器放他们哪儿搁，否则机器丢了你都没法报案。 </p><p>第四招：考察机房重点放在它的规模、历史 </p><p>虽然考察机房次要，但是考察一下也是很必要的，不要只听服务商吹嘘带宽、速度多好，要看机房的规模、历史。现在北京机房林立，不时有新的机房涌现，一说都是电信级别，人家说的可是电信级机房，没说是电信开的啊，不要误解啊，呵呵。服务商可能会给你当面测试网站的速度，但是带宽好速度好不一定永远好，这话说着绕口，但却是个业内共知的规律。一个新机房最初因为机器少，所以速度肯定比较快，但是这种新机房考虑到初期的启动成本，往往通往互联网主干线的总出口较小，经营一段时间，客户多了，速度就会慢得惊人（这个阶段不会很长，因为新机房开始总以低价格吸引租户，很快就会人满为患），而且许多新机房因为人才、设备、经验、规章跟不上，导致许多怪异的问题，比如win2000机器快，freebsd机器就慢；一旦出事，解决问题速度奇慢；经常中断服务检修等等。还有就是现在机房一般外观都比较豪华，例如多开设在四、五星级大厦里，这个什么也说明不了。 </p><p>要多看看历史悠久的老牌子机房，不要以为老机房设备陈旧，其实它能稳定经营这么久，其积淀的人才、经验、设备、信誉、规矩，正是新机房欠缺的。 </p><p>四、真知灼见－－容易忽视的几大挑选学问 </p><p>1、要签订严谨的托管合同 </p><p>一定要签订严谨的托管合同，明确双方责任、权利，例如，服务商调试机器或者移动机器改变IP要及时提前三天通知用户，否则就要赔偿损失；服务商无权将服务器转托给别人等等。如果可能，最好看看托管服务商的营业执照、ICP证，如果开业时间太短的，最好敬而远之。 </p><p>2、 最好不要异地托管 </p><p>如果本地有机房最好在本地托管，不要千里迢迢托管到外地，因为服务器不可能全都依赖远程维护，有时候避免不了本地维护，而远在外地，没有人会帮您维修硬件、安装软件，即使帮您也很大不乐意，或者收费很黑，没有必要。 </p><p>3、独享与共享，别给商家给糊弄了 </p><p>托管商所提供的带宽，现在主要有两种形式，一种是独享，比如独享1兆、独享10兆、独享百兆，就是指你的这台服务器可以独享这个带宽，不和别的服务器分享，不会受到别人服务器的干扰，价格较贵；另一种形式就是最常见的百兆共享，顾名思义，就是一个机柜有100M带宽，供这个机柜里所有的服务器共享（一般放十几台，也有心肠狠放几十台的），这种形式现在最普遍，价格最低，性能也不错，一般大家看各个网站的服务器托管报价都是指的这个形式。需要强调的是，独享和共享是完全不同的两个概念，二者的价格也不可同日而语，即便是独享1M价格也比共享百兆贵。初次创业手头不宽裕的朋友，还是先选择共享为好，只要选对服务商，其速度也是很好的。 </p><p>我经常接到一些&ldquo;菜鸟&rdquo;朋友咨询电话，问我：如果托管在百兆共享的机柜里，能否保证我30M的带宽吗？呵呵，大家想想，如果独享30M要多少钱？明摆着这是不可能的，实际情况是，在一般的机房里，如果你的服务器连续几天占用带宽在5M以上，你就要小心了，弄不好就要被机房赶出去了。你会把整个机柜里的服务器的速度拖得很慢，大家会不干的。你可能不理解，既然是100M共享，假如有十台服务器，那么100M&divide;10台＝10M/台，可惜现实不是这样的除法。因为，百兆共享并不意味着机柜连入互联网的速度就有100M。 </p><p>那么一个机柜连接互联网的带宽真的到底有多少？其实业内公认的能有10M－20M就不错了，为什么呢？众说不一，总之是不要担心自己百兆网卡不够用，能给你持续提供十几天2M不嚷嚷的机房就不错了，那些张口承诺在百兆共享里给您辟出30M独享的人绝对是骗子！不用多考虑。 </p><p>也许有的朋友会问，我的托管商在合同里给我写明了&ldquo;保证每台服务器100Mbps的连接速度，保证每台服务器10Mbps的可用带宽，&rdquo;这个说法其实很模糊，谁都知道只要将服务器接入机柜里面的那个百兆交换机，在电脑屏幕右下角的闪烁小电脑标志就会显示100Mbps连接，可是这并不能说明这台服务器连接到互联网的速度是100M。只能说明您的服务器连接到交换机是100M，可惜这没有多大意义，就算在交换机上给这个服务器分配10M独享，可是您的机柜交换机连接到互联网主干线的速度只有10几兆，也还是不能保证每台服务器拥有真正的10M带宽啊！除非在合同里写明，保证每台服务器连接到互联网主干线的带宽不低于10M，那才是真的，是不是？这一招具有误导性，很多服务商在合同里不写明白，所以导致很多人真的以为自己拥有了独享10M的带宽，其实这么做是不严谨的。应该说清楚，因为保证服务器到交换机100M和保证服务器到互联网100M完全是天壤之别，这就是为什么百兆共享托管每年只需2000多元，而一旦是真正地独享10兆，动辄就要上万元一年？！就是这个道理。把话说清楚，也可以避免纠纷。 </p><p>4、 不限流量不代表不限带宽，谁都不限制等于谁都限制 </p><p>在很多托管合同里，往往写明：不限制流量。听着不错，其实呢，要搞清楚，流量不等于带宽啊，不限制流量不代表不限制带宽，就好比说，一个自来水龙头，不限制流量，但是限制流速，龙头只拧开细细一丝，虽然不限制流量，但是一个小时也放不满一缸水。这也是一个文字游戏。还有一些托管商，明确表示：我们不但不限制流量，而且不限制带宽！听着很厉害，其实人家还有后面一句话：我不限制你，也不限制别人！得了，全是废话，都不限制，那么一个机柜里好几台机器都是做下载的，最终大家速度慢如老牛，你去找托管商理论，人家振振有辞：没办法，我并没有保证你的最低带宽，我不限制你的流量和带宽，也就不能限制别人的流量和带宽，带宽就这么多，谁的机器好，抢的多，就是谁的，我没法限制。最终才明白，这种无限制是最可怕的，很可能最慢。如果大家还不明白，我再举个例子，比如在十字路口，一般都会有红绿灯，对于两条路来说，那就是有&ldquo;限制&rdquo;的，但正是这样的限制才能保证交通畅顺，但是如果大家都觉得红绿灯是在浪费时间，交通部门把它给拿掉的话，那么车子就一脑儿都堵上去了，这时候你通过十字路口的速度恐怕会非常慢，这种&ldquo;不限制&rdquo;却成了&ldquo;限制&rdquo;了。 </p><br/>Tags - <a href="http://my.clicknow.cn/go.php/tags/%25E6%259C%258D%25E5%258A%25A1%25E5%2599%25A8%25E6%2589%2598%25E7%25AE%25A1/" rel="tag">服务器托管</a> , <a href="http://my.clicknow.cn/go.php/tags/%25E7%25A7%259F%25E7%2594%25A8%25E6%259C%258D%25E5%258A%25A1%25E5%2599%25A8/" rel="tag">租用服务器</a>
]]>
</description>
</item><item>
<link>http://my.clicknow.cn/read.php/211.htm</link>
<title><![CDATA[上海电信DNS地址]]></title> 
<author>点击生活 &lt;&gt;</author>
<category><![CDATA[服务器]]></category>
<pubDate>Thu, 17 Jun 2010 03:25:25 +0000</pubDate> 
<guid>http://my.clicknow.cn/read.php/211.htm</guid> 
<description>
<![CDATA[ 
	<div>208.67.222.222&nbsp;</div><div>208.67.220.220&nbsp;</div><div><br /></div><div>61.152.82.18&nbsp;</div><div>61.177.7.1&nbsp;</div><div>221.228.255.1</div><div><br /></div><div>202.96.199.132&nbsp;</div><div>202.96.199.133&nbsp;</div><div><br /></div><div>202.96.209.5&nbsp;</div><div>202.96.209.133</div><br/>Tags - <a href="http://my.clicknow.cn/go.php/tags/%25E4%25B8%258A%25E6%25B5%25B7dns/" rel="tag">上海dns</a> , <a href="http://my.clicknow.cn/go.php/tags/%25E7%2594%25B5%25E4%25BF%25A1dns/" rel="tag">电信dns</a> , <a href="http://my.clicknow.cn/go.php/tags/dns%25E8%25AE%25BE%25E7%25BD%25AE/" rel="tag">dns设置</a> , <a href="http://my.clicknow.cn/go.php/tags/dns%25E5%259C%25B0%25E5%259D%2580/" rel="tag">dns地址</a>
]]>
</description>
</item><item>
<link>http://my.clicknow.cn/read.php/197.htm</link>
<title><![CDATA[win2003系统IIS下Rewrite组件防盗链方法]]></title> 
<author>点击生活 &lt;&gt;</author>
<category><![CDATA[服务器]]></category>
<pubDate>Thu, 22 Apr 2010 12:45:16 +0000</pubDate> 
<guid>http://my.clicknow.cn/read.php/197.htm</guid> 
<description>
<![CDATA[ 
	<p>win2003 IIS下Rewrite组件防盗链方法<br /></p><p>首先要说的是&ldquo;盗链&rdquo;很常见的现象，虽然没有采集那么&ldquo;流行&rdquo;，但是对于被盗者来说，碰到这事还真的及时解决，要不资源的消耗很可能会影响自身网站的正常运营。那究竟什么是盗链，怎样防止网站的信息被盗链呢？下面简单的说下：<br />&ldquo;盗链&rdquo;的定义是：此内容不在自己服务器上，而通过技术手段，绕过别人放广告有利益的最终页，直接在自己的有广告有利益的页面上向最终用户提供此内容。<br /><br />一般盗链分为文件盗链和图片盗链两种，什么下载站，图片站了，这里不得不说的是某些少数人拿着数百M的虚拟空间就想做下载、图片站；所以一般盗链就这样发生了。笔者前天发现Du Meter实时下载流量增加数倍，而IP和PV未见明显变化，持续一天左右，我采取了简单的防盗链，结果数分钟之后就恢复正常了。我采用的方法是利用Rewrite组件，用discuz论坛且静态页面的朋友都知道，下面以图文混排的方式简单的说下。<br /></p><p>1、下载Rewrite压缩包，解压安装，玩论坛安装过的可免去这步。需要的可以窗口我。<br />2、打开安装目录下的httpd.ini文件，在最后加上以下语句<br /></p><p>以下为引用的内容：<br />RewriteCond Host: (. ) <br />RewriteCond Referer: (?!http://&#92;1.*).* <br />http://.*&#92;.baidu&#92;.com&#124;.*&#92;.google&#92;.com&#124;.*googlebot&#92;.com&#124;.edu.yuanma.cc).*).*$<br />RewriteRule .*&#92;.(?:gif&#124;jpg&#124;png&#124;exe&#124;rar&#124;zip) /block.gif [I,O,N]<br /></p><p>大体意思是，若请求不来自本站则拒绝请求，转而显示所防盗链网站根目录下的block.gif图片，图片适合图片站，对于下载站而言最好的当然是转跳页面了。第三行代码为被允许的网站。<br /></p><p>3、添加ISAPI筛选</p><p>最后重启下你的网站，一个简单的防盗链系统就完成了。</p><br/>Tags - <a href="http://my.clicknow.cn/go.php/tags/iis/" rel="tag">iis</a> , <a href="http://my.clicknow.cn/go.php/tags/win2003%25E9%2598%25B2%25E7%259B%2597%25E9%2593%25BE/" rel="tag">win2003防盗链</a> , <a href="http://my.clicknow.cn/go.php/tags/%25E5%259B%25BE%25E7%2589%2587%25E7%259B%2597%25E9%2593%25BE/" rel="tag">图片盗链</a>
]]>
</description>
</item><item>
<link>http://my.clicknow.cn/read.php/149.htm</link>
<title><![CDATA[少走弯路--专家解读服务器DIY十大误区]]></title> 
<author>点击生活 &lt;&gt;</author>
<category><![CDATA[服务器]]></category>
<pubDate>Sun, 23 Aug 2009 13:22:07 +0000</pubDate> 
<guid>http://my.clicknow.cn/read.php/149.htm</guid> 
<description>
<![CDATA[ 
	<div align="center"><span style="font-size: medium"><strong>少走弯路 专家解读服务器DIY十大误区</strong></span></div><br /><p>第1页：离开带宽大小谈配置高低 <br />第2页：重视风扇数量，轻视风路布局 <br />第3页：重视风扇转速，轻视硬盘震动 <br />第4页：言必称Raid，非要用Raid卡<br />第5页：重速度，轻稳定性 <br />第6页：排斥集成，都是独立的好 <br />第7页：Linux肯定比Window强，不考虑维护成本 <br />第8页：不分用途攀比配置 <br />第9页：配置性价比考虑不足 <br />第10页：忽视服务器DIY细节 <br />&nbsp;<br />　　【IT168 专稿】随着电脑配件的标准化程度越来越高，以及价格的不断下降，DIY已经不局限于普通的PC机产品。在服务器领域，也有越来越的DIY产品出现。据圈儿内人士介绍，这类用户多以创业型的互联网公司、中小型IDC（Internet Data Center）等为代表。节约成本几乎是他们DIY的第一原动力。</p><p>　　然而，这其中的有些人，由于认识上不足导致的连锁反应，致使其并没有达到有效节约成本的最简单目标。这些认识包括应用需求不清楚、对服务器产品本身认识不到位、对DIY流程和注意事项不了解，等等，不一而足。如何保证通过DIY真正达到节省成本，同时满足自身需求，是众多服务器DIY爱好者关注的重点。<br />&nbsp;</p><p>　　唐华，一个打拼于中关村多年的服务器DIY专家，经他之手的DIY服务器不下数千台，接触过的用户难以计数。这位草根英雄，通过自身的实战经验，为我们梳理了服务器DIY的典型十大误区，希望广大DIY用户及爱好者于此能够少走弯路！</p><p><br /><span style="font-size: medium">误区一、离开带宽大小谈配置高低</span></p><p><br />　对于IDC而言，一般托管都是100M共享带宽，这样分到个人可能就2M的实际带宽，唐华告诉我们，这样的带宽，用普通PC已经绰绰有余。有些用户在初期组装服务器选择配置的时候，存在一个很大的问题。他上来就问，你看我这个服务器配置能支持多少人在线啊？这样的问题是没有办法回答的。因为你离开带宽谈 需求了。&quot;你应该说我是一个什么样的带宽，需要什么样的配置就够了&quot;。</p><p>　　这个实际上很好理解，唐华举例说，&quot;这就好比一个F1的跑车扔到乡间小路上，跑的不一定比出租车快，因为道路就那么窄，碰到拥挤的路况就更走不动了。在考虑配置高低的时候应该首先考虑带宽&quot;。</p><p>　　另外一个技巧就是在带宽较小的情况下，增加带宽比增加服务器硬件配置，提升的效果要明显得多。比如10M增加到20M，比硬件配置提升1倍要强的多。</p><p></p><p><span style="font-size: medium">误区二、重视风扇数量，轻视风路布局</span></p><p></p><p>　　有些人感觉风扇越多，散热越好。但是他们不考虑风扇布局，风扇怎么搁效果才好，这个是一个常见的误区。</p><p>　　用户在DIY服务器的时候，应该首先确定所选择主板的风路布局，它是一个什么样的布局，CPU的位置在哪儿，最后达到的一个效果应该是机箱的主力风扇紧紧挨着CPU的，这样散热效果才会有保证。唐华建议，正确的流程最好的是先选主板，后选机箱，这样风路匹配问题才能考虑完整。</p><br /><div align="center"><img style="width: 500px; height: 253px" src="http://image4.it168.com/2009/8/13/0f140ed7-b715-4743-8bdf-6ba49e1d6164.jpg" border="0" alt="风扇风流和散热器翅片匹配的示意图" title="风扇风流和散热器翅片匹配的示意图" vspace="10" width="500" height="253" align="middle" /><br />风扇风流和散热器翅片匹配的示意图</div><p><br /><span style="font-size: medium">误区三、重视风扇转速，轻视硬盘震动</span></p><p></p><p>　　还有个很大误区，包括很多机箱厂商在内都可能忽视的一个问题即是，光重视风扇转速，轻视硬盘震动。认为风扇转速越大越好，恨不得吹得人睁不开眼才好，但是却忽略了一个问题，那就是风扇的转速越高，必然会带来硬盘的震动越大，而这对于硬盘的损害是非常大的。</p><p>　　唐华认为风大没震动才是最佳。风大有震动是可怕的信号，比散热不好还可怕，造成硬盘坏的更快。所谓过犹不及是也。一切东西都有个平衡点。唐华告诉IT168记者，之前在PC里面有些人用过硬盘散热器，在硬盘上面罩两了个风扇，硬盘是冷却了，但硬盘的故障率反而更高了。因此，合理的选择转速均衡的风扇，保证其低震是很重要的。</p><p></p><p></p><div style="text-align: center"><img style="width: 500px; height: 338px" src="http://image4.it168.com/2009/8/13/e2411c78-914f-41e6-9a24-8e8a8433b14c.jpg" border="0" alt="这么多的硬盘 震动引起损坏一块也是大问题呀" title="这么多的硬盘 震动引起损坏一块也是大问题呀" vspace="10" width="500" height="338" /></div><br /><p></p><div align="center">这么多的硬盘 震动引起损坏一块也是大问题呀</div><p><br /><span style="font-size: medium">误区四、言必称Raid，非要用Raid卡</span><br />&nbsp;</p><p>　　有些人认为只要是raid卡的，安全性就好，速度也高，实际上这也是相对的。不敢用主板上的raid接口，一定要买个raid卡插上。但是64位的raid插在PC主板32位的插槽上，应用上点播等都是磕磕绊绊的，还不如用板载的raid速度快，这是硬件明显的不匹配。</p><p>　　还有一点，对于DIY的菜鸟来讲，有些时候用raid还不如不用raid，有过这样的用户，一台高端的NAS，数据量很大的，断电以后，Raid 5是要重建的，过一小时还没反应，他又给关了一下，这下完了，Raid数据一点没剩。他不知道raid恢复需要时间。有些时候还不如复制粘贴来得快，比如可以定期的将数据通过远程桌面从A盘备份到B盘，坏了重新拷贝回来即可。</p><p>　　还有人以为raid就是1块盘坏了，插上一块新盘就可以，这个是误导，他不知道还需要将好盘添加到raid组里面才可以。比如做电影点播的服务器完全没有必要做raid5之类的，还不如将热门电影放到几个专门的盘上去，假设你做一个raid5，或者raid10之类的，由于电影是频繁读的，所有的硬盘都读，硬盘损坏的速度反而更快，如果集中在一块盘上，最多这块硬盘更换的频率会快一些。</p><p>　　所以要看应用，针对具体问题具体分析，不能一概而论非要raid。在对raid技术和应用不熟悉的情况下，最好别用。利用普通的远程桌面手动进行硬盘之间备份可能更好，还不占用带宽。</p><p>　　唐华爆料，IDC出租的机器里面，基本没有raid。基本都一块硬盘，6000快钱送产权，谁给你做raid。下载服务器基本也不做raid，因为镜像特别多。</p><p></p><div align="center"><img style="width: 500px; height: 412px" src="http://image4.it168.com/2009/8/13/38b6a4b7-6158-4fff-a88d-11963ac3b968.jpg" border="0" alt="Raid是好东西 但是不熟悉的情况下还需慎重" title="Raid是好东西 但是不熟悉的情况下还需慎重" vspace="10" width="500" height="412" align="middle" /><br />Raid是好东西 但是不熟悉的情况下还需慎重</div><p></p><p><span style="font-size: medium">误区五、重速度，轻稳定性，甚至研究如何超频</span></p><p></p><p>　　唐华告诉IT168记者，有些人问服务器有没有必要超频、怎么超频什么的，都属于&quot;胡说八道&quot;级别，而且要命的是这个问题经常有人问。</p><p>　　实际上，无论品牌服务器、还是DIY服务器，稳定是第一位的，速度其次。发烧友针对PC机的超频，切不可照搬到服务器里面，因为普通PC更多的是面对个人级非关键应用，比如游戏之类，超频宕机 了还可以重来。服务器则不然，哪怕是小企业的入门级的产品，承载的也是商业应用，你每天的商业数据都在里面，业务都跑在上面，超频引起的后果是不可想象的。哪怕万里有一都不行。</p><p>　　所以，对服务器而言，稳定是第一要务。</p><br /><div align="center"><img style="width: 500px; height: 293px" src="http://image4.it168.com/2009/8/13/ccc11eb4-9f58-4087-8f2a-78b6909f4c89.jpg" border="0" alt="稳定第一 服务器玩的不是超频！" title="稳定第一 服务器玩的不是超频！" vspace="10" width="500" height="293" align="middle" /><br />稳定第一 服务器玩的不是超频！</div><p>　</p><p><span style="font-size: medium">误区六、排斥集成，认为什么东西都是独立的好</span></p><p></p><p>　　在唐华所接触的众多用户中，很多人把PC的一套理论套到服务器上，比如要独立的显卡，他不知服务器的显卡仅仅起到调试辅助作用，没有必要弄一块独立显卡。更有甚者，还有的人放着集成的raid不用，非要用独立的raid，集成的网卡不用，非要买上千块的独立网卡。这些东西如果插到一个32位的插槽上，还没有集成的速度快呢。而且多接了一个转接卡，还增加了不稳定因素。</p><p>　　当然，这个也不能一概而论，需要根据应用具体问题具体分析。比如在64位的主板上，对于I/O和安全有较高要求的情况下，采用独立Raid卡和独立网卡无可厚非，一句话，看菜吃饭，量体裁衣。</p><p></p><div align="center"><img style="width: 500px; height: 216px" src="http://image4.it168.com/2009/8/13/99b6d826-56e1-437d-8629-efe7e004a68d.jpg" border="0" alt="1U的机箱里 采用集成的更省空间" title="1U的机箱里 采用集成的更省空间" vspace="10" width="500" height="216" align="middle" /><br />1U的机箱里 采用集成的更省空间</div><p></p><p><span style="font-size: medium">误区七、Linux肯定比Window强，不考虑维护成本</span></p><p></p><p>　　很多新手，他越不懂，越想一步到位。有些人认为Linux负荷量大，干脆把Linux学会，殊不知这对于菜鸟的维护成本有多大。如果你不擅长管理服务器环境或者如果你没有合适的管理工具，Windows将是一个更容易管理的系统而且成本也更低。</p><p>　　唐华坦言，当前IDC几乎90%的机器都是Windows平台，这样好维护。</p><br /><div align="center"><img style="width: 500px; height: 372px" src="http://image4.it168.com/2009/8/13/586479be-7d9c-4cad-85fa-5b2cf59448cc.jpg" border="0" alt="尽管有了图形界面 但对于新手而言 Linux还是没有Windows来得顺手" title="尽管有了图形界面 但对于新手而言 Linux还是没有Windows来得顺手" vspace="10" width="500" height="372" align="middle" /><br />尽管有了图形界面 但对于新手而言 Linux还是没有Windows来得顺手<br /><br /></div><p><span style="font-size: medium">误区八、服务器配置越高越好，不分用途攀比配置</span></p><p><br />　　其实够用即可。没有必要留出很大的升级空间，因为一般都是过1、2年之后才有可能升级，那时候硬件已经很难匹配了。唐华表示，一步到位的想法在服务器上实在用不着。&quot;一旦你装好了服务器，扔在那运行就得了，没有必要对其频繁的升级。&quot;</p><p>　　豆瓣也好，华军也好、还有超级兔子、暴风影音等，这些网站都曾是唐华的客户，他们初期的服务器配置都不高，但足以胜任各自的主业应用。</p><p></p><div align="center"><img style="width: 500px; height: 337px" src="http://image4.it168.com/2009/8/13/ea7aee84-6050-4a35-8011-fd68f6d89c78.jpg" border="0" alt="很多网站都是用的这些DIY产品起家的" title="很多网站都是用的这些DIY产品起家的" vspace="10" width="500" height="337" align="middle" /><br />很多网站都是用的这些DIY产品起家的</div><p><br /><span style="font-size: medium">误区九、不了解PC配件和服务器配件性能上差异，配置性价比考虑不足</span></p><p></p><p>　　尤其菜鸟，总觉得服务器配件比PC配件好，这个问题还要看你的购买用途。唐华建议，对于自己创业的用户而言，应该本着高投入产品比（性价比）的原则，采用PC配件也未尝不可，因为随着技术的进步和制造工艺的不断提升，当前的PC配件跟服务器配件质量和性能上的差距正在逐渐缩小，但价格差距却几乎没变。</p><p>　　比如在内存方面的选择，现在普通的PC机内存出错的概率大大降低，对于一般的主机业务完全没有问题，而价钱相对于服务器专用ECC内存则具有明显优势。</p><p></p><div align="center"><img style="width: 500px; height: 352px" src="http://image4.it168.com/2009/8/13/0f6f6ad5-b85f-48f6-91cd-7c6f5b1312b9.jpg" border="0" alt="服务器内存比普通PC贵的不是一点半点" title="服务器内存比普通PC贵的不是一点半点" vspace="10" width="500" height="352" align="middle" /><br />服务器内存比普通PC贵的不是一点半点</div><p><br /><span style="font-size: medium">误区十、忽视服务器DIY细节</span></p><p><br />　　细节决定成败。除了服务器的所有部件的均衡匹配之外，一些容易忽略的细节也会影响日后服务器能否正常运行。例如内部线缆的梳理和捆扎，PC不是很重视，但是1U服务器内就很重要，经过有经验人员树立捆扎好的线缆，可由有效提高内部的散热效果，提高服务器的稳定性。此外，散热器的翅片安装方向，要顺着机箱风流。其他的诸如各种螺钉的松紧程度等等，都很重要。</p><p>　　&quot;尽管这些都是小问题，但直到今天，依然有许许多多的用户对此把脉不清&quot;唐华，这位双手&quot;量产&quot;过上千台服务器的DIY专家，表示出了对最终DIY用户的丝丝担忧。&quot;希望我的这些经验能够给广大DIY网友带来些许帮忙，真正能够节省成本，让你的钱产生更大效益&quot;。</p><br /><div align="center"><img style="width: 500px; height: 293px" src="http://image4.it168.com/2009/8/13/3c058ecf-efbf-483a-af9b-3f09b1b0c0ea.jpg" border="0" alt="看着是不是还比较整洁？" title="看着是不是还比较整洁？" vspace="10" width="500" height="293" align="middle" /><br />看着是不是还比较整洁？<br /></div><br/>Tags - <a href="http://my.clicknow.cn/go.php/tags/diy%25E6%259C%258D%25E5%258A%25A1%25E5%2599%25A8/" rel="tag">diy服务器</a> , <a href="http://my.clicknow.cn/go.php/tags/%25E5%2594%2590%25E5%258D%258E/" rel="tag">唐华</a> , <a href="http://my.clicknow.cn/go.php/tags/%25E6%259C%258D%25E5%258A%25A1%25E5%2599%25A8%25E9%2585%258D%25E7%25BD%25AE/" rel="tag">服务器配置</a>
]]>
</description>
</item><item>
<link>http://my.clicknow.cn/read.php/135.htm</link>
<title><![CDATA[APMServ启动失败的解决办法]]></title> 
<author>点击生活 &lt;&gt;</author>
<category><![CDATA[服务器]]></category>
<pubDate>Wed, 29 Jul 2009 13:59:29 +0000</pubDate> 
<guid>http://my.clicknow.cn/read.php/135.htm</guid> 
<description>
<![CDATA[ 
	<span style="word-spacing: 0px; font: medium Simsun; text-transform: none; color: #000000; text-indent: 0px; white-space: normal; letter-spacing: normal; border-collapse: separate; orphans: 2; widows: 2; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" class="Apple-style-span"><span style="font-size: 12px; color: #333333; line-height: 18px; font-family: Georgia, 'Courier New', 宋体; text-align: left" class="Apple-style-span"><span style="font-size: small">使用APMServ时出现&ldquo;1、Apache启动失败，请检查相关配置。&radic;MySQL5.1已启动。&rdquo;错误的终极解决办法：<br /><br />使用APMServ一键安装PHP平台时经常会出现以下错误导致无法继续下去！<br /><br />1、Apache启动失败，请检查相关配置。&radic;MySQL5.1已启动。<br /><br />安装官方的提示，是由于其他程序占用了80端口导致的错误，比如迅雷默认就使用了80端口。因为我同时也装有IIS，所以在装IIS时就发现了这个问题，把迅雷的端口作了调整.但是这次仍然出现了这种错误.通常的解决办法查找其他程序是否占用了该端口或者修改下端口.但是我改了几个端口仍然不能使用，不会所有端口都被占用吧?既然修改端口不起作用，就只能采取其他措施了。如下：<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;在程序说明中有如下介绍：&quot;5、访问本机请用</span><a style="color: #444444" href="http://127.0.0.1/" target="_blank"><span style="font-size: small">http://127.0.0.1/</span></a><span style="font-size: small">或</span><a style="color: #444444" href="https://127.0.0.1/" target="_blank"><span style="font-size: small">https://127.0.0.1/</span></a><span style="font-size: small">&nbsp;(如果开启SSL)&quot;，我的80端口已经被IIS占用了(需要说明的一点是，IIS占用80端口与APMServ使用其他端口并不矛盾，可以并存)，那么关闭SSL呢?试一下，OK了!具体原因尚不清楚.总之解决办法两种:1、改端口；2、改端口不行的情况下，关闭SSL。如果嫌麻烦的话可以直接使用第二种。同时还要强调一点：启动APMServ时保证htdocs目录存在<span class="Apple-converted-space">&nbsp;</span></span></span></span><br/>Tags - <a href="http://my.clicknow.cn/go.php/tags/apmserv/" rel="tag">apmserv</a> , <a href="http://my.clicknow.cn/go.php/tags/apmserv%25E5%2590%25AF%25E5%258A%25A8%25E5%25A4%25B1%25E8%25B4%25A5/" rel="tag">apmserv启动失败</a> , <a href="http://my.clicknow.cn/go.php/tags/apache%25E5%2590%25AF%25E5%258A%25A8%25E5%25A4%25B1%25E8%25B4%25A5/" rel="tag">apache启动失败</a>
]]>
</description>
</item><item>
<link>http://my.clicknow.cn/read.php/134.htm</link>
<title><![CDATA[IIS端口冲突解决办法]]></title> 
<author>点击生活 &lt;&gt;</author>
<category><![CDATA[服务器]]></category>
<pubDate>Wed, 29 Jul 2009 13:52:53 +0000</pubDate> 
<guid>http://my.clicknow.cn/read.php/134.htm</guid> 
<description>
<![CDATA[ 
	<span style="word-spacing: 0px; text-transform: none; color: #333333; text-indent: 0px; font-family: Verdana, 'Lucida Grande', Geneva, Arial, sans-serif; white-space: normal; letter-spacing: normal; border-collapse: separate; text-align: center; orphans: 2; widows: 2; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" class="Apple-style-span"><span style="font-size: 14px; line-height: 25px; font-family: Georgia, 'Times New Roman', Times, san-serif; text-align: left" class="Apple-style-span"><p style="margin: 12px auto; text-indent: 0px; line-height: 25px"><span style="font-size: medium; color: #ff6600"><strong>症状：</strong></span></p><p style="margin: 12px auto; text-indent: 0px; line-height: 25px">1、IIS默认站点停止，启动时发生意外Ox8ffe2740错误；</p><p style="margin: 12px auto; text-indent: 0px; line-height: 25px">2、或者IIS站点前有红色的Error，无法启动IIS ，提示&ldquo;服务器没<span style="font-size: xx-small">有及时响应</span>或控制请求&rdquo;</p><p style="margin: 12px auto; text-indent: 0px; line-height: 25px"><span style="color: #99cc00"><span style="font-size: small; color: #3366ff"><strong>原因一：</strong></span><span style="font-size: xx-small; color: #000000">World Wide Web Publishing 服务没有启动</span></span></p><p style="margin: 12px auto; text-indent: 0px; line-height: 25px"><span style="font-size: x-small; color: #ff6600"><span style="font-size: small; color: #3366ff"><strong>解决方法：</strong></span><span style="color: #000000">启动<span style="font-size: xx-small">World Wide Web Publishing 服务，</span>再启动IIS。</span></span></p><p style="margin: 12px auto; text-indent: 0px; line-height: 25px"><span style="font-size: x-small; color: #ff6600"><strong>World Wide Web Publishing 服务若无法启动的详细解决方法：</strong></span></p><p style="margin: 12px auto; text-indent: 0px; line-height: 25px"><strong><span style="font-size: x-small; color: #ff0000"><a style="color: #3d81ee; border-bottom: 1px dashed; text-decoration: none; outline-style: none; outline-width: initial; outline-color: initial" href="http://blog.csdn.net/hong401/archive/2008/05/30/2494931.aspx">http://blog.csdn.net/hong401/archive/2008/05/30/2494931.aspx</a></span></strong></p><p style="margin: 12px auto; text-indent: 0px; line-height: 25px"></p><p style="margin: 12px auto; text-indent: 0px; line-height: 25px"><span style="color: #3366ff"><strong>原因二：</strong></span>IIS 80端口被占用</p><p style="margin: 12px auto; text-indent: 0px; line-height: 25px"></p><p style="margin: 12px auto; text-indent: 0px; line-height: 25px"><span style="font-size: small; color: #3366ff"><strong>解决方法有两种 ：</strong></span></p><p style="margin: 12px auto; text-indent: 0px; line-height: 25px">一、关闭占用80端口的程序</p><p style="margin: 12px auto; text-indent: 0px; line-height: 25px">二、或者修改IIS端口为其它未用端口，如81端口；相应的，站点也修改到对应的81端口。</p><p style="margin: 12px auto; text-indent: 0px; line-height: 25px"><span style="font-size: medium; color: #3366ff"><strong>详细步骤：</strong></span></p><p style="margin: 12px auto; text-indent: 0px; line-height: 25px"><span style="color: #3366ff">方法一：使用DOS命令找到占用80端口的程序，关闭该程序</span></p><p style="margin: 12px auto; text-indent: 0px; line-height: 25px">在开始&mdash;&mdash;运行中输入以下命令：</p><p style="margin: 12px auto; text-indent: 0px; line-height: 25px">1、netstat -an -p tcp -o（小写字母o）</p><p style="margin: 12px auto; text-indent: 0px; line-height: 25px">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; （说明：在Local Adress 中找到80端口，在PID中找到使用80端口的服务）</p><p style="margin: 12px auto; text-indent: 0px; line-height: 25px">2、tskill 352 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</p><p style="margin: 12px auto; text-indent: 0px; line-height: 25px">&nbsp;&nbsp;&nbsp;&nbsp; (说明：352即占用查找到的占用80端口的PID程序，使用tskill命令关闭该程序；注意：这里的PID352是举例，根据你的实际情况，哪个程序占用了80端口，则关闭哪个程序的PID）</p><p style="margin: 12px auto; text-indent: 0px; line-height: 25px">3、命令iisreset/restart重启IIS（ 或者手动重启IIS服务）</p><p style="margin: 12px auto; text-indent: 0px; line-height: 25px"></p><p style="margin: 12px auto; text-indent: 0px; line-height: 25px"><span style="font-size: small; color: #3366ff"><strong>方法二：把IIS的80端口改为其它为被使用的端口，如80改为81，同时改站点的端口为81。</strong></span></p><p style="margin: 12px auto; text-indent: 0px; line-height: 25px"><span style="font-size: small; color: #3366ff">步骤：</span></p><p style="margin: 12px auto; text-indent: 0px; line-height: 25px">1、改IIS的80端口改为未被使用的端口，随意取值，未被使用就性，在这里改成81端口。</p><p style="margin: 12px auto; text-indent: 0px; line-height: 25px">2、重启IIS。这时IIS已经可以启动，已经可以在IIS里浏览文件。</p><p style="margin: 12px auto; text-indent: 0px; line-height: 25px">3、对应的在站点中把站点的端口改为IIS现在的81端口，如由原来的http://localhost/改成http: //localhost:81/ 。如果不改站点端口，则每次访问站点时都需要输入端口，如要访问index.asp，就要输入：http://localhost:81/ index.asp。</p><p style="margin: 12px auto; text-indent: 0px; line-height: 25px">否则无法访问网页，提示找不到服务器或 DNS 错误</p></span></span><br/>Tags - <a href="http://my.clicknow.cn/go.php/tags/iis/" rel="tag">iis</a> , <a href="http://my.clicknow.cn/go.php/tags/%25E7%25AB%25AF%25E5%258F%25A3%25E5%2586%25B2%25E7%25AA%2581%25E8%25A7%25A3%25E5%2586%25B3/" rel="tag">端口冲突解决</a> , <a href="http://my.clicknow.cn/go.php/tags/80%25E7%25AB%25AF%25E5%258F%25A3/" rel="tag">80端口</a>
]]>
</description>
</item><item>
<link>http://my.clicknow.cn/read.php/133.htm</link>
<title><![CDATA[Nginx 0.7.x + PHP 5.2.10（FastCGI）搭建胜过Apache十倍的Web服务器（第5版）]]></title> 
<author>点击生活 &lt;&gt;</author>
<category><![CDATA[服务器]]></category>
<pubDate>Tue, 28 Jul 2009 06:05:32 +0000</pubDate> 
<guid>http://my.clicknow.cn/read.php/133.htm</guid> 
<description>
<![CDATA[ 
	<span style="word-spacing: 0px; font: medium Simsun; text-transform: none; color: #000000; text-indent: 0px; white-space: normal; letter-spacing: normal; border-collapse: separate; orphans: 2; widows: 2; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" class="Apple-style-span"><span style="font-size: 12px; font-family: Tahoma, Arial; text-align: left" class="Apple-style-span">　　[文章作者：张宴 本文版本：v5.4 最后修改：<span style="color: #ff0000">2009.06.26</span><span class="Apple-converted-space"> </span>]<br /><br />　　前言：本文是我撰写的关于搭建&ldquo;Nginx + PHP（FastCGI）&rdquo;Web服务器的第5篇文章。本系列文章作为国内最早详细介绍 Nginx + PHP 安装、配置、使用的资料之一，为推动 Nginx 在国内的发展产生了积极的作用。这是一篇关于Nginx 0.7.x系列版本的文章，安装、配置方式与第4篇文章相差不大，但增加了MySQL安装配置的信息、<strong>PHP 5.2.10 的 php-fpm 补丁</strong>。Nginx 0.7.x系列版本虽然为开发版，但在很多大型网站的生产环境中已经使用。<br /><br />　　链接：《<a style="color: #4f6371; text-decoration: none" href="http://blog.s135.com/post/297/" target="_blank">2007年9月的第1版</a>》、《<a style="color: #4f6371; text-decoration: none" href="http://blog.s135.com/post/314/" target="_blank">2007年12月的第2版</a>》、《<a style="color: #4f6371; text-decoration: none" href="http://blog.s135.com/post/351/" target="_blank">2008年6月的第3版</a>》、《<a style="color: #4f6371; text-decoration: none" href="http://blog.s135.com/nginx_php_v4/" target="_blank">2008年8月的第4版</a>》<br /><br />　　<a style="color: #4f6371; text-decoration: none" href="editor/tinymce/attachment/200806/nginx.png" target="_blank"><img class="insertimage" src="http://blog.s135.com/attachment/200806/nginx.png" border="0" alt="点击在新窗口中浏览此图片" title="点击在新窗口中浏览此图片" width="150" height="50" /></a><br /><br /><br />　　<a style="color: #4f6371; text-decoration: none" href="http://www.nginx.net/" target="_blank">Nginx</a><span class="Apple-converted-space"> </span>(&quot;engine x&quot;) 是一个高性能的 HTTP 和反向代理服务器，也是一个 IMAP/POP3/SMTP 代理服务器。 Nginx 是由 Igor Sysoev 为俄罗斯访问量第二的 Rambler.ru 站点开发的，它已经在该站点运行超过两年半了。Igor 将源代码以类BSD许可证的形式发布。<br /><br />　　Nginx 超越 Apache 的高性能和稳定性，使得国内使用 Nginx 作为 Web 服务器的网站也越来越多，其中包括<a style="color: #4f6371; text-decoration: none" href="http://blog.sina.com.cn/" target="_blank">新浪博客</a>、<a style="color: #4f6371; text-decoration: none" href="http://v.sina.com.cn/" target="_blank">新浪播客</a>、<a style="color: #4f6371; text-decoration: none" href="http://news.163.com/" target="_blank">网易新闻</a>等门户网站频道，<a style="color: #4f6371; text-decoration: none" href="http://www.6.cn/" target="_blank">六间房</a>、<a style="color: #4f6371; text-decoration: none" href="http://www.56.com/" target="_blank">56.com</a>等视频分享网站，<a style="color: #4f6371; text-decoration: none" href="http://www.discuz.net/" target="_blank">Discuz!官方论坛</a>、<a style="color: #4f6371; text-decoration: none" href="http://www.newsmth.net/" target="_blank">水木社区</a>等知名论坛，<a style="color: #4f6371; text-decoration: none" href="http://www.douban.com/" target="_blank">豆瓣</a>、<a style="color: #4f6371; text-decoration: none" href="http://www.yupoo.com/" target="_blank">YUPOO相册</a>、<a style="color: #4f6371; text-decoration: none" href="http://www.hainei.com/" target="_blank">海内SNS</a>、<a style="color: #4f6371; text-decoration: none" href="http://www.xunlei.com/" target="_blank">迅雷在线</a>等新兴Web 2.0网站。<br /><br /><hr style="border-top: #63b4cd 1px solid; border-left-width: 0px; border-bottom-width: 0px; height: 1px; border-right-width: 0px" /><br />　　Nginx 的官方中文维基：<a style="color: #4f6371; text-decoration: none" href="http://wiki.nginx.org/NginxChs" target="_blank">http://wiki.nginx.org/NginxChs</a><br /><br /><hr style="border-top: #63b4cd 1px solid; border-left-width: 0px; border-bottom-width: 0px; height: 1px; border-right-width: 0px" /><br />　　在高并发连接的情况下，Nginx是Apache服务器不错的替代品。Nginx同时也可以作为7层负载均衡服务器来使用。根据我的测试结果，<strong>Nginx 0.7.61 + PHP 5.2.10 (FastCGI) 可以承受3万以上的并发连接数，相当于同等环境下Apache的10倍</strong>。<br /><br />　　根据我的经验，4GB内存的服务器+Apache（prefork模式）一般只能处理3000个并发连接，因为它们将占用3GB以上的内存，还得为系统预留1GB的内存。我曾经就有两台Apache服务器，因为在配置文件中设置的MaxClients为4000，当Apache并发连接数达到3800时，导致服务器内存和Swap空间用满而崩溃。<br /><br />　　而这台 Nginx 0.7.61 + PHP 5.2.10 (FastCGI) 服务器在3万并发连接下，开启的10个Nginx进程消耗150M内存（15M*10=150M），开启的64个php-cgi进程消耗1280M内存（20M*64=1280M），加上系统自身消耗的内存，总共消耗不到2GB内存。如果服务器内存较小，完全可以只开启25个php-cgi进程，这样php-cgi消耗的总内存数才500M。<br /><br />　　在3万并发连接下，访问Nginx 0.7.61 + PHP 5.2.10 (FastCGI) 服务器的PHP程序，仍然速度飞快。下图为Nginx的状态监控页面，显示的活动连接数为28457（关于Nginx的监控页配置，会在本文接下来所给出的Nginx配置文件中写明）：<br /><br />　　<a style="color: #4f6371; text-decoration: none" href="editor/tinymce/attachment/200712/nginx_status.png" target="_blank"><img class="insertimage" src="http://blog.s135.com/attachment/200712/nginx_status.png" border="0" alt="点击在新窗口中浏览此图片" title="点击在新窗口中浏览此图片" width="294" height="180" /></a><br /><br />　　我生产环境下的两台Nginx + PHP5（FastCGI）服务器，跑多个一般复杂的纯PHP动态程序，单台Nginx + PHP5（FastCGI）服务器跑PHP动态程序的处理能力已经超过&ldquo;<span style="color: #ff0000">700次请求/秒</span>&rdquo;，相当于每天可以承受6000万（700*60*60*24=60480000）的访问量（<a style="color: #4f6371; text-decoration: none" href="editor/tinymce/read.php/334.htm" target="_blank">更多信息见此</a>），而服务器的系统负载也不高：<br /><br />　　<a style="color: #4f6371; text-decoration: none" href="editor/tinymce/attachment/200803/nginx_php_la.gif" target="_blank"><img class="insertimage" src="http://blog.s135.com/attachment/200803/nginx_php_la.gif" border="0" alt="点击在新窗口中浏览此图片" title="点击在新窗口中浏览此图片" width="540" height="245" /></a><br /><br /><hr style="border-top: #63b4cd 1px solid; border-left-width: 0px; border-bottom-width: 0px; height: 1px; border-right-width: 0px" /><br />　　下面是用100个并发连接分别去压生产环境中同一负载均衡器VIP下、提供相同服务的两台服务器，一台为Nginx，另一台为Apache，Nginx每秒处理的请求数是Apache的两倍多，Nginx服务器的系统负载、CPU使用率远低于Apache：<br /><br />　　你可以将连接数开到10000～30000，去压Nginx和Apache上的phpinfo.php，这是用浏览器访问Nginx上的phpinfo.php一切正常，而访问Apache服务器的phpinfo.php，则是该页无法显示。4G内存的服务器，即使再优化，Apache也很难在&ldquo;webbench -c 30000 -t 60<span class="Apple-converted-space"> </span><a style="color: #4f6371; text-decoration: none" href="http://xxx.xxx.xxx.xxx/phpinfo.php" target="_blank">http://xxx.xxx.xxx.xxx/phpinfo.php</a>&rdquo;的压力情况下正常访问，而调整参数优化后的Nginx可以。<br /><br />　　webbench 下载地址：<a style="color: #4f6371; text-decoration: none" href="http://blog.s135.com/post/288/" target="_blank">http://blog.s135.com/post/288/</a><br /><br />　　注意：webbench 做压力测试时，该软件自身也会消耗CPU和内存资源，为了测试准确，请将 webbench 安装在别的服务器上。<br /><br />　　测试结果：##### Nginx + PHP #####<br /><div class="quote" style="margin: 10px 10px 0px; border: #00a0c6 1px dashed"><div class="quote-title" style="padding-right: 5px; padding-left: 5px; font-weight: bold; padding-bottom: 5px; color: #4c9bb0; padding-top: 5px; border-bottom: #00a0c6 1px dotted; background-color: #edf4f6">引用</div><div class="quote-content" style="border-top-width: 0px; border-right: #edf4f6 1px dashed; padding-right: 10px; padding-left: 10px; padding-bottom: 10px; border-left: #edf4f6 1px dashed; color: #000000; padding-top: 10px; border-bottom: #edf4f6 1px dashed; background-color: #ffffff">[root@localhost webbench-1.5]# webbench -c 100 -t 30<span class="Apple-converted-space"> </span><a style="color: #4f6371; text-decoration: none" href="http://192.168.1.21/phpinfo.php" target="_blank">http://192.168.1.21/phpinfo.php</a><br />Webbench - Simple Web Benchmark 1.5<br />Copyright (c) Radim Kolar 1997-2004, GPL Open Source Software.<br /><br />Benchmarking: GET<span class="Apple-converted-space"> </span><a style="color: #4f6371; text-decoration: none" href="http://192.168.1.21/phpinfo.php" target="_blank">http://192.168.1.21/phpinfo.php</a><br />100 clients, running 30 sec.<br /><br />Speed=102450 pages/min, 16490596 bytes/sec.<br />Requests: 51225 susceed, 0 failed.<br /><br />top - 14:06:13 up 27 days, 2:25, 2 users, load average: 14.57, 9.89, 6.51<br />Tasks: 287 total, 4 running, 283 sleeping, 0 stopped, 0 zombie<br />Cpu(s): 49.9% us, 6.7% sy, 0.0% ni, 41.4% id, 1.1% wa, 0.1% hi, 0.8% si<br />Mem: 6230016k total, 2959468k used, 3270548k free, 635992k buffers<br />Swap: 2031608k total, 3696k used, 2027912k free, 1231444k cached</div></div><br /><br />　　测试结果：##### Apache + PHP #####<br /><div class="quote" style="margin: 10px 10px 0px; border: #00a0c6 1px dashed"><div class="quote-title" style="padding-right: 5px; padding-left: 5px; font-weight: bold; padding-bottom: 5px; color: #4c9bb0; padding-top: 5px; border-bottom: #00a0c6 1px dotted; background-color: #edf4f6">引用</div><div class="quote-content" style="border-top-width: 0px; border-right: #edf4f6 1px dashed; padding-right: 10px; padding-left: 10px; padding-bottom: 10px; border-left: #edf4f6 1px dashed; color: #000000; padding-top: 10px; border-bottom: #edf4f6 1px dashed; background-color: #ffffff">[root@localhost webbench-1.5]# webbench -c 100 -t 30<span class="Apple-converted-space"> </span><a style="color: #4f6371; text-decoration: none" href="http://192.168.1.27/phpinfo.php" target="_blank">http://192.168.1.27/phpinfo.php</a><br />Webbench - Simple Web Benchmark 1.5<br />Copyright (c) Radim Kolar 1997-2004, GPL Open Source Software.<br /><br />Benchmarking: GET<span class="Apple-converted-space"> </span><a style="color: #4f6371; text-decoration: none" href="http://192.168.1.27/phpinfo.php" target="_blank">http://192.168.1.27/phpinfo.php</a><br />100 clients, running 30 sec.<br /><br />Speed=42184 pages/min, 31512914 bytes/sec.<br />Requests: 21092 susceed, 0 failed.<br /><br />top - 14:06:20 up 27 days, 2:13, 2 users, load average: 62.15, 26.36, 13.42<br />Tasks: 318 total, 7 running, 310 sleeping, 0 stopped, 1 zombie<br />Cpu(s): 80.4% us, 10.6% sy, 0.0% ni, 7.9% id, 0.1% wa, 0.1% hi, 0.9% si<br />Mem: 6230016k total, 3075948k used, 3154068k free, 379896k buffers<br />Swap: 2031608k total, 12592k used, 2019016k free, 1117868k cached</div></div><br /><br /><hr style="border-top: #63b4cd 1px solid; border-left-width: 0px; border-bottom-width: 0px; height: 1px; border-right-width: 0px" /><br />　　为什么Nginx的性能要比Apache高得多？这得益于Nginx使用了最新的epoll（Linux 2.6内核）和kqueue（freebsd）网络I/O模型，而Apache则使用的是传统的select模型。目前Linux下能够承受高并发访问的Squid、Memcached都采用的是epoll网络I/O模型。<br /><br />　　处理大量的连接的读写，Apache所采用的select网络I/O模型非常低效。下面用一个比喻来解析Apache采用的select模型和Nginx采用的epoll模型进行之间的区别：<br /><br />　　假设你在大学读书，住的宿舍楼有很多间房间，你的朋友要来找你。select版宿管大妈就会带着你的朋友挨个房间去找，直到找到你为止。而epoll版宿管大妈会先记下每位同学的房间号，你的朋友来时，只需告诉你的朋友你住在哪个房间即可，不用亲自带着你的朋友满大楼找人。如果来了10000个人，都要找自己住这栋楼的同学时，select版和epoll版宿管大妈，谁的效率更高，不言自明。同理，在高并发服务器中，轮询I/O是最耗时间的操作之一，select和epoll的性能谁的性能更高，同样十分明了。<br /><br /><hr style="border-top: #63b4cd 1px solid; border-left-width: 0px; border-bottom-width: 0px; height: 1px; border-right-width: 0px" /><br />　　安装步骤：<br />　　（系统要求：Linux 2.6+ 内核，本文中的Linux操作系统为CentOS 5.3，另在RedHat AS4上也安装成功）<br /><a style="color: #4f6371; text-decoration: none" name="entrymore" title="entrymore"></a><br />　　<strong>一、获取相关开源程序：</strong><br />　　1、【适用CentOS操作系统】利用CentOS Linux系统自带的yum命令安装、升级所需的程序库（RedHat等其他Linux发行版可从安装光盘中找到这些程序库的RPM包，进行安装）：<br /><div style="padding-right: 3px; padding-left: 3px; padding-bottom: 3px; margin: 5px 5px 0px; padding-top: 3px; background-color: #ffffff; border: #00a0c6 1px dashed">sudo -s<br />LANG=C<br />yum -y install gcc gcc-c++ autoconf libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel zlib zlib-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel ncurses ncurses-devel curl curl-devel e2fsprogs e2fsprogs-devel krb5 krb5-devel libidn libidn-devel openssl openssl-devel openldap openldap-devel nss_ldap openldap-clients openldap-servers</div><br /><br />　　2、【适用RedHat操作系统】RedHat等其他Linux发行版可从安装光盘中找到这些程序库的RPM包（事先可通过类似&ldquo;rpm -qa &#124; grep libjpeg&rdquo;的命令查看所需的RPM包是否存在，通常是&ldquo;xxx-devel&rdquo;不存在，需要安装）。RedHat可以直接利用CentOS的RPM包安装，以下是RPM包下载网址：<br />　　①、RedHat AS4 &amp; CentOS 4<br />　　<a style="color: #4f6371; text-decoration: none" href="http://mirrors.163.com/centos/4/os/i386/CentOS/RPMS/" target="_blank">http://mirrors.163.com/centos/4/os/i386/CentOS/RPMS/</a><br />　　<a style="color: #4f6371; text-decoration: none" href="http://mirrors.163.com/centos/4/os/x86_64/CentOS/RPMS/" target="_blank">http://mirrors.163.com/centos/4/os/x86_64/CentOS/RPMS/</a><br /><br />　　②、RedHat AS5 &amp; CentOS 5<br />　　<a style="color: #4f6371; text-decoration: none" href="http://mirrors.163.com/centos/5/os/i386/CentOS/" target="_blank">http://mirrors.163.com/centos/5/os/i386/CentOS/</a><br />　　<a style="color: #4f6371; text-decoration: none" href="http://mirrors.163.com/centos/5/os/x86_64/CentOS/" target="_blank">http://mirrors.163.com/centos/5/os/x86_64/CentOS/</a><br /><br />　　③、RPM包搜索网站<br />　　<a style="color: #4f6371; text-decoration: none" href="http://rpm.pbone.net/" target="_blank">http://rpm.pbone.net/</a><br />　　<a style="color: #4f6371; text-decoration: none" href="http://www.rpmfind.net/" target="_blank">http://www.rpmfind.net/</a><br /><br />　　④、RedHat AS4 系统环境，通常情况下缺少的支持包安装：<br />　　Ⅰ、i386 系统<br /><div style="padding-right: 3px; padding-left: 3px; padding-bottom: 3px; margin: 5px 5px 0px; padding-top: 3px; background-color: #ffffff; border: #00a0c6 1px dashed">wget<span class="Apple-converted-space"> </span><a style="color: #4f6371; text-decoration: none" href="http://blog.s135.com/soft/linux/nginx_php/rpm/i386/libjpeg-devel-6b-33.i386.rpm" target="_blank">http://blog.s135.com/soft/linux/nginx_php/rpm/i386/libjpeg-devel-6b-33.i386.rpm</a><br />rpm -ivh libjpeg-devel-6b-33.i386.rpm<br />wget<span class="Apple-converted-space"> </span><a style="color: #4f6371; text-decoration: none" href="http://blog.s135.com/soft/linux/nginx_php/rpm/i386/freetype-devel-2.1.9-1.i386.rpm" target="_blank">http://blog.s135.com/soft/linux/nginx_php/rpm/i386/freetype-devel-2.1.9-1.i386.rpm</a><br />rpm -ivh freetype-devel-2.1.9-1.i386.rpm<br />wget<span class="Apple-converted-space"> </span><a style="color: #4f6371; text-decoration: none" href="http://blog.s135.com/soft/linux/nginx_php/rpm/i386/libpng-devel-1.2.7-1.i386.rpm" target="_blank">http://blog.s135.com/soft/linux/nginx_php/rpm/i386/libpng-devel-1.2.7-1.i386.rpm</a><br />rpm -ivh libpng-devel-1.2.7-1.i386.rpm</div><br />　　Ⅱ、x86_64 系统<br /><div style="padding-right: 3px; padding-left: 3px; padding-bottom: 3px; margin: 5px 5px 0px; padding-top: 3px; background-color: #ffffff; border: #00a0c6 1px dashed">wget<span class="Apple-converted-space"> </span><a style="color: #4f6371; text-decoration: none" href="http://blog.s135.com/soft/linux/nginx_php/rpm/x86_64/libjpeg-devel-6b-33.x86_64.rpm" target="_blank">http://blog.s135.com/soft/linux/nginx_php/rpm/x86_64/libjpeg-devel-6b-33.x86_64.rpm</a><br />rpm -ivh libjpeg-devel-6b-33.x86_64.rpm<br />wget<span class="Apple-converted-space"> </span><a style="color: #4f6371; text-decoration: none" href="http://blog.s135.com/soft/linux/nginx_php/rpm/x86_64/freetype-devel-2.1.9-1.x86_64.rpm" target="_blank">http://blog.s135.com/soft/linux/nginx_php/rpm/x86_64/freetype-devel-2.1.9-1.x86_64.rpm</a><br />rpm -ivh freetype-devel-2.1.9-1.x86_64.rpm<br />wget<span class="Apple-converted-space"> </span><a style="color: #4f6371; text-decoration: none" href="http://blog.s135.com/soft/linux/nginx_php/rpm/x86_64/libpng-devel-1.2.7-1.x86_64.rpm" target="_blank">http://blog.s135.com/soft/linux/nginx_php/rpm/x86_64/libpng-devel-1.2.7-1.x86_64.rpm</a><br />rpm -ivh libpng-devel-1.2.7-1.x86_64.rpm</div><br /><br />　　3、【适用CentOS、RedHat及其它Linux操作系统】下载程序源码包：<br />　　本文中提到的所有开源软件为截止到<span style="color: #ff0000">2009年06月26日</span>的最新稳定版。<br />　　①、从软件的官方网站下载：<br /><div style="padding-right: 3px; padding-left: 3px; padding-bottom: 3px; margin: 5px 5px 0px; padding-top: 3px; background-color: #ffffff; border: #00a0c6 1px dashed">mkdir -p /data0/software<br />cd /data0/software<br />wget<span class="Apple-converted-space"> </span><a style="color: #4f6371; text-decoration: none" href="http://sysoev.ru/nginx/nginx-0.7.61.tar.gz" target="_blank">http://sysoev.ru/nginx/nginx-0.7.61.tar.gz</a><br />wget<span class="Apple-converted-space"> </span><a style="color: #4f6371; text-decoration: none" href="http://www.php.net/get/php-5.2.10.tar.gz/from/this/mirror" target="_blank">http://www.php.net/get/php-5.2.10.tar.gz/from/this/mirror</a><br />wget<span class="Apple-converted-space"> </span><a style="color: #4f6371; text-decoration: none" href="http://blog.s135.com/soft/linux/nginx_php/phpfpm/php-5.2.10-fpm-0.5.11.diff.gz" target="_blank">http://blog.s135.com/soft/linux/nginx_php/phpfpm/php-5.2.10-fpm-0.5.11.diff.gz</a><br />wget<span class="Apple-converted-space"> </span><a style="color: #4f6371; text-decoration: none" href="http://dev.mysql.com/get/Downloads/MySQL-5.1/mysql-5.1.35.tar.gz/from/http://mysql.he.net/" target="_blank">http://dev.mysql.com/get/Downloads/MySQL-5.1/mysql-5.1.35.tar.gz/from/http://mysql.he.net/</a><br />wget<span class="Apple-converted-space"> </span><a style="color: #4f6371; text-decoration: none" href="http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.13.tar.gz" target="_blank">http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.13.tar.gz</a><br />wget &quot;http://downloads.sourceforge.net/mcrypt/libmcrypt-2.5.8.tar.gz?modtime=1171868460&amp;big_mirror=0&quot;<br />wget &quot;http://downloads.sourceforge.net/mcrypt/mcrypt-2.6.8.tar.gz?modtime=1194463373&amp;big_mirror=0&quot;<br />wget<span class="Apple-converted-space"> </span><a style="color: #4f6371; text-decoration: none" href="http://pecl.php.net/get/memcache-2.2.5.tgz" target="_blank">http://pecl.php.net/get/memcache-2.2.5.tgz</a><br />wget &quot;http://downloads.sourceforge.net/mhash/mhash-0.9.9.9.tar.gz?modtime=1175740843&amp;big_mirror=0&quot;<br />wget<span class="Apple-converted-space"> </span><a style="color: #4f6371; text-decoration: none" href="ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-7.9.tar.gz" target="_blank">ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-7.9.tar.gz</a><br />wget<span class="Apple-converted-space"> </span><a style="color: #4f6371; text-decoration: none" href="http://bart.eaccelerator.net/source/0.9.5.3/eaccelerator-0.9.5.3.tar.bz2" target="_blank">http://bart.eaccelerator.net/source/0.9.5.3/eaccelerator-0.9.5.3.tar.bz2</a><br />wget<span class="Apple-converted-space"> </span><a style="color: #4f6371; text-decoration: none" href="http://pecl.php.net/get/PDO_MYSQL-1.0.2.tgz" target="_blank">http://pecl.php.net/get/PDO_MYSQL-1.0.2.tgz</a><br />wget<span class="Apple-converted-space"> </span><a style="color: #4f6371; text-decoration: none" href="http://blog.s135.com/soft/linux/nginx_php/imagick/ImageMagick.tar.gz" target="_blank">http://blog.s135.com/soft/linux/nginx_php/imagick/ImageMagick.tar.gz</a><br />wget<span class="Apple-converted-space"> </span><a style="color: #4f6371; text-decoration: none" href="http://pecl.php.net/get/imagick-2.2.2.tgz" target="_blank">http://pecl.php.net/get/imagick-2.2.2.tgz</a></div><br />　　②、从<a style="color: #4f6371; text-decoration: none" href="http://blog.s135.com/" target="_blank">blog.s135.com</a>下载（比较稳定，只允许在本站，或者在Linux/Unix下通过Wget、Curl等命令下载以下软件）：<br /><div style="padding-right: 3px; padding-left: 3px; padding-bottom: 3px; margin: 5px 5px 0px; padding-top: 3px; background-color: #ffffff; border: #00a0c6 1px dashed">mkdir -p /data0/software<br />cd /data0/software<br />wget<span class="Apple-converted-space"> </span><a style="color: #4f6371; text-decoration: none" href="http://blog.s135.com/soft/linux/nginx_php/nginx/nginx-0.7.61.tar.gz" target="_blank">http://blog.s135.com/soft/linux/nginx_php/nginx/nginx-0.7.61.tar.gz</a><br />wget<span class="Apple-converted-space"> </span><a style="color: #4f6371; text-decoration: none" href="http://blog.s135.com/soft/linux/nginx_php/php/php-5.2.10.tar.gz" target="_blank">http://blog.s135.com/soft/linux/nginx_php/php/php-5.2.10.tar.gz</a><br />wget<span class="Apple-converted-space"> </span><a style="color: #4f6371; text-decoration: none" href="http://blog.s135.com/soft/linux/nginx_php/phpfpm/php-5.2.10-fpm-0.5.11.diff.gz" target="_blank">http://blog.s135.com/soft/linux/nginx_php/phpfpm/php-5.2.10-fpm-0.5.11.diff.gz</a><br />wget<span class="Apple-converted-space"> </span><a style="color: #4f6371; text-decoration: none" href="http://blog.s135.com/soft/linux/nginx_php/mysql/mysql-5.1.35.tar.gz" target="_blank">http://blog.s135.com/soft/linux/nginx_php/mysql/mysql-5.1.35.tar.gz</a><br />wget<span class="Apple-converted-space"> </span><a style="color: #4f6371; text-decoration: none" href="http://blog.s135.com/soft/linux/nginx_php/libiconv/libiconv-1.13.tar.gz" target="_blank">http://blog.s135.com/soft/linux/nginx_php/libiconv/libiconv-1.13.tar.gz</a><br />wget<span class="Apple-converted-space"> </span><a style="color: #4f6371; text-decoration: none" href="http://blog.s135.com/soft/linux/nginx_php/mcrypt/libmcrypt-2.5.8.tar.gz" target="_blank">http://blog.s135.com/soft/linux/nginx_php/mcrypt/libmcrypt-2.5.8.tar.gz</a><br />wget<span class="Apple-converted-space"> </span><a style="color: #4f6371; text-decoration: none" href="http://blog.s135.com/soft/linux/nginx_php/mcrypt/mcrypt-2.6.8.tar.gz" target="_blank">http://blog.s135.com/soft/linux/nginx_php/mcrypt/mcrypt-2.6.8.tar.gz</a><br />wget<span class="Apple-converted-space"> </span><a style="color: #4f6371; text-decoration: none" href="http://blog.s135.com/soft/linux/nginx_php/memcache/memcache-2.2.5.tgz" target="_blank">http://blog.s135.com/soft/linux/nginx_php/memcache/memcache-2.2.5.tgz</a><br />wget<span class="Apple-converted-space"> </span><a style="color: #4f6371; text-decoration: none" href="http://blog.s135.com/soft/linux/nginx_php/mhash/mhash-0.9.9.9.tar.gz" target="_blank">http://blog.s135.com/soft/linux/nginx_php/mhash/mhash-0.9.9.9.tar.gz</a><br />wget<span class="Apple-converted-space"> </span><a style="color: #4f6371; text-decoration: none" href="http://blog.s135.com/soft/linux/nginx_php/pcre/pcre-7.9.tar.gz" target="_blank">http://blog.s135.com/soft/linux/nginx_php/pcre/pcre-7.9.tar.gz</a><br />wget<span class="Apple-converted-space"> </span><a style="color: #4f6371; text-decoration: none" href="http://blog.s135.com/soft/linux/nginx_php/eaccelerator/eaccelerator-0.9.5.3.tar.bz2" target="_blank">http://blog.s135.com/soft/linux/nginx_php/eaccelerator/eaccelerator-0.9.5.3.tar.bz2</a><br />wget<span class="Apple-converted-space"> </span><a style="color: #4f6371; text-decoration: none" href="http://blog.s135.com/soft/linux/nginx_php/pdo/PDO_MYSQL-1.0.2.tgz" target="_blank">http://blog.s135.com/soft/linux/nginx_php/pdo/PDO_MYSQL-1.0.2.tgz</a><br />wget<span class="Apple-converted-space"> </span><a style="color: #4f6371; text-decoration: none" href="http://blog.s135.com/soft/linux/nginx_php/imagick/ImageMagick.tar.gz" target="_blank">http://blog.s135.com/soft/linux/nginx_php/imagick/ImageMagick.tar.gz</a><br />wget<span class="Apple-converted-space"> </span><a style="color: #4f6371; text-decoration: none" href="http://blog.s135.com/soft/linux/nginx_php/imagick/imagick-2.2.2.tgz" target="_blank">http://blog.s135.com/soft/linux/nginx_php/imagick/imagick-2.2.2.tgz</a></div><br /><hr style="border-top: #63b4cd 1px solid; border-left-width: 0px; border-bottom-width: 0px; height: 1px; border-right-width: 0px" /><br />　　<strong>二、安装PHP 5.2.10（FastCGI模式）</strong><br />　　1、编译安装PHP 5.2.10所需的支持库：<br /><div style="padding-right: 3px; padding-left: 3px; padding-bottom: 3px; margin: 5px 5px 0px; padding-top: 3px; background-color: #ffffff; border: #00a0c6 1px dashed">tar zxvf libiconv-1.13.tar.gz<br />cd libiconv-1.13/<br />./configure --prefix=/usr/local<br />make<br />make install<br />cd ../<br /><br />tar zxvf libmcrypt-2.5.8.tar.gz<span class="Apple-converted-space"> </span><br />cd libmcrypt-2.5.8/<br />./configure<br />make<br />make install<br />/sbin/ldconfig<br />cd libltdl/<br />./configure --enable-ltdl-install<br />make<br />make install<br />cd ../../<br /><br />tar zxvf mhash-0.9.9.9.tar.gz<br />cd mhash-0.9.9.9/<br />./configure<br />make<br />make install<br />cd ../<br /><br />ln -s /usr/local/lib/libmcrypt.la /usr/lib/libmcrypt.la<br />ln -s /usr/local/lib/libmcrypt.so /usr/lib/libmcrypt.so<br />ln -s /usr/local/lib/libmcrypt.so.4 /usr/lib/libmcrypt.so.4<br />ln -s /usr/local/lib/libmcrypt.so.4.4.8 /usr/lib/libmcrypt.so.4.4.8<br />ln -s /usr/local/lib/libmhash.a /usr/lib/libmhash.a<br />ln -s /usr/local/lib/libmhash.la /usr/lib/libmhash.la<br />ln -s /usr/local/lib/libmhash.so /usr/lib/libmhash.so<br />ln -s /usr/local/lib/libmhash.so.2 /usr/lib/libmhash.so.2<br />ln -s /usr/local/lib/libmhash.so.2.0.1 /usr/lib/libmhash.so.2.0.1<br /><br />tar zxvf mcrypt-2.6.8.tar.gz<br />cd mcrypt-2.6.8/<br />/sbin/ldconfig<br />./configure<br />make<br />make install<br />cd ../</div><br /><hr style="border-top: #63b4cd 1px solid; border-left-width: 0px; border-bottom-width: 0px; height: 1px; border-right-width: 0px" /><br />　　2、编译安装MySQL 5.1.35<br /><div style="padding-right: 3px; padding-left: 3px; padding-bottom: 3px; margin: 5px 5px 0px; padding-top: 3px; background-color: #ffffff; border: #00a0c6 1px dashed">/usr/sbin/groupadd mysql<br />/usr/sbin/useradd -g mysql mysql<br />tar zxvf mysql-5.1.35.tar.gz<br />cd mysql-5.1.35/<br />./configure --prefix=/usr/local/webserver/mysql/ --enable-assembler --with-extra-charsets=complex --enable-thread-safe-client --with-big-tables --with-readline --with-ssl --with-embedded-server --enable-local-infile --with-plugins=innobase<br />make &amp;&amp; make install<br />chmod +w /usr/local/webserver/mysql<br />chown -R mysql:mysql /usr/local/webserver/mysql<br />cd ../</div><br /><hr style="border-top: #63b4cd 1px solid; border-left-width: 0px; border-bottom-width: 0px; height: 1px; border-right-width: 0px" /><br />　　附：以下为附加步骤，如果你想在这台服务器上运行MySQL数据库，则执行以下两步。如果你只是希望让PHP支持MySQL扩展库，能够连接其他服务器上的MySQL数据库，那么，以下两步无需执行。<br /><br />　　①、创建MySQL数据库存放目录<br /><div style="padding-right: 3px; padding-left: 3px; padding-bottom: 3px; margin: 5px 5px 0px; padding-top: 3px; background-color: #ffffff; border: #00a0c6 1px dashed">mkdir -p /data0/mysql/3306/data/<br />chown -R mysql:mysql /data0/mysql/</div><br /><br />　　②、以mysql用户帐号的身份建立数据表：<br /><div style="padding-right: 3px; padding-left: 3px; padding-bottom: 3px; margin: 5px 5px 0px; padding-top: 3px; background-color: #ffffff; border: #00a0c6 1px dashed">/usr/local/webserver/mysql/bin/mysql_install_db --basedir=/usr/local/webserver/mysql --datadir=/data0/mysql/3306/data --user=mysql</div><br /><br />　　③、创建my.cnf配置文件：<br /><div style="padding-right: 3px; padding-left: 3px; padding-bottom: 3px; margin: 5px 5px 0px; padding-top: 3px; background-color: #ffffff; border: #00a0c6 1px dashed">vi /data0/mysql/3306/my.cnf</div><br />　　输入以下内容：<br /><div class="quote" style="margin: 10px 10px 0px; border: #00a0c6 1px dashed"><div class="quote-title" style="padding-right: 5px; padding-left: 5px; font-weight: bold; padding-bottom: 5px; color: #4c9bb0; padding-top: 5px; border-bottom: #00a0c6 1px dotted; background-color: #edf4f6">引用</div><div class="quote-content" style="border-top-width: 0px; border-right: #edf4f6 1px dashed; padding-right: 10px; padding-left: 10px; padding-bottom: 10px; border-left: #edf4f6 1px dashed; color: #000000; padding-top: 10px; border-bottom: #edf4f6 1px dashed; background-color: #ffffff">[client]<br />default-character-set = utf8<br />port = 3306<br />socket = /tmp/mysql.sock<br /><br />[mysql]<br />prompt=&quot;(&#92;u:blog.s135.com:)[&#92;d]&gt; &quot;<br />no-auto-rehash<br /><br />[mysqld]<br />#default-character-set = utf8<br />user = mysql<br />port = 3306<br />socket = /tmp/mysql.sock<br />basedir = /usr/local/webserver/mysql<br />datadir = /data0/mysql/3306/data<br />open_files_limit = 10240<br />back_log = 600<br />max_connections = 3000<br />max_connect_errors = 6000<br />table_cache = 614<br />external-locking = FALSE<br />max_allowed_packet = 32M<br />sort_buffer_size = 2M<br />join_buffer_size = 2M<br />thread_cache_size = 300<br />thread_concurrency = 8<br />query_cache_size = 32M<br />query_cache_limit = 2M<br />query_cache_min_res_unit = 2k<br />default-storage-engine = MyISAM<br />default_table_type = MyISAM<br />thread_stack = 192K<br />transaction_isolation = READ-COMMITTED<br />tmp_table_size = 246M<br />max_heap_table_size = 246M<br />long_query_time = 1<br />log_long_format<br />log-bin = /data0/mysql/3306/binlog<br />binlog_cache_size = 4M<br />binlog_format = MIXED<br />max_binlog_cache_size = 8M<br />max_binlog_size = 512M<br />expire_logs_days = 7<br />key_buffer_size = 256M<br />read_buffer_size = 1M<br />read_rnd_buffer_size = 16M<br />bulk_insert_buffer_size = 64M<br />myisam_sort_buffer_size = 128M<br />myisam_max_sort_file_size = 10G<br />myisam_max_extra_sort_file_size = 10G<br />myisam_repair_threads = 1<br />myisam_recover<br /><br />skip-name-resolve<br />master-connect-retry = 10<br />slave-skip-errors = 1032,1062,126,1114,1146,1048,1396<br /><br />server-id = 1<br /><br />innodb_additional_mem_pool_size = 16M<br />innodb_buffer_pool_size = 2048M<br />innodb_data_file_path = ibdata1:1024M:autoextend<br />innodb_file_io_threads = 4<br />innodb_thread_concurrency = 8<br />innodb_flush_log_at_trx_commit = 2<br />innodb_log_buffer_size = 16M<br />innodb_log_file_size = 128M<br />innodb_log_files_in_group = 3<br />innodb_max_dirty_pages_pct = 90<br />innodb_lock_wait_timeout = 120<br />innodb_file_per_table = 0<br />[mysqldump]<br />quick<br />max_allowed_packet = 32M</div></div><br /><br />　　④、创建管理MySQL数据库的shell脚本：<br /><div style="padding-right: 3px; padding-left: 3px; padding-bottom: 3px; margin: 5px 5px 0px; padding-top: 3px; background-color: #ffffff; border: #00a0c6 1px dashed">vi /data0/mysql/3306/mysql</div><br />　　输入以下内容（这里的用户名admin和密码12345678接下来的步骤会创建）：<br /><div class="dp-highlighter" style="overflow-y: auto; font-size: 12px; overflow-x: auto; margin: 18px 0px; width: 1030px; font-family: 'Courier New', Courier, mono; background-color: #ffffff; border: #2b91af 1px solid"><div class="bar" style="padding-left: 45px"><div class="tools" style="padding-right: 8px; padding-left: 10px; padding-bottom: 3px; font: 9px Verdana, Geneva, Arial, Helvetica, sans-serif; color: silver; padding-top: 3px; border-bottom: #2b91af 1px solid"><a style="font-size: 9px; color: gray; margin-right: 10px; text-decoration: none" href="editor/tinymce/blank.htm" onclick="return true;dp.sh.Toolbar.Command('ViewSource',this);return false;">view plain</a><a style="font-size: 9px; color: gray; margin-right: 10px; text-decoration: none" href="editor/tinymce/blank.htm" onclick="return true;dp.sh.Toolbar.Command('PrintSource',this);return false;">print</a><a style="font-size: 9px; color: gray; margin-right: 10px; text-decoration: none" href="editor/tinymce/blank.htm" onclick="return true;dp.sh.Toolbar.Command('About',this);return false;">?</a></div></div><ol class="dp-cpp" style="padding-right: 0px; padding-left: 0px; padding-bottom: 0px; margin: 0px 0px 1px 45px; color: #2b91af; padding-top: 0px"><li class="alt" style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #f8f8f8"><span style="color: black"><span style="font-weight: bold; color: #cd00cd" class="preprocessor">#!/bin/sh</span><span style="color: black"> </span></span></li><li style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #ffffff"></li><li class="alt" style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #f8f8f8"><span style="color: black">mysql_port=3306 </span></li><li style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #ffffff"><span style="color: black">mysql_username=<span style="color: red" class="string">&quot;admin&quot;</span><span style="color: black"> </span></span></li><li class="alt" style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #f8f8f8"><span style="color: black">mysql_password=<span style="color: red" class="string">&quot;12345678&quot;</span><span style="color: black"> </span></span></li><li style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #ffffff"></li><li class="alt" style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #f8f8f8"><span style="color: black">function_start_mysql() </span></li><li style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #ffffff"><span style="color: black">{ </span></li><li class="alt" style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #f8f8f8"><span style="color: black">printf <span style="color: red" class="string">&quot;Starting MySQL...&#92;n&quot;</span><span style="color: black"> </span></span></li><li style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #ffffff"><span style="color: black">/bin/sh /usr/local/webserver/mysql/bin/mysqld_safe --defaults-file=/data0/mysql/${mysql_port}/my.cnf 2&gt;&amp;1 &gt; /dev/null &amp; </span></li><li class="alt" style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #f8f8f8"><span style="color: black">} </span></li><li style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #ffffff"></li><li class="alt" style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #f8f8f8"><span style="color: black">function_stop_mysql() </span></li><li style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #ffffff"><span style="color: black">{ </span></li><li class="alt" style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #f8f8f8"><span style="color: black">printf <span style="color: red" class="string">&quot;Stoping MySQL...&#92;n&quot;</span><span style="color: black"> </span></span></li><li style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #ffffff"><span style="color: black">/usr/local/webserver/mysql/bin/mysqladmin -u ${mysql_username} -p${mysql_password} -S /tmp/mysql.sock shutdown </span></li><li class="alt" style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #f8f8f8"><span style="color: black">} </span></li><li style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #ffffff"></li><li class="alt" style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #f8f8f8"><span style="color: black">function_restart_mysql() </span></li><li style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #ffffff"><span style="color: black">{ </span></li><li class="alt" style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #f8f8f8"><span style="color: black">printf <span style="color: red" class="string">&quot;Restarting MySQL...&#92;n&quot;</span><span style="color: black"> </span></span></li><li style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #ffffff"><span style="color: black">function_stop_mysql </span></li><li class="alt" style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #f8f8f8"><span style="color: black">sleep 5 </span></li><li style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #ffffff"><span style="color: black">function_start_mysql </span></li><li class="alt" style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #f8f8f8"><span style="color: black">} </span></li><li style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #ffffff"></li><li class="alt" style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #f8f8f8"><span style="color: black">function_kill_mysql() </span></li><li style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #ffffff"><span style="color: black">{ </span></li><li class="alt" style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #f8f8f8"><span style="color: black">kill -9 $(ps -ef &#124; grep <span style="color: red" class="string">'bin/mysqld_safe'</span><span style="color: black"> &#124; grep ${mysql_port} &#124; awk </span><span style="color: red" class="string">'{printf $2}'</span><span style="color: black">) </span></span></li><li style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #ffffff"><span style="color: black">kill -9 $(ps -ef &#124; grep <span style="color: red" class="string">'libexec/mysqld'</span><span style="color: black"> &#124; grep ${mysql_port} &#124; awk </span><span style="color: red" class="string">'{printf $2}'</span><span style="color: black">) </span></span></li><li class="alt" style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #f8f8f8"><span style="color: black">} </span></li><li style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #ffffff"></li><li class="alt" style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #f8f8f8"><span style="color: black"><span style="font-weight: bold; color: #5697d9" class="keyword">if</span><span style="color: black"> [ </span><span style="color: red" class="string">&quot;$1&quot;</span><span style="color: black"> = </span><span style="color: red" class="string">&quot;start&quot;</span><span style="color: black"> ]; then </span></span></li><li style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #ffffff"><span style="color: black">function_start_mysql </span></li><li class="alt" style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #f8f8f8"><span style="color: black">elif [ <span style="color: red" class="string">&quot;$1&quot;</span><span style="color: black"> = </span><span style="color: red" class="string">&quot;stop&quot;</span><span style="color: black"> ]; then </span></span></li><li style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #ffffff"><span style="color: black">function_stop_mysql </span></li><li class="alt" style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #f8f8f8"><span style="color: black">elif [ <span style="color: red" class="string">&quot;$1&quot;</span><span style="color: black"> = </span><span style="color: red" class="string">&quot;restart&quot;</span><span style="color: black"> ]; then </span></span></li><li style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #ffffff"><span style="color: black">function_restart_mysql </span></li><li class="alt" style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #f8f8f8"><span style="color: black">elif [ <span style="color: red" class="string">&quot;$1&quot;</span><span style="color: black"> = </span><span style="color: red" class="string">&quot;kill&quot;</span><span style="color: black"> ]; then </span></span></li><li style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #ffffff"><span style="color: black">function_kill_mysql </span></li><li class="alt" style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #f8f8f8"><span style="color: black"><span style="font-weight: bold; color: #5697d9" class="keyword">else</span><span style="color: black"> </span></span></li><li style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #ffffff"><span style="color: black">printf <span style="color: red" class="string">&quot;Usage: /data0/mysql/${mysql_port}/mysql {start&#124;stop&#124;restart&#124;kill}&#92;n&quot;</span><span style="color: black"> </span></span></li><li class="alt" style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #f8f8f8"><span style="color: black">fi </span></li></ol></div><br />　　⑤、赋予shell脚本可执行权限：<br /><div style="padding-right: 3px; padding-left: 3px; padding-bottom: 3px; margin: 5px 5px 0px; padding-top: 3px; background-color: #ffffff; border: #00a0c6 1px dashed">chmod +x /data0/mysql/3306/mysql</div><br /><br />　　⑥、启动MySQL：<br /><div style="padding-right: 3px; padding-left: 3px; padding-bottom: 3px; margin: 5px 5px 0px; padding-top: 3px; background-color: #ffffff; border: #00a0c6 1px dashed">/data0/mysql/3306/mysql start</div><br /><br />　　⑦、通过命令行登录管理MySQL服务器（提示输入密码时直接回车）：<br /><div style="padding-right: 3px; padding-left: 3px; padding-bottom: 3px; margin: 5px 5px 0px; padding-top: 3px; background-color: #ffffff; border: #00a0c6 1px dashed">/usr/local/webserver/mysql/bin/mysql -u root -p -S /tmp/mysql.sock</div><br /><br />　　⑧、输入以下SQL语句，创建一个具有root权限的用户（admin）和密码（12345678）：<br /><div style="padding-right: 3px; padding-left: 3px; padding-bottom: 3px; margin: 5px 5px 0px; padding-top: 3px; background-color: #ffffff; border: #00a0c6 1px dashed">GRANT ALL PRIVILEGES ON *.* TO 'admin'@'localhost' IDENTIFIED BY '12345678';<br />GRANT ALL PRIVILEGES ON *.* TO 'admin'@'127.0.0.1' IDENTIFIED BY '12345678';</div><br /><br />　　⑨、（可选）停止MySQL：<br /><div style="padding-right: 3px; padding-left: 3px; padding-bottom: 3px; margin: 5px 5px 0px; padding-top: 3px; background-color: #ffffff; border: #00a0c6 1px dashed">/data0/mysql/3306/mysql stop</div><br /><hr style="border-top: #63b4cd 1px solid; border-left-width: 0px; border-bottom-width: 0px; height: 1px; border-right-width: 0px" /><br />　　3、编译安装PHP（FastCGI模式）<br /><div style="padding-right: 3px; padding-left: 3px; padding-bottom: 3px; margin: 5px 5px 0px; padding-top: 3px; background-color: #ffffff; border: #00a0c6 1px dashed">tar zxvf php-5.2.10.tar.gz<br />gzip -cd php-5.2.10-fpm-0.5.11.diff.gz &#124; patch -d php-5.2.10 -p1<br />cd php-5.2.10/<br />./configure --prefix=/usr/local/webserver/php --with-config-file-path=/usr/local/webserver/php/etc --with-mysql=/usr/local/webserver/mysql --with-mysqli=/usr/local/webserver/mysql/bin/mysql_config --with-iconv-dir=/usr/local --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr --enable-xml --disable-rpath --enable-discard-path --enable-safe-mode --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl --with-curlwrappers --enable-mbregex --enable-fastcgi --enable-fpm --enable-force-cgi-redirect --enable-mbstring --with-mcrypt --with-gd --enable-gd-native-ttf --with-openssl --with-mhash --enable-pcntl --enable-sockets --with-ldap --with-ldap-sasl --with-xmlrpc --enable-zip --enable-soap --without-pear<br />make ZEND_EXTRA_LIBS='-liconv'<br />make install<br />cp php.ini-dist /usr/local/webserver/php/etc/php.ini<br />cd ../</div><br /><hr style="border-top: #63b4cd 1px solid; border-left-width: 0px; border-bottom-width: 0px; height: 1px; border-right-width: 0px" /><br />　　4、编译安装PHP5扩展模块<br /><div style="padding-right: 3px; padding-left: 3px; padding-bottom: 3px; margin: 5px 5px 0px; padding-top: 3px; background-color: #ffffff; border: #00a0c6 1px dashed">tar zxvf memcache-2.2.5.tgz<br />cd memcache-2.2.5/<br />/usr/local/webserver/php/bin/phpize<br />./configure --with-php-config=/usr/local/webserver/php/bin/php-config<br />make<br />make install<br />cd ../<br /><br />tar jxvf eaccelerator-0.9.5.3.tar.bz2<br />cd eaccelerator-0.9.5.3/<br />/usr/local/webserver/php/bin/phpize<br />./configure --enable-eaccelerator=shared --with-php-config=/usr/local/webserver/php/bin/php-config<br />make<br />make install<br />cd ../<br /><br />tar zxvf PDO_MYSQL-1.0.2.tgz<br />cd PDO_MYSQL-1.0.2/<br />/usr/local/webserver/php/bin/phpize<br />./configure --with-php-config=/usr/local/webserver/php/bin/php-config --with-pdo-mysql=/usr/local/webserver/mysql<br />make<br />make install<br />cd ../<br /><br />tar zxvf ImageMagick.tar.gz<br />cd ImageMagick-6.5.1-2/<br />./configure<br />make<br />make install<br />cd ../<br /><br />tar zxvf imagick-2.2.2.tgz<br />cd imagick-2.2.2/<br />/usr/local/webserver/php/bin/phpize<br />./configure --with-php-config=/usr/local/webserver/php/bin/php-config<br />make<br />make install<br />cd ../<br /></div><br /><br />　　5、修改php.ini文件<br />　　<strong>手工修改：</strong>查找/usr/local/webserver/php/etc/php.ini中的extension_dir = &quot;./&quot;<br />　　修改为extension_dir = &quot;/usr/local/webserver/php/lib/php/extensions/no-debug-non-zts-20060613/&quot;<br />　　并在此行后增加以下几行，然后保存：<br />　　extension = &quot;memcache.so&quot;<br />　　extension = &quot;pdo_mysql.so&quot;<br />　　extension = &quot;imagick.so&quot;<br /><br />　　再查找output_buffering = Off<br />　　修改为output_buffering = On<br /><br />　　<strong>自动修改：</strong>若嫌手工修改麻烦，可执行以下shell命令，自动完成对php.ini文件的修改：<br /><div style="padding-right: 3px; padding-left: 3px; padding-bottom: 3px; margin: 5px 5px 0px; padding-top: 3px; background-color: #ffffff; border: #00a0c6 1px dashed">sed -i 's#extension_dir = &quot;./&quot;#extension_dir = &quot;/usr/local/webserver/php/lib/php/extensions/no-debug-non-zts-20060613/&quot;&#92;nextension = &quot;memcache.so&quot;&#92;nextension = &quot;pdo_mysql.so&quot;&#92;nextension = &quot;imagick.so&quot;&#92;n#' /usr/local/webserver/php/etc/php.ini<br />sed -i 's#output_buffering = Off#output_buffering = On#' /usr/local/webserver/php/etc/php.ini<br />sed -i &quot;s#; always_populate_raw_post_data = On#always_populate_raw_post_data = On#g&quot; /usr/local/webserver/php/etc/php.ini</div><br /><br />　　6、配置eAccelerator加速PHP：<br /><div style="padding-right: 3px; padding-left: 3px; padding-bottom: 3px; margin: 5px 5px 0px; padding-top: 3px; background-color: #ffffff; border: #00a0c6 1px dashed">mkdir -p /usr/local/webserver/eaccelerator_cache<br />vi /usr/local/webserver/php/etc/php.ini</div><br />　　按shift+g键跳到配置文件的最末尾，加上以下配置信息：<br /><div class="quote" style="margin: 10px 10px 0px; border: #00a0c6 1px dashed"><div class="quote-title" style="padding-right: 5px; padding-left: 5px; font-weight: bold; padding-bottom: 5px; color: #4c9bb0; padding-top: 5px; border-bottom: #00a0c6 1px dotted; background-color: #edf4f6">引用</div><div class="quote-content" style="border-top-width: 0px; border-right: #edf4f6 1px dashed; padding-right: 10px; padding-left: 10px; padding-bottom: 10px; border-left: #edf4f6 1px dashed; color: #000000; padding-top: 10px; border-bottom: #edf4f6 1px dashed; background-color: #ffffff">[eaccelerator]<br />zend_extension=&quot;/usr/local/webserver/php/lib/php/extensions/no-debug-non-zts-20060613/eaccelerator.so&quot;<br />eaccelerator.shm_size=&quot;64&quot;<br />eaccelerator.cache_dir=&quot;/usr/local/webserver/eaccelerator_cache&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;&quot;<br />eaccelerator.shm_max=&quot;0&quot;<br />eaccelerator.shm_ttl=&quot;3600&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;</div></div><br /><br /><hr style="border-top: #63b4cd 1px solid; border-left-width: 0px; border-bottom-width: 0px; height: 1px; border-right-width: 0px" /><br />　　7、创建www用户和组，以及供blog.s135.com和<a style="color: #4f6371; text-decoration: none" href="http://www.s135.com/" target="_blank">www.s135.com</a>两个虚拟主机使用的目录：<br /><div style="padding-right: 3px; padding-left: 3px; padding-bottom: 3px; margin: 5px 5px 0px; padding-top: 3px; background-color: #ffffff; border: #00a0c6 1px dashed">/usr/sbin/groupadd www<br />/usr/sbin/useradd -g www www<br />mkdir -p /data0/htdocs/blog<br />chmod +w /data0/htdocs/blog<br />chown -R www:www /data0/htdocs/blog<br />mkdir -p /data0/htdocs/www<br />chmod +w /data0/htdocs/www<br />chown -R www:www /data0/htdocs/www</div><br /><br />　　8、创建php-fpm配置文件（php-fpm是为PHP打的一个FastCGI管理补丁，可以平滑变更php.ini配置而无需重启php-cgi）：<br />　　在/usr/local/webserver/php/etc/目录中创建php-fpm.conf文件：<br /><div style="padding-right: 3px; padding-left: 3px; padding-bottom: 3px; margin: 5px 5px 0px; padding-top: 3px; background-color: #ffffff; border: #00a0c6 1px dashed">rm -f /usr/local/webserver/php/etc/php-fpm.conf<br />vi /usr/local/webserver/php/etc/php-fpm.conf</div><br />　　输入以下内容（如果您安装 Nginx + PHP 用于程序调试，请将以下的&lt;value name=&quot;display_errors&quot;&gt;0&lt;/value&gt;改为&lt;value name=&quot;display_errors&quot;&gt;1&lt;/value&gt;，以便显示PHP错误信息，否则，Nginx 会报状态为500的空白错误页）： <div class="dp-highlighter" style="overflow-y: auto; font-size: 12px; overflow-x: auto; margin: 18px 0px; width: 1030px; font-family: 'Courier New', Courier, mono; background-color: #ffffff; border: #2b91af 1px solid"><div class="bar" style="padding-left: 45px"><div class="tools" style="padding-right: 8px; padding-left: 10px; padding-bottom: 3px; font: 9px Verdana, Geneva, Arial, Helvetica, sans-serif; color: silver; padding-top: 3px; border-bottom: #2b91af 1px solid"><a style="font-size: 9px; color: gray; margin-right: 10px; text-decoration: none" href="editor/tinymce/blank.htm" onclick="return true;dp.sh.Toolbar.Command('ViewSource',this);return false;">view plain</a><a style="font-size: 9px; color: gray; margin-right: 10px; text-decoration: none" href="editor/tinymce/blank.htm" onclick="return true;dp.sh.Toolbar.Command('PrintSource',this);return false;">print</a><a style="font-size: 9px; color: gray; margin-right: 10px; text-decoration: none" href="editor/tinymce/blank.htm" onclick="return true;dp.sh.Toolbar.Command('About',this);return false;">?</a></div></div><ol class="dp-xml" style="padding-right: 0px; padding-left: 0px; padding-bottom: 0px; margin: 0px 0px 1px 45px; color: #2b91af; padding-top: 0px"><li class="alt" style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #f8f8f8"><span style="color: black"><span style="font-weight: bold; color: blue" class="tag">&lt;?</span><span style="font-weight: bold; color: black" class="tag-name">xml</span><span style="color: black"> </span><span style="color: red" class="attribute">version</span><span style="color: black">=</span><span style="color: blue" class="attribute-value">&quot;1.0&quot;</span><span style="color: black"> </span><span style="font-weight: bold; color: blue" class="tag">?&gt;</span><span style="color: black"> </span></span></li><li style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #ffffff"><span style="color: black"><span style="font-weight: bold; color: blue" class="tag">&lt;</span><span style="font-weight: bold; color: black" class="tag-name">configuration</span><span style="font-weight: bold; color: blue" class="tag">&gt;</span><span style="color: black"> </span></span></li><li class="alt" style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #f8f8f8"></li><li style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #ffffff"><span style="color: black">All relative paths in this config are relative to php's install prefix </span></li><li class="alt" style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #f8f8f8"></li><li style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #ffffff"><span style="color: black"><span style="font-weight: bold; color: blue" class="tag">&lt;</span><span style="font-weight: bold; color: black" class="tag-name">section</span><span style="color: black"> </span><span style="color: red" class="attribute">name</span><span style="color: black">=</span><span style="color: blue" class="attribute-value">&quot;global_options&quot;</span><span style="font-weight: bold; color: blue" class="tag">&gt;</span><span style="color: black"> </span></span></li><li class="alt" style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #f8f8f8"></li><li style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #ffffff"><span style="color: black">Pid file </span></li><li class="alt" style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #f8f8f8"><span style="color: black"><span style="font-weight: bold; color: blue" class="tag">&lt;</span><span style="font-weight: bold; color: black" class="tag-name">value</span><span style="color: black"> </span><span style="color: red" class="attribute">name</span><span style="color: black">=</span><span style="color: blue" class="attribute-value">&quot;pid_file&quot;</span><span style="font-weight: bold; color: blue" class="tag">&gt;</span><span style="color: black">/usr/local/webserver/php/logs/php-fpm.pid</span><span style="font-weight: bold; color: blue" class="tag">&lt;/</span><span style="font-weight: bold; color: black" class="tag-name">value</span><span style="font-weight: bold; color: blue" class="tag">&gt;</span><span style="color: black"> </span></span></li><li style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #ffffff"></li><li class="alt" style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #f8f8f8"><span style="color: black">Error log file </span></li><li style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #ffffff"><span style="color: black"><span style="font-weight: bold; color: blue" class="tag">&lt;</span><span style="font-weight: bold; color: black" class="tag-name">value</span><span style="color: black"> </span><span style="color: red" class="attribute">name</span><span style="color: black">=</span><span style="color: blue" class="attribute-value">&quot;error_log&quot;</span><span style="font-weight: bold; color: blue" class="tag">&gt;</span><span style="color: black">/usr/local/webserver/php/logs/php-fpm.log</span><span style="font-weight: bold; color: blue" class="tag">&lt;/</span><span style="font-weight: bold; color: black" class="tag-name">value</span><span style="font-weight: bold; color: blue" class="tag">&gt;</span><span style="color: black"> </span></span></li><li class="alt" style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #f8f8f8"></li><li style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #ffffff"><span style="color: black">Log level </span></li><li class="alt" style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #f8f8f8"><span style="color: black"><span style="font-weight: bold; color: blue" class="tag">&lt;</span><span style="font-weight: bold; color: black" class="tag-name">value</span><span style="color: black"> </span><span style="color: red" class="attribute">name</span><span style="color: black">=</span><span style="color: blue" class="attribute-value">&quot;log_level&quot;</span><span style="font-weight: bold; color: blue" class="tag">&gt;</span><span style="color: black">notice</span><span style="font-weight: bold; color: blue" class="tag">&lt;/</span><span style="font-weight: bold; color: black" class="tag-name">value</span><span style="font-weight: bold; color: blue" class="tag">&gt;</span><span style="color: black"> </span></span></li><li style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #ffffff"></li><li class="alt" style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #f8f8f8"><span style="color: black">When this amount of php processes exited with SIGSEGV or SIGBUS ... </span></li><li style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #ffffff"><span style="color: black"><span style="font-weight: bold; color: blue" class="tag">&lt;</span><span style="font-weight: bold; color: black" class="tag-name">value</span><span style="color: black"> </span><span style="color: red" class="attribute">name</span><span style="color: black">=</span><span style="color: blue" class="attribute-value">&quot;emergency_restart_threshold&quot;</span><span style="font-weight: bold; color: blue" class="tag">&gt;</span><span style="color: black">10</span><span style="font-weight: bold; color: blue" class="tag">&lt;/</span><span style="font-weight: bold; color: black" class="tag-name">value</span><span style="font-weight: bold; color: blue" class="tag">&gt;</span><span style="color: black"> </span></span></li><li class="alt" style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #f8f8f8"></li><li style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #ffffff"><span style="color: black">... in a less than this interval of time, a graceful restart will be initiated. </span></li><li class="alt" style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #f8f8f8"><span style="color: black">Useful to work around accidental curruptions in accelerator's shared memory. </span></li><li style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #ffffff"><span style="color: black"><span style="font-weight: bold; color: blue" class="tag">&lt;</span><span style="font-weight: bold; color: black" class="tag-name">value</span><span style="color: black"> </span><span style="color: red" class="attribute">name</span><span style="color: black">=</span><span style="color: blue" class="attribute-value">&quot;emergency_restart_interval&quot;</span><span style="font-weight: bold; color: blue" class="tag">&gt;</span><span style="color: black">1m</span><span style="font-weight: bold; color: blue" class="tag">&lt;/</span><span style="font-weight: bold; color: black" class="tag-name">value</span><span style="font-weight: bold; color: blue" class="tag">&gt;</span><span style="color: black"> </span></span></li><li class="alt" style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #f8f8f8"></li><li style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #ffffff"><span style="color: black">Time limit on waiting child's reaction on signals from master </span></li><li class="alt" style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #f8f8f8"><span style="color: black"><span style="font-weight: bold; color: blue" class="tag">&lt;</span><span style="font-weight: bold; color: black" class="tag-name">value</span><span style="color: black"> </span><span style="color: red" class="attribute">name</span><span style="color: black">=</span><span style="color: blue" class="attribute-value">&quot;process_control_timeout&quot;</span><span style="font-weight: bold; color: blue" class="tag">&gt;</span><span style="color: black">5s</span><span style="font-weight: bold; color: blue" class="tag">&lt;/</span><span style="font-weight: bold; color: black" class="tag-name">value</span><span style="font-weight: bold; color: blue" class="tag">&gt;</span><span style="color: black"> </span></span></li><li style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #ffffff"></li><li class="alt" style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #f8f8f8"><span style="color: black">Set to 'no' to debug fpm </span></li><li style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #ffffff"><span style="color: black"><span style="font-weight: bold; color: blue" class="tag">&lt;</span><span style="font-weight: bold; color: black" class="tag-name">value</span><span style="color: black"> </span><span style="color: red" class="attribute">name</span><span style="color: black">=</span><span style="color: blue" class="attribute-value">&quot;daemonize&quot;</span><span style="font-weight: bold; color: blue" class="tag">&gt;</span><span style="color: black">yes</span><span style="font-weight: bold; color: blue" class="tag">&lt;/</span><span style="font-weight: bold; color: black" class="tag-name">value</span><span style="font-weight: bold; color: blue" class="tag">&gt;</span><span style="color: black"> </span></span></li><li class="alt" style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #f8f8f8"></li><li style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #ffffff"><span style="color: black"><span style="font-weight: bold; color: blue" class="tag">&lt;/</span><span style="font-weight: bold; color: black" class="tag-name">section</span><span style="font-weight: bold; color: blue" class="tag">&gt;</span><span style="color: black"> </span></span></li><li class="alt" style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #f8f8f8"></li><li style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #ffffff"><span style="color: black"><span style="font-weight: bold; color: blue" class="tag">&lt;</span><span style="font-weight: bold; color: black" class="tag-name">workers</span><span style="font-weight: bold; color: blue" class="tag">&gt;</span><span style="color: black"> </span></span></li><li class="alt" style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #f8f8f8"></li><li style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #ffffff"><span style="color: black"><span style="font-weight: bold; color: blue" class="tag">&lt;</span><span style="font-weight: bold; color: black" class="tag-name">section</span><span style="color: black"> </span><span style="color: red" class="attribute">name</span><span style="color: black">=</span><span style="color: blue" class="attribute-value">&quot;pool&quot;</span><span style="font-weight: bold; color: blue" class="tag">&gt;</span><span style="color: black"> </span></span></li><li class="alt" style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #f8f8f8"></li><li style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #ffffff"><span style="color: black">Name of pool. Used in logs and stats. </span></li><li class="alt" style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #f8f8f8"><span style="color: black"><span style="font-weight: bold; color: blue" class="tag">&lt;</span><span style="font-weight: bold; color: black" class="tag-name">value</span><span style="color: black"> </span><span style="color: red" class="attribute">name</span><span style="color: black">=</span><span style="color: blue" class="attribute-value">&quot;name&quot;</span><span style="font-weight: bold; color: blue" class="tag">&gt;</span><span style="color: black">default</span><span style="font-weight: bold; color: blue" class="tag">&lt;/</span><span style="font-weight: bold; color: black" class="tag-name">value</span><span style="font-weight: bold; color: blue" class="tag">&gt;</span><span style="color: black"> </span></span></li><li style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #ffffff"></li><li class="alt" style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #f8f8f8"><span style="color: black">Address to accept fastcgi requests on. </span></li><li style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #ffffff"><span style="color: black">Valid syntax is 'ip.ad.re.ss:port' or just 'port' or '/path/to/unix/socket' </span></li><li class="alt" style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #f8f8f8"><span style="color: black"><span style="font-weight: bold; color: blue" class="tag">&lt;</span><span style="font-weight: bold; color: black" class="tag-name">value</span><span style="color: black"> </span><span style="color: red" class="attribute">name</span><span style="color: black">=</span><span style="color: blue" class="attribute-value">&quot;listen_address&quot;</span><span style="font-weight: bold; color: blue" class="tag">&gt;</span><span style="color: black">127.0.0.1:9000</span><span style="font-weight: bold; color: blue" class="tag">&lt;/</span><span style="font-weight: bold; color: black" class="tag-name">value</span><span style="font-weight: bold; color: blue" class="tag">&gt;</span><span style="color: black"> </span></span></li><li style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #ffffff"></li><li class="alt" style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #f8f8f8"><span style="color: black"><span style="font-weight: bold; color: blue" class="tag">&lt;</span><span style="font-weight: bold; color: black" class="tag-name">value</span><span style="color: black"> </span><span style="color: red" class="attribute">name</span><span style="color: black">=</span><span style="color: blue" class="attribute-value">&quot;listen_options&quot;</span><span style="font-weight: bold; color: blue" class="tag">&gt;</span><span style="color: black"> </span></span></li><li style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #ffffff"></li><li class="alt" style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #f8f8f8"><span style="color: black">Set listen(2) backlog </span></li><li style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #ffffff"><span style="color: black"><span style="font-weight: bold; color: blue" class="tag">&lt;</span><span style="font-weight: bold; color: black" class="tag-name">value</span><span style="color: black"> </span><span style="color: red" class="attribute">name</span><span style="color: black">=</span><span style="color: blue" class="attribute-value">&quot;backlog&quot;</span><span style="font-weight: bold; color: blue" class="tag">&gt;</span><span style="color: black">-1</span><span style="font-weight: bold; color: blue" class="tag">&lt;/</span><span style="font-weight: bold; color: black" class="tag-name">value</span><span style="font-weight: bold; color: blue" class="tag">&gt;</span><span style="color: black"> </span></span></li><li class="alt" style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #f8f8f8"></li><li style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #ffffff"><span style="color: black">Set permissions for unix socket, if one used. </span></li><li class="alt" style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #f8f8f8"><span style="color: black">In Linux read/write permissions must be set in order to allow connections from web server. </span></li><li style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #ffffff"><span style="color: black">Many BSD-derrived systems allow connections regardless of permissions. </span></li><li class="alt" style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #f8f8f8"><span style="color: black"><span style="font-weight: bold; color: blue" class="tag">&lt;</span><span style="font-weight: bold; color: black" class="tag-name">value</span><span style="color: black"> </span><span style="color: red" class="attribute">name</span><span style="color: black">=</span><span style="color: blue" class="attribute-value">&quot;owner&quot;</span><span style="font-weight: bold; color: blue" class="tag">&gt;</span><span style="font-weight: bold; color: blue" class="tag">&lt;/</span><span style="font-weight: bold; color: black" class="tag-name">value</span><span style="font-weight: bold; color: blue" class="tag">&gt;</span><span style="color: black"> </span></span></li><li style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #ffffff"><span style="color: black"><span style="font-weight: bold; color: blue" class="tag">&lt;</span><span style="font-weight: bold; color: black" class="tag-name">value</span><span style="color: black"> </span><span style="color: red" class="attribute">name</span><span style="color: black">=</span><span style="color: blue" class="attribute-value">&quot;group&quot;</span><span style="font-weight: bold; color: blue" class="tag">&gt;</span><span style="font-weight: bold; color: blue" class="tag">&lt;/</span><span style="font-weight: bold; color: black" class="tag-name">value</span><span style="font-weight: bold; color: blue" class="tag">&gt;</span><span style="color: black"> </span></span></li><li class="alt" style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #f8f8f8"><span style="color: black"><span style="font-weight: bold; color: blue" class="tag">&lt;</span><span style="font-weight: bold; color: black" class="tag-name">value</span><span style="color: black"> </span><span style="color: red" class="attribute">name</span><span style="color: black">=</span><span style="color: blue" class="attribute-value">&quot;mode&quot;</span><span style="font-weight: bold; color: blue" class="tag">&gt;</span><span style="color: black">0666</span><span style="font-weight: bold; color: blue" class="tag">&lt;/</span><span style="font-weight: bold; color: black" class="tag-name">value</span><span style="font-weight: bold; color: blue" class="tag">&gt;</span><span style="color: black"> </span></span></li><li style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #ffffff"><span style="color: black"><span style="font-weight: bold; color: blue" class="tag">&lt;/</span><span style="font-weight: bold; color: black" class="tag-name">value</span><span style="font-weight: bold; color: blue" class="tag">&gt;</span><span style="color: black"> </span></span></li><li class="alt" style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #f8f8f8"></li><li style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #ffffff"><span style="color: black">Additional php.ini defines, specific to this pool of workers. </span></li><li class="alt" style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #f8f8f8"><span style="color: black"><span style="font-weight: bold; color: blue" class="tag">&lt;</span><span style="font-weight: bold; color: black" class="tag-name">value</span><span style="color: black"> </span><span style="color: red" class="attribute">name</span><span style="color: black">=</span><span style="color: blue" class="attribute-value">&quot;php_defines&quot;</span><span style="font-weight: bold; color: blue" class="tag">&gt;</span><span style="color: black"> </span></span></li><li style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #ffffff"><span style="color: black"><span style="font-weight: bold; color: blue" class="tag">&lt;</span><span style="font-weight: bold; color: black" class="tag-name">value</span><span style="color: black"> </span><span style="color: red" class="attribute">name</span><span style="color: black">=</span><span style="color: blue" class="attribute-value">&quot;sendmail_path&quot;</span><span style="font-weight: bold; color: blue" class="tag">&gt;</span><span style="color: black">/usr/sbin/sendmail -t -i</span><span style="font-weight: bold; color: blue" class="tag">&lt;/</span><span style="font-weight: bold; color: black" class="tag-name">value</span><span style="font-weight: bold; color: blue" class="tag">&gt;</span><span style="color: black"> </span></span></li><li class="alt" style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #f8f8f8"><span style="color: black"><span style="font-weight: bold; color: blue" class="tag">&lt;</span><span style="font-weight: bold; color: black" class="tag-name">value</span><span style="color: black"> </span><span style="color: red" class="attribute">name</span><span style="color: black">=</span><span style="color: blue" class="attribute-value">&quot;display_errors&quot;</span><span style="font-weight: bold; color: blue" class="tag">&gt;</span><span style="color: black">1</span><span style="font-weight: bold; color: blue" class="tag">&lt;/</span><span style="font-weight: bold; color: black" class="tag-name">value</span><span style="font-weight: bold; color: blue" class="tag">&gt;</span><span style="color: black"> </span></span></li><li style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #ffffff"><span style="color: black"><span style="font-weight: bold; color: blue" class="tag">&lt;/</span><span style="font-weight: bold; color: black" class="tag-name">value</span><span style="font-weight: bold; color: blue" class="tag">&gt;</span><span style="color: black"> </span></span></li><li class="alt" style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #f8f8f8"></li><li style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #ffffff"><span style="color: black">Unix user of processes </span></li><li class="alt" style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #f8f8f8"><span style="color: black"><span style="font-weight: bold; color: blue" class="tag">&lt;</span><span style="font-weight: bold; color: black" class="tag-name">value</span><span style="color: black"> </span><span style="color: red" class="attribute">name</span><span style="color: black">=</span><span style="color: blue" class="attribute-value">&quot;user&quot;</span><span style="font-weight: bold; color: blue" class="tag">&gt;</span><span style="color: black">www</span><span style="font-weight: bold; color: blue" class="tag">&lt;/</span><span style="font-weight: bold; color: black" class="tag-name">value</span><span style="font-weight: bold; color: blue" class="tag">&gt;</span><span style="color: black"> </span></span></li><li style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #ffffff"></li><li class="alt" style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #f8f8f8"><span style="color: black">Unix group of processes </span></li><li style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #ffffff"><span style="color: black"><span style="font-weight: bold; color: blue" class="tag">&lt;</span><span style="font-weight: bold; color: black" class="tag-name">value</span><span style="color: black"> </span><span style="color: red" class="attribute">name</span><span style="color: black">=</span><span style="color: blue" class="attribute-value">&quot;group&quot;</span><span style="font-weight: bold; color: blue" class="tag">&gt;</span><span style="color: black">www</span><span style="font-weight: bold; color: blue" class="tag">&lt;/</span><span style="font-weight: bold; color: black" class="tag-name">value</span><span style="font-weight: bold; color: blue" class="tag">&gt;</span><span style="color: black"> </span></span></li><li class="alt" style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #f8f8f8"></li><li style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #ffffff"><span style="color: black">Process manager settings </span></li><li class="alt" style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #f8f8f8"><span style="color: black"><span style="font-weight: bold; color: blue" class="tag">&lt;</span><span style="font-weight: bold; color: black" class="tag-name">value</span><span style="color: black"> </span><span style="color: red" class="attribute">name</span><span style="color: black">=</span><span style="color: blue" class="attribute-value">&quot;pm&quot;</span><span style="font-weight: bold; color: blue" class="tag">&gt;</span><span style="color: black"> </span></span></li><li style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #ffffff"></li><li class="alt" style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #f8f8f8"><span style="color: black">Sets style of controling worker process count. </span></li><li style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #ffffff"><span style="color: black">Valid values are 'static' and 'apache-like' </span></li><li class="alt" style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #f8f8f8"><span style="color: black"><span style="font-weight: bold; color: blue" class="tag">&lt;</span><span style="font-weight: bold; color: black" class="tag-name">value</span><span style="color: black"> </span><span style="color: red" class="attribute">name</span><span style="color: black">=</span><span style="color: blue" class="attribute-value">&quot;style&quot;</span><span style="font-weight: bold; color: blue" class="tag">&gt;</span><span style="color: black">static</span><span style="font-weight: bold; color: blue" class="tag">&lt;/</span><span style="font-weight: bold; color: black" class="tag-name">value</span><span style="font-weight: bold; color: blue" class="tag">&gt;</span><span style="color: black"> </span></span></li><li style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #ffffff"></li><li class="alt" style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #f8f8f8"><span style="color: black">Sets the limit on the number of simultaneous requests that will be served. </span></li><li style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #ffffff"><span style="color: black">Equivalent to Apache MaxClients directive. </span></li><li class="alt" style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #f8f8f8"><span style="color: black">Equivalent to PHP_FCGI_CHILDREN environment in original php.fcgi </span></li><li style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #ffffff"><span style="color: black">Used with any pm_style. </span></li><li class="alt" style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #f8f8f8"><span style="color: black"><span style="font-weight: bold; color: blue" class="tag">&lt;</span><span style="font-weight: bold; color: black" class="tag-name">value</span><span style="color: black"> </span><span style="color: red" class="attribute">name</span><span style="color: black">=</span><span style="color: blue" class="attribute-value">&quot;max_children&quot;</span><span style="font-weight: bold; color: blue" class="tag">&gt;</span><span style="color: black">128</span><span style="font-weight: bold; color: blue" class="tag">&lt;/</span><span style="font-weight: bold; color: black" class="tag-name">value</span><span style="font-weight: bold; color: blue" class="tag">&gt;</span><span style="color: black"> </span></span></li><li style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #ffffff"></li><li class="alt" style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #f8f8f8"><span style="color: black">Settings group for 'apache-like' pm style </span></li><li style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #ffffff"><span style="color: black"><span style="font-weight: bold; color: blue" class="tag">&lt;</span><span style="font-weight: bold; color: black" class="tag-name">value</span><span style="color: black"> </span><span style="color: red" class="attribute">name</span><span style="color: black">=</span><span style="color: blue" class="attribute-value">&quot;apache_like&quot;</span><span style="font-weight: bold; color: blue" class="tag">&gt;</span><span style="color: black"> </span></span></li><li class="alt" style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #f8f8f8"></li><li style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #ffffff"><span style="color: black">Sets the number of server processes created on startup. </span></li><li class="alt" style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #f8f8f8"><span style="color: black">Used only when 'apache-like' pm_style is selected </span></li><li style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #ffffff"><span style="color: black"><span style="font-weight: bold; color: blue" class="tag">&lt;</span><span style="font-weight: bold; color: black" class="tag-name">value</span><span style="color: black"> </span><span style="color: red" class="attribute">name</span><span style="color: black">=</span><span style="color: blue" class="attribute-value">&quot;StartServers&quot;</span><span style="font-weight: bold; color: blue" class="tag">&gt;</span><span style="color: black">20</span><span style="font-weight: bold; color: blue" class="tag">&lt;/</span><span style="font-weight: bold; color: black" class="tag-name">value</span><span style="font-weight: bold; color: blue" class="tag">&gt;</span><span style="color: black"> </span></span></li><li class="alt" style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #f8f8f8"></li><li style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #ffffff"><span style="color: black">Sets the desired minimum number of idle server processes. </span></li><li class="alt" style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #f8f8f8"><span style="color: black">Used only when 'apache-like' pm_style is selected </span></li><li style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #ffffff"><span style="color: black"><span style="font-weight: bold; color: blue" class="tag">&lt;</span><span style="font-weight: bold; color: black" class="tag-name">value</span><span style="color: black"> </span><span style="color: red" class="attribute">name</span><span style="color: black">=</span><span style="color: blue" class="attribute-value">&quot;MinSpareServers&quot;</span><span style="font-weight: bold; color: blue" class="tag">&gt;</span><span style="color: black">5</span><span style="font-weight: bold; color: blue" class="tag">&lt;/</span><span style="font-weight: bold; color: black" class="tag-name">value</span><span style="font-weight: bold; color: blue" class="tag">&gt;</span><span style="color: black"> </span></span></li><li class="alt" style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #f8f8f8"></li><li style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #ffffff"><span style="color: black">Sets the desired maximum number of idle server processes. </span></li><li class="alt" style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #f8f8f8"><span style="color: black">Used only when 'apache-like' pm_style is selected </span></li><li style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #ffffff"><span style="color: black"><span style="font-weight: bold; color: blue" class="tag">&lt;</span><span style="font-weight: bold; color: black" class="tag-name">value</span><span style="color: black"> </span><span style="color: red" class="attribute">name</span><span style="color: black">=</span><span style="color: blue" class="attribute-value">&quot;MaxSpareServers&quot;</span><span style="font-weight: bold; color: blue" class="tag">&gt;</span><span style="color: black">35</span><span style="font-weight: bold; color: blue" class="tag">&lt;/</span><span style="font-weight: bold; color: black" class="tag-name">value</span><span style="font-weight: bold; color: blue" class="tag">&gt;</span><span style="color: black"> </span></span></li><li class="alt" style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #f8f8f8"></li><li style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #ffffff"><span style="color: black"><span style="font-weight: bold; color: blue" class="tag">&lt;/</span><span style="font-weight: bold; color: black" class="tag-name">value</span><span style="font-weight: bold; color: blue" class="tag">&gt;</span><span style="color: black"> </span></span></li><li class="alt" style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #f8f8f8"></li><li style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #ffffff"><span style="color: black"><span style="font-weight: bold; color: blue" class="tag">&lt;/</span><span style="font-weight: bold; color: black" class="tag-name">value</span><span style="font-weight: bold; color: blue" class="tag">&gt;</span><span style="color: black"> </span></span></li><li class="alt" style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #f8f8f8"></li><li style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #ffffff"><span style="color: black">The timeout (in seconds) for serving a single request after which the worker process will be terminated </span></li><li class="alt" style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #f8f8f8"><span style="color: black">Should be used when 'max_execution_time' ini option does not stop script execution for some reason </span></li><li style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #ffffff"><span style="color: black">'0s' means 'off' </span></li><li class="alt" style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #f8f8f8"><span style="color: black"><span style="font-weight: bold; color: blue" class="tag">&lt;</span><span style="font-weight: bold; color: black" class="tag-name">value</span><span style="color: black"> </span><span style="color: red" class="attribute">name</span><span style="color: black">=</span><span style="color: blue" class="attribute-value">&quot;request_terminate_timeout&quot;</span><span style="font-weight: bold; color: blue" class="tag">&gt;</span><span style="color: black">0s</span><span style="font-weight: bold; color: blue" class="tag">&lt;/</span><span style="font-weight: bold; color: black" class="tag-name">value</span><span style="font-weight: bold; color: blue" class="tag">&gt;</span><span style="color: black"> </span></span></li><li style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #ffffff"></li><li class="alt" style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #f8f8f8"><span style="color: black">The timeout (in seconds) for serving of single request after which a php backtrace will be dumped to slow.log file </span></li><li style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #ffffff"><span style="color: black">'0s' means 'off' </span></li><li class="alt" style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #f8f8f8"><span style="color: black"><span style="font-weight: bold; color: blue" class="tag">&lt;</span><span style="font-weight: bold; color: black" class="tag-name">value</span><span style="color: black"> </span><span style="color: red" class="attribute">name</span><span style="color: black">=</span><span style="color: blue" class="attribute-value">&quot;request_slowlog_timeout&quot;</span><span style="font-weight: bold; color: blue" class="tag">&gt;</span><span style="color: black">0s</span><span style="font-weight: bold; color: blue" class="tag">&lt;/</span><span style="font-weight: bold; color: black" class="tag-name">value</span><span style="font-weight: bold; color: blue" class="tag">&gt;</span><span style="color: black"> </span></span></li><li style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #ffffff"></li><li class="alt" style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #f8f8f8"><span style="color: black">The log file for slow requests </span></li><li style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #ffffff"><span style="color: black"><span style="font-weight: bold; color: blue" class="tag">&lt;</span><span style="font-weight: bold; color: black" class="tag-name">value</span><span style="color: black"> </span><span style="color: red" class="attribute">name</span><span style="color: black">=</span><span style="color: blue" class="attribute-value">&quot;slowlog&quot;</span><span style="font-weight: bold; color: blue" class="tag">&gt;</span><span style="color: black">logs/slow.log</span><span style="font-weight: bold; color: blue" class="tag">&lt;/</span><span style="font-weight: bold; color: black" class="tag-name">value</span><span style="font-weight: bold; color: blue" class="tag">&gt;</span><span style="color: black"> </span></span></li><li class="alt" style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #f8f8f8"></li><li style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #ffffff"><span style="color: black">Set open file desc rlimit </span></li><li class="alt" style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #f8f8f8"><span style="color: black"><span style="font-weight: bold; color: blue" class="tag">&lt;</span><span style="font-weight: bold; color: black" class="tag-name">value</span><span style="color: black"> </span><span style="color: red" class="attribute">name</span><span style="color: black">=</span><span style="color: blue" class="attribute-value">&quot;rlimit_files&quot;</span><span style="font-weight: bold; color: blue" class="tag">&gt;</span><span style="color: black">51200</span><span style="font-weight: bold; color: blue" class="tag">&lt;/</span><span style="font-weight: bold; color: black" class="tag-name">value</span><span style="font-weight: bold; color: blue" class="tag">&gt;</span><span style="color: black"> </span></span></li><li style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #ffffff"></li><li class="alt" style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #f8f8f8"><span style="color: black">Set max core size rlimit </span></li><li style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #ffffff"><span style="color: black"><span style="font-weight: bold; color: blue" class="tag">&lt;</span><span style="font-weight: bold; color: black" class="tag-name">value</span><span style="color: black"> </span><span style="color: red" class="attribute">name</span><span style="color: black">=</span><span style="color: blue" class="attribute-value">&quot;rlimit_core&quot;</span><span style="font-weight: bold; color: blue" class="tag">&gt;</span><span style="color: black">0</span><span style="font-weight: bold; color: blue" class="tag">&lt;/</span><span style="font-weight: bold; color: black" class="tag-name">value</span><span style="font-weight: bold; color: blue" class="tag">&gt;</span><span style="color: black"> </span></span></li><li class="alt" style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #f8f8f8"></li><li style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #ffffff"><span style="color: black">Chroot to this directory at the start, absolute path </span></li><li class="alt" style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #f8f8f8"><span style="color: black"><span style="font-weight: bold; color: blue" class="tag">&lt;</span><span style="font-weight: bold; color: black" class="tag-name">value</span><span style="color: black"> </span><span style="color: red" class="attribute">name</span><span style="color: black">=</span><span style="color: blue" class="attribute-value">&quot;chroot&quot;</span><span style="font-weight: bold; color: blue" class="tag">&gt;</span><span style="font-weight: bold; color: blue" class="tag">&lt;/</span><span style="font-weight: bold; color: black" class="tag-name">value</span><span style="font-weight: bold; color: blue" class="tag">&gt;</span><span style="color: black"> </span></span></li><li style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #ffffff"></li><li class="alt" style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #f8f8f8"><span style="color: black">Chdir to this directory at the start, absolute path </span></li><li style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #ffffff"><span style="color: black"><span style="font-weight: bold; color: blue" class="tag">&lt;</span><span style="font-weight: bold; color: black" class="tag-name">value</span><span style="color: black"> </span><span style="color: red" class="attribute">name</span><span style="color: black">=</span><span style="color: blue" class="attribute-value">&quot;chdir&quot;</span><span style="font-weight: bold; color: blue" class="tag">&gt;</span><span style="font-weight: bold; color: blue" class="tag">&lt;/</span><span style="font-weight: bold; color: black" class="tag-name">value</span><span style="font-weight: bold; color: blue" class="tag">&gt;</span><span style="color: black"> </span></span></li><li class="alt" style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #f8f8f8"></li><li style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #ffffff"><span style="color: black">Redirect workers' stdout and stderr into main error log. </span></li><li class="alt" style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #f8f8f8"><span style="color: black">If not set, they will be redirected to /dev/null, according to FastCGI specs </span></li><li style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #ffffff"><span style="color: black"><span style="font-weight: bold; color: blue" class="tag">&lt;</span><span style="font-weight: bold; color: black" class="tag-name">value</span><span style="color: black"> </span><span style="color: red" class="attribute">name</span><span style="color: black">=</span><span style="color: blue" class="attribute-value">&quot;catch_workers_output&quot;</span><span style="font-weight: bold; color: blue" class="tag">&gt;</span><span style="color: black">yes</span><span style="font-weight: bold; color: blue" class="tag">&lt;/</span><span style="font-weight: bold; color: black" class="tag-name">value</span><span style="font-weight: bold; color: blue" class="tag">&gt;</span><span style="color: black"> </span></span></li><li class="alt" style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #f8f8f8"></li><li style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #ffffff"><span style="color: black">How much requests each process should execute before respawn. </span></li><li class="alt" style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #f8f8f8"><span style="color: black">Useful to work around memory leaks in 3rd party libraries. </span></li><li style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #ffffff"><span style="color: black">For endless request processing please specify 0 </span></li><li class="alt" style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #f8f8f8"><span style="color: black">Equivalent to PHP_FCGI_MAX_REQUESTS </span></li><li style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #ffffff"><span style="color: black"><span style="font-weight: bold; color: blue" class="tag">&lt;</span><span style="font-weight: bold; color: black" class="tag-name">value</span><span style="color: black"> </span><span style="color: red" class="attribute">name</span><span style="color: black">=</span><span style="color: blue" class="attribute-value">&quot;max_requests&quot;</span><span style="font-weight: bold; color: blue" class="tag">&gt;</span><span style="color: black">102400</span><span style="font-weight: bold; color: blue" class="tag">&lt;/</span><span style="font-weight: bold; color: black" class="tag-name">value</span><span style="font-weight: bold; color: blue" class="tag">&gt;</span><span style="color: black"> </span></span></li><li class="alt" style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #f8f8f8"></li><li style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #ffffff"><span style="color: black">Comma separated list of ipv4 addresses of FastCGI clients that allowed to connect. </span></li><li class="alt" style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #f8f8f8"><span style="color: black">Equivalent to FCGI_WEB_SERVER_ADDRS environment in original php.fcgi (5.2.2+) </span></li><li style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #ffffff"><span style="color: black">Makes sense only with AF_INET listening socket. </span></li><li class="alt" style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #f8f8f8"><span style="color: black"><span style="font-weight: bold; color: blue" class="tag">&lt;</span><span style="font-weight: bold; color: black" class="tag-name">value</span><span style="color: black"> </span><span style="color: red" class="attribute">name</span><span style="color: black">=</span><span style="color: blue" class="attribute-value">&quot;allowed_clients&quot;</span><span style="font-weight: bold; color: blue" class="tag">&gt;</span><span style="color: black">127.0.0.1</span><span style="font-weight: bold; color: blue" class="tag">&lt;/</span><span style="font-weight: bold; color: black" class="tag-name">value</span><span style="font-weight: bold; color: blue" class="tag">&gt;</span><span style="color: black"> </span></span></li><li style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #ffffff"></li><li class="alt" style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #f8f8f8"><span style="color: black">Pass environment variables like LD_LIBRARY_PATH </span></li><li style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #ffffff"><span style="color: black">All $VARIABLEs are taken from current environment </span></li><li class="alt" style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #f8f8f8"><span style="color: black"><span style="font-weight: bold; color: blue" class="tag">&lt;</span><span style="font-weight: bold; color: black" class="tag-name">value</span><span style="color: black"> </span><span style="color: red" class="attribute">name</span><span style="color: black">=</span><span style="color: blue" class="attribute-value">&quot;environment&quot;</span><span style="font-weight: bold; color: blue" class="tag">&gt;</span><span style="color: black"> </span></span></li><li style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #ffffff"><span style="color: black"><span style="font-weight: bold; color: blue" class="tag">&lt;</span><span style="font-weight: bold; color: black" class="tag-name">value</span><span style="color: black"> </span><span style="color: red" class="attribute">name</span><span style="color: black">=</span><span style="color: blue" class="attribute-value">&quot;HOSTNAME&quot;</span><span style="font-weight: bold; color: blue" class="tag">&gt;</span><span style="color: black">$HOSTNAME</span><span style="font-weight: bold; color: blue" class="tag">&lt;/</span><span style="font-weight: bold; color: black" class="tag-name">value</span><span style="font-weight: bold; color: blue" class="tag">&gt;</span><span style="color: black"> </span></span></li><li class="alt" style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #f8f8f8"><span style="color: black"><span style="font-weight: bold; color: blue" class="tag">&lt;</span><span style="font-weight: bold; color: black" class="tag-name">value</span><span style="color: black"> </span><span style="color: red" class="attribute">name</span><span style="color: black">=</span><span style="color: blue" class="attribute-value">&quot;PATH&quot;</span><span style="font-weight: bold; color: blue" class="tag">&gt;</span><span style="color: black">/usr/local/bin:/usr/bin:/bin</span><span style="font-weight: bold; color: blue" class="tag">&lt;/</span><span style="font-weight: bold; color: black" class="tag-name">value</span><span style="font-weight: bold; color: blue" class="tag">&gt;</span><span style="color: black"> </span></span></li><li style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #ffffff"><span style="color: black"><span style="font-weight: bold; color: blue" class="tag">&lt;</span><span style="font-weight: bold; color: black" class="tag-name">value</span><span style="color: black"> </span><span style="color: red" class="attribute">name</span><span style="color: black">=</span><span style="color: blue" class="attribute-value">&quot;TMP&quot;</span><span style="font-weight: bold; color: blue" class="tag">&gt;</span><span style="color: black">/tmp</span><span style="font-weight: bold; color: blue" class="tag">&lt;/</span><span style="font-weight: bold; color: black" class="tag-name">value</span><span style="font-weight: bold; color: blue" class="tag">&gt;</span><span style="color: black"> </span></span></li><li class="alt" style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #f8f8f8"><span style="color: black"><span style="font-weight: bold; color: blue" class="tag">&lt;</span><span style="font-weight: bold; color: black" class="tag-name">value</span><span style="color: black"> </span><span style="color: red" class="attribute">name</span><span style="color: black">=</span><span style="color: blue" class="attribute-value">&quot;TMPDIR&quot;</span><span style="font-weight: bold; color: blue" class="tag">&gt;</span><span style="color: black">/tmp</span><span style="font-weight: bold; color: blue" class="tag">&lt;/</span><span style="font-weight: bold; color: black" class="tag-name">value</span><span style="font-weight: bold; color: blue" class="tag">&gt;</span><span style="color: black"> </span></span></li><li style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #ffffff"><span style="color: black"><span style="font-weight: bold; color: blue" class="tag">&lt;</span><span style="font-weight: bold; color: black" class="tag-name">value</span><span style="color: black"> </span><span style="color: red" class="attribute">name</span><span style="color: black">=</span><span style="color: blue" class="attribute-value">&quot;TEMP&quot;</span><span style="font-weight: bold; color: blue" class="tag">&gt;</span><span style="color: black">/tmp</span><span style="font-weight: bold; color: blue" class="tag">&lt;/</span><span style="font-weight: bold; color: black" class="tag-name">value</span><span style="font-weight: bold; color: blue" class="tag">&gt;</span><span style="color: black"> </span></span></li><li class="alt" style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #f8f8f8"><span style="color: black"><span style="font-weight: bold; color: blue" class="tag">&lt;</span><span style="font-weight: bold; color: black" class="tag-name">value</span><span style="color: black"> </span><span style="color: red" class="attribute">name</span><span style="color: black">=</span><span style="color: blue" class="attribute-value">&quot;OSTYPE&quot;</span><span style="font-weight: bold; color: blue" class="tag">&gt;</span><span style="color: black">$OSTYPE</span><span style="font-weight: bold; color: blue" class="tag">&lt;/</span><span style="font-weight: bold; color: black" class="tag-name">value</span><span style="font-weight: bold; color: blue" class="tag">&gt;</span><span style="color: black"> </span></span></li><li style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #ffffff"><span style="color: black"><span style="font-weight: bold; color: blue" class="tag">&lt;</span><span style="font-weight: bold; color: black" class="tag-name">value</span><span style="color: black"> </span><span style="color: red" class="attribute">name</span><span style="color: black">=</span><span style="color: blue" class="attribute-value">&quot;MACHTYPE&quot;</span><span style="font-weight: bold; color: blue" class="tag">&gt;</span><span style="color: black">$MACHTYPE</span><span style="font-weight: bold; color: blue" class="tag">&lt;/</span><span style="font-weight: bold; color: black" class="tag-name">value</span><span style="font-weight: bold; color: blue" class="tag">&gt;</span><span style="color: black"> </span></span></li><li class="alt" style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #f8f8f8"><span style="color: black"><span style="font-weight: bold; color: blue" class="tag">&lt;</span><span style="font-weight: bold; color: black" class="tag-name">value</span><span style="color: black"> </span><span style="color: red" class="attribute">name</span><span style="color: black">=</span><span style="color: blue" class="attribute-value">&quot;MALLOC_CHECK_&quot;</span><span style="font-weight: bold; color: blue" class="tag">&gt;</span><span style="color: black">2</span><span style="font-weight: bold; color: blue" class="tag">&lt;/</span><span style="font-weight: bold; color: black" class="tag-name">value</span><span style="font-weight: bold; color: blue" class="tag">&gt;</span><span style="color: black"> </span></span></li><li style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #ffffff"><span style="color: black"><span style="font-weight: bold; color: blue" class="tag">&lt;/</span><span style="font-weight: bold; color: black" class="tag-name">value</span><span style="font-weight: bold; color: blue" class="tag">&gt;</span><span style="color: black"> </span></span></li><li class="alt" style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #f8f8f8"></li><li style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #ffffff"><span style="color: black"><span style="font-weight: bold; color: blue" class="tag">&lt;/</span><span style="font-weight: bold; color: black" class="tag-name">section</span><span style="font-weight: bold; color: blue" class="tag">&gt;</span><span style="color: black"> </span></span></li><li class="alt" style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #f8f8f8"></li><li style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #ffffff"><span style="color: black"><span style="font-weight: bold; color: blue" class="tag">&lt;/</span><span style="font-weight: bold; color: black" class="tag-name">workers</span><span style="font-weight: bold; color: blue" class="tag">&gt;</span><span style="color: black"> </span></span></li><li class="alt" style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #f8f8f8"></li><li style="padding-left: 10px; border-left: #6ce26c 3px solid; line-height: 14px; background-color: #ffffff"><span style="color: black"><span style="font-weight: bold; color: blue" class="tag">&lt;/</span><span style="font-weight: bold; color: black" class="tag-name">configuration</span><span style="font-weight: bold; color: blue" class="tag">&gt;</span><span style="color: black"> </span></span></li></ol></div>　　9、启动php-cgi进程，监听127.0.0.1的9000端口，进程数为200（如果服务器内存小于3GB，可以只开启64个进程），用户为www：<br /><div style="padding-right: 3px; padding-left: 3px; padding-bottom: 3px; margin: 5px 5px 0px; padding-top: 3px; background-color: #ffffff; border: #00a0c6 1px dashed">ulimit -SHn 51200<br />/usr/local/webserver/php/sbin/php-fpm start</div><br />　　注：/usr/local/webserver/php/sbin/php-fpm还有其他参数，包括：start&#124;stop&#124;quit&#124;restart&#124;reload&#124;logrotate，修改php.ini后不重启php-cgi，重新加载配置文件使用reload。<br /><br /><hr style="border-top: #63b4cd 1px solid; border-left-width: 0px; border-bottom-width: 0px; height: 1px; border-right-width: 0px" /><br />　　<strong>三、安装Nginx 0.7.61</strong><br />　　1、安装Nginx所需的pcre库：<br /><div style="padding-right: 3px; padding-left: 3px; padding-bottom: 3px; margin: 5px 5px 0px; padding-top: 3px; background-color: #ffffff; border: #00a0c6 1px dashed">tar zxvf pcre-7.9.tar.gz<br />cd pcre-7.9/<br />./configure<br />make &amp;&amp; make install<br />cd ../</div><br /><br />　　2、安装Nginx<br /><div style="padding-right: 3px; padding-left: 3px; padding-bottom: 3px; margin: 5px 5px 0px; padding-top: 3px; background-color: #ffffff; border: #00a0c6 1px dashed">tar zxvf nginx-0.7.61.tar.gz<br />cd nginx-0.7.61/<br />./configure --user=www --group=www --prefix=/usr/local/webserver/nginx --with-http_stub_status_module --with-http_ssl_module<br />make &amp;&amp; make install<br />cd ../</div><br /><br />　　3、创建Nginx日志目录<br /><div style="padding-right: 3px; padding-left: 3px; padding-bottom: 3px; margin: 5px 5px 0px; padding-top: 3px; background-color: #ffffff; border: #00a0c6 1px dashed">mkdir -p /data1/logs<br />chmod +w /data1/logs<br />chown -R www:www /data1/logs</div><br /><br />　　4、创建Nginx配置文件<br />　　①、在/usr/local/webserver/nginx/conf/目录中创建nginx.conf文件：<br /><div style="padding-right: 3px; padding-left: 3px; padding-bottom: 3px; margin: 5px 5px 0px; padding-top: 3px; background-color: #ffffff; border: #00a0c6 1px dashed">rm -f /usr/local/webserver/nginx/conf/nginx.conf<br />vi /usr/local/webserver/nginx/conf/nginx.conf</div><br />　　输入以下内容：<br /><div class="quote" style="margin: 10px 10px 0px; border: #00a0c6 1px dashed"><div class="quote-title" style="padding-right: 5px; padding-left: 5px; font-weight: bold; padding-bottom: 5px; color: #4c9bb0; padding-top: 5px; border-bottom: #00a0c6 1px dotted; background-color: #edf4f6">引用</div><div class="quote-content" style="border-top-width: 0px; border-right: #edf4f6 1px dashed; padding-right: 10px; padding-left: 10px; padding-bottom: 10px; border-left: #edf4f6 1px dashed; color: #000000; padding-top: 10px; border-bottom: #edf4f6 1px dashed; background-color: #ffffff">user www www;<br /><br />worker_processes 8;<br /><br />error_log /data1/logs/nginx_error.log crit;<br /><br />pid /usr/local/webserver/nginx/nginx.pid;<br /><br />#Specifies the value for maximum file descriptors that can be opened by this process.<span class="Apple-converted-space"> </span><br />worker_rlimit_nofile 51200;<br /><br />events<span class="Apple-converted-space"> </span><br />{<br />use epoll;<br />worker_connections 51200;<br />}<br /><br />http<span class="Apple-converted-space"> </span><br />{<br />include mime.types;<br />default_type application/octet-stream;<br /><br />#charset gb2312;<br /><br />server_names_hash_bucket_size 128;<br />client_header_buffer_size 32k;<br />large_client_header_buffers 4 32k;<br />client_max_body_size 8m;<br /><br />sendfile on;<br />tcp_nopush on;<br /><br />keepalive_timeout 60;<br /><br />tcp_nodelay on;<br /><br />fastcgi_connect_timeout 300;<br />fastcgi_send_timeout 300;<br />fastcgi_read_timeout 300;<br />fastcgi_buffer_size 64k;<br />fastcgi_buffers 4 64k;<br />fastcgi_busy_buffers_size 128k;<br />fastcgi_temp_file_write_size 128k;<br /><br />gzip on;<br />gzip_min_length 1k;<br />gzip_buffers 4 16k;<br />gzip_http_version 1.0;<br />gzip_comp_level 2;<br />gzip_types text/plain application/x-javascript text/css application/xml;<br />gzip_vary on;<br /><br />#limit_zone crawler $binary_remote_addr 10m;<br /><br />server<br />{<br />listen 80;<br />server_name blog.s135.com;<br />index index.html index.htm index.php;<br />root /data0/htdocs/blog;<br /><br />#limit_conn crawler 20; <br /><br />location ~ .*&#92;.(php&#124;php5)?$<br />{ <br />#fastcgi_pass unix:/tmp/php-cgi.sock;<br />fastcgi_pass 127.0.0.1:9000;<br />fastcgi_index index.php;<br />include fcgi.conf;<br />}<br /><br />location ~ .*&#92;.(gif&#124;jpg&#124;jpeg&#124;png&#124;bmp&#124;swf)$<br />{<br />expires 30d;<br />}<br /><br />location ~ .*&#92;.(js&#124;css)?$<br />{<br />expires 1h;<br />} <br /><br />log_format access '$remote_addr - $remote_user [$time_local] &quot;$request&quot; '<br />'$status $body_bytes_sent &quot;$http_referer&quot; '<br />'&quot;$http_user_agent&quot; $http_x_forwarded_for';<br />access_log /data1/logs/access.log access;<br />}<br /><br />server<br />{<br />listen 80;<br />server_name <a style="color: #4f6371; text-decoration: none" href="http://www.s135.com;/" target="_blank">www.s135.com;</a><br />index index.html index.htm index.php;<br />root /data0/htdocs/www;<br /><br />location ~ .*&#92;.(php&#124;php5)?$<br />{ <br />#fastcgi_pass unix:/tmp/php-cgi.sock;<br />fastcgi_pass 127.0.0.1:9000;<br />fastcgi_index index.php;<br />include fcgi.conf;<br />}<br /><br />log_format wwwlogs '$remote_addr - $remote_user [$time_local] &quot;$request&quot; '<br />'$status $body_bytes_sent &quot;$http_referer&quot; '<br />'&quot;$http_user_agent&quot; $http_x_forwarded_for';<br />access_log /data1/logs/wwwlogs.log wwwlogs;<br />}<br /><br />server<br />{<br />listen 80;<br />server_name status.blog.s135.com;<br /><br />location / {<br />stub_status on;<br />access_log off;<br />}<br />}<br />}</div></div><br /><br />　　②、在/usr/local/webserver/nginx/conf/目录中创建fcgi.conf文件：<br /><div style="padding-right: 3px; padding-left: 3px; padding-bottom: 3px; margin: 5px 5px 0px; padding-top: 3px; background-color: #ffffff; border: #00a0c6 1px dashed">vi /usr/local/webserver/nginx/conf/fcgi.conf</div><br />　　输入以下内容：<br /><div class="quote" style="margin: 10px 10px 0px; border: #00a0c6 1px dashed"><div class="quote-title" style="padding-right: 5px; padding-left: 5px; font-weight: bold; padding-bottom: 5px; color: #4c9bb0; padding-top: 5px; border-bottom: #00a0c6 1px dotted; background-color: #edf4f6">引用</div><div class="quote-content" style="border-top-width: 0px; border-right: #edf4f6 1px dashed; padding-right: 10px; padding-left: 10px; padding-bottom: 10px; border-left: #edf4f6 1px dashed; color: #000000; padding-top: 10px; border-bottom: #edf4f6 1px dashed; background-color: #ffffff">fastcgi_param GATEWAY_INTERFACE CGI/1.1;<br />fastcgi_param SERVER_SOFTWARE nginx;<br /><br />fastcgi_param QUERY_STRING $query_string;<br />fastcgi_param REQUEST_METHOD $request_method;<br />fastcgi_param CONTENT_TYPE $content_type;<br />fastcgi_param CONTENT_LENGTH $content_length;<br /><br />fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;<br />fastcgi_param SCRIPT_NAME $fastcgi_script_name;<br />fastcgi_param REQUEST_URI $request_uri;<br />fastcgi_param DOCUMENT_URI $document_uri;<br />fastcgi_param DOCUMENT_ROOT $document_root;<br />fastcgi_param SERVER_PROTOCOL $server_protocol;<br /><br />fastcgi_param REMOTE_ADDR $remote_addr;<br />fastcgi_param REMOTE_PORT $remote_port;<br />fastcgi_param SERVER_ADDR $server_addr;<br />fastcgi_param SERVER_PORT $server_port;<br />fastcgi_param SERVER_NAME $server_name;<br /><br /># PHP only, required if PHP was built with --enable-force-cgi-redirect<br />fastcgi_param REDIRECT_STATUS 200;</div></div><br /><br />　　5、启动Nginx<br /><div style="padding-right: 3px; padding-left: 3px; padding-bottom: 3px; margin: 5px 5px 0px; padding-top: 3px; background-color: #ffffff; border: #00a0c6 1px dashed">ulimit -SHn 51200<br />/usr/local/webserver/nginx/sbin/nginx</div><br /><hr style="border-top: #63b4cd 1px solid; border-left-width: 0px; border-bottom-width: 0px; height: 1px; border-right-width: 0px" /><br />　　<strong>四、配置开机自动启动Nginx + PHP</strong><br /><div style="padding-right: 3px; padding-left: 3px; padding-bottom: 3px; margin: 5px 5px 0px; padding-top: 3px; background-color: #ffffff; border: #00a0c6 1px dashed">vi /etc/rc.local</div><br />　　在末尾增加以下内容：<br /><div class="quote" style="margin: 10px 10px 0px; border: #00a0c6 1px dashed"><div class="quote-title" style="padding-right: 5px; padding-left: 5px; font-weight: bold; padding-bottom: 5px; color: #4c9bb0; padding-top: 5px; border-bottom: #00a0c6 1px dotted; background-color: #edf4f6">引用</div><div class="quote-content" style="border-top-width: 0px; border-right: #edf4f6 1px dashed; padding-right: 10px; padding-left: 10px; padding-bottom: 10px; border-left: #edf4f6 1px dashed; color: #000000; padding-top: 10px; border-bottom: #edf4f6 1px dashed; background-color: #ffffff">ulimit -SHn 51200<br />/usr/local/webserver/php/sbin/php-fpm start<br />/usr/local/webserver/nginx/sbin/nginx</div></div><br /><hr style="border-top: #63b4cd 1px solid; border-left-width: 0px; border-bottom-width: 0px; height: 1px; border-right-width: 0px" /><br />　　<strong>五、优化Linux内核参数</strong><br /><div style="padding-right: 3px; padding-left: 3px; padding-bottom: 3px; margin: 5px 5px 0px; padding-top: 3px; background-color: #ffffff; border: #00a0c6 1px dashed">vi /etc/sysctl.conf</div><br />　　在末尾增加以下内容：<br /><div class="quote" style="margin: 10px 10px 0px; border: #00a0c6 1px dashed"><div class="quote-title" style="padding-right: 5px; padding-left: 5px; font-weight: bold; padding-bottom: 5px; color: #4c9bb0; padding-top: 5px; border-bottom: #00a0c6 1px dotted; background-color: #edf4f6">引用</div><div class="quote-content" style="border-top-width: 0px; border-right: #edf4f6 1px dashed; padding-right: 10px; padding-left: 10px; padding-bottom: 10px; border-left: #edf4f6 1px dashed; color: #000000; padding-top: 10px; border-bottom: #edf4f6 1px dashed; background-color: #ffffff"># Add<br />net.ipv4.tcp_max_syn_backlog = 65536<br />net.core.netdev_max_backlog = 32768<br />net.core.somaxconn = 32768<br /><br />net.core.wmem_default = 8388608<br />net.core.rmem_default = 8388608<br />net.core.rmem_max = 16777216<br />net.core.wmem_max = 16777216<br /><br />net.ipv4.tcp_timestamps = 0<br />net.ipv4.tcp_synack_retries = 2<br />net.ipv4.tcp_syn_retries = 2<br /><br />net.ipv4.tcp_tw_recycle = 1<br />#net.ipv4.tcp_tw_len = 1<br />net.ipv4.tcp_tw_reuse = 1<br /><br />net.ipv4.tcp_mem = 94500000 915000000 927000000<br />net.ipv4.tcp_max_orphans = 3276800<br /><br />#net.ipv4.tcp_fin_timeout = 30<br />#net.ipv4.tcp_keepalive_time = 120<br />net.ipv4.ip_local_port_range = 1024 65535</div></div><br /><br />　　使配置立即生效：<br /><div style="padding-right: 3px; padding-left: 3px; padding-bottom: 3px; margin: 5px 5px 0px; padding-top: 3px; background-color: #ffffff; border: #00a0c6 1px dashed">/sbin/sysctl -p</div><br /><hr style="border-top: #63b4cd 1px solid; border-left-width: 0px; border-bottom-width: 0px; height: 1px; border-right-width: 0px" /><br />　　<strong>六、在不停止Nginx服务的情况下平滑变更Nginx配置</strong><br />　　1、修改/usr/local/webserver/nginx/conf/nginx.conf配置文件后，请执行以下命令检查配置文件是否正确：<br /><div style="padding-right: 3px; padding-left: 3px; padding-bottom: 3px; margin: 5px 5px 0px; padding-top: 3px; background-color: #ffffff; border: #00a0c6 1px dashed">/usr/local/webserver/nginx/sbin/nginx -t</div><br />　　如果屏幕显示以下两行信息，说明配置文件正确：<br />　　<span style="color: #008000">the configuration file /usr/local/webserver/nginx/conf/nginx.conf syntax is ok<br />　　the configuration file /usr/local/webserver/nginx/conf/nginx.conf was tested successfully</span><br /><br />　　2、这时，输入以下命令查看Nginx主进程号：<br /><div style="padding-right: 3px; padding-left: 3px; padding-bottom: 3px; margin: 5px 5px 0px; padding-top: 3px; background-color: #ffffff; border: #00a0c6 1px dashed">ps -ef &#124; grep &quot;nginx: master process&quot; &#124; grep -v &quot;grep&quot; &#124; awk -F ' ' '{print $2}'</div><br />　　屏幕显示的即为Nginx主进程号，例如：<br />　　<span style="color: #008000">6302</span><br />　　这时，执行以下命令即可使修改过的Nginx配置文件生效：<br /><div style="padding-right: 3px; padding-left: 3px; padding-bottom: 3px; margin: 5px 5px 0px; padding-top: 3px; background-color: #ffffff; border: #00a0c6 1px dashed">kill -HUP 6302</div><br />　　或者无需这么麻烦，找到Nginx的Pid文件：<br /><div style="padding-right: 3px; padding-left: 3px; padding-bottom: 3px; margin: 5px 5px 0px; padding-top: 3px; background-color: #ffffff; border: #00a0c6 1px dashed">kill -HUP `cat /usr/local/webserver/nginx/nginx.pid`</div><br /><hr style="border-top: #63b4cd 1px solid; border-left-width: 0px; border-bottom-width: 0px; height: 1px; border-right-width: 0px" /><br />　　<strong>七、编写每天定时切割Nginx日志的脚本</strong><br />　　1、创建脚本/usr/local/webserver/nginx/sbin/cut_nginx_log.sh<br /><div style="padding-right: 3px; padding-left: 3px; padding-bottom: 3px; margin: 5px 5px 0px; padding-top: 3px; background-color: #ffffff; border: #00a0c6 1px dashed">vi /usr/local/webserver/nginx/sbin/cut_nginx_log.sh</div><br />　　输入以下内容：<br /><div class="quote" style="margin: 10px 10px 0px; border: #00a0c6 1px dashed"><div class="quote-title" style="padding-right: 5px; padding-left: 5px; font-weight: bold; padding-bottom: 5px; color: #4c9bb0; padding-top: 5px; border-bottom: #00a0c6 1px dotted; background-color: #edf4f6">引用</div><div class="quote-content" style="border-top-width: 0px; border-right: #edf4f6 1px dashed; padding-right: 10px; padding-left: 10px; padding-bottom: 10px; border-left: #edf4f6 1px dashed; color: #000000; padding-top: 10px; border-bottom: #edf4f6 1px dashed; background-color: #ffffff">#!/bin/bash<br /># This script run at 00:00<br /><br /># The Nginx logs path<br />logs_path=&quot;/usr/local/webserver/nginx/logs/&quot;<br /><br />mkdir -p ${logs_path}$(date -d &quot;yesterday&quot; +&quot;%Y&quot;)/$(date -d &quot;yesterday&quot; +&quot;%m&quot;)/<br />mv ${logs_path}access.log ${logs_path}$(date -d &quot;yesterday&quot; +&quot;%Y&quot;)/$(date -d &quot;yesterday&quot; +&quot;%m&quot;)/access_$(date -d &quot;yesterday&quot; +&quot;%Y%m%d&quot;).log<br />kill -USR1 `cat /usr/local/webserver/nginx/nginx.pid`</div></div><br /><br />　　2、设置crontab，每天凌晨00:00切割nginx访问日志<br /><div style="padding-right: 3px; padding-left: 3px; padding-bottom: 3px; margin: 5px 5px 0px; padding-top: 3px; background-color: #ffffff; border: #00a0c6 1px dashed">crontab -e</div><br />　　输入以下内容：<br /><div class="quote" style="margin: 10px 10px 0px; border: #00a0c6 1px dashed"><div class="quote-title" style="padding-right: 5px; padding-left: 5px; font-weight: bold; padding-bottom: 5px; color: #4c9bb0; padding-top: 5px; border-bottom: #00a0c6 1px dotted; background-color: #edf4f6">引用</div><div class="quote-content" style="border-top-width: 0px; border-right: #edf4f6 1px dashed; padding-right: 10px; padding-left: 10px; padding-bottom: 10px; border-left: #edf4f6 1px dashed; color: #000000; padding-top: 10px; border-bottom: #edf4f6 1px dashed; background-color: #ffffff">00 00 * * * /bin/bash /usr/local/webserver/nginx/sbin/cut_nginx_log.sh</div></div><br /><br /><hr style="border-top: #63b4cd 1px solid; border-left-width: 0px; border-bottom-width: 0px; height: 1px; border-right-width: 0px" /><br />　　本文若有小的修改，会第一时间在以下网址发布：<br />　　<a style="color: #4f6371; text-decoration: none" href="http://blog.s135.com/nginx_php_v5/" target="_blank">http://blog.s135.com/nginx_php_v5/</a><br />原文链接：<a style="color: #4f6371; text-decoration: none" href="http://blog.s135.com/nginx_php_v5/" target="_blank">http://blog.s135.com/nginx_php_v5/</a><br /></span></span><br/>Tags - <a href="http://my.clicknow.cn/go.php/tags/nginx/" rel="tag">nginx</a> , <a href="http://my.clicknow.cn/go.php/tags/php/" rel="tag">php</a> , <a href="http://my.clicknow.cn/go.php/tags/apache/" rel="tag">apache</a>
]]>
</description>
</item><item>
<link>http://my.clicknow.cn/read.php/132.htm</link>
<title><![CDATA[《APMServ 5.2.6》：一键快速搭建Apache＋PHP＋MySQL＋Nginx＋Memcached＋ASP平台的绿色软件]]></title> 
<author>点击生活 &lt;&gt;</author>
<category><![CDATA[服务器]]></category>
<pubDate>Tue, 28 Jul 2009 05:57:10 +0000</pubDate> 
<guid>http://my.clicknow.cn/read.php/132.htm</guid> 
<description>
<![CDATA[ 
	<span style="word-spacing: 0px; font: medium Simsun; text-transform: none; color: #000000; text-indent: 0px; white-space: normal; letter-spacing: normal; border-collapse: separate; orphans: 2; widows: 2; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" class="Apple-style-span"><span style="font-size: 12px; font-family: Tahoma, Arial; text-align: left" class="Apple-style-span">　　[软件作者：张宴 本文版本：v1.1 最后修改：2008.11.06 ]<br /><br />　　两年后，APMServ再出新版本──APMServ 5.2.6，升级了各集成软件的版本，增加了Nginx、Memcached、WinSCP，以及部分Linux命令的支持。<br /><br />　　软件名称：<span style="color: red">APMServ 5.2.6</span><br />　　软件作者：张宴<br />　　授权方式：免费软件<br />　　发布日期：2008年10月21日<br />　　运行环境：WinNT/Win2000/WinXP/Win2003<br />　　文件大小：20.4MB<br />　　官方网站：<a style="color: #4f6371; text-decoration: none" href="http://apmserv.s135.com/" target="_blank"></a><a style="color: #4f6371; text-decoration: none" href="http://apmserv.s135.com/" target="_blank">http://apmserv.s135.com</a><br />　　讨论群组：<a style="color: #4f6371; text-decoration: none" href="http://blog.s135.com/apmserv/bbs/" target="_blank"></a><a style="color: #4f6371; text-decoration: none" href="http://blog.s135.com/apmserv/bbs/" target="_blank">http://blog.s135.com/apmserv/bbs/</a><br />　　<br />　　<strong>下载地址：</strong><br />　　㈠官方下载点：<br />　　[国内下载点①&rarr;新浪爱问CDN]<span class="Apple-converted-space">&nbsp;</span><a style="color: #4f6371; text-decoration: none" href="http://blog.s135.com/apmserv/bin/5.2.6/sina/" target="_blank">http://blog.s135.com/apmserv/bin/5.2.6/sina/</a><br />　　[国外下载点①&rarr;美国微软公司]<span class="Apple-converted-space">&nbsp;</span><a style="color: #4f6371; text-decoration: none" href="http://blog.s135.com/apmserv/bin/5.2.6/microsoft/" target="_blank">http://blog.s135.com/apmserv/bin/5.2.6/microsoft/</a><br /><br />　　㈡合作下载点：<br />　　[<a style="color: #4f6371; text-decoration: none" href="http://www.newhua.com/soft/41626.htm" target="_blank">华军软件园</a>] [<a style="color: #4f6371; text-decoration: none" href="http://down1.tech.sina.com.cn/download/down_contents/1169913600/34755.shtml" target="_blank">新浪网</a>] [<a style="color: #4f6371; text-decoration: none" href="http://down.chinaz.com/soft/7558.htm" target="_blank">中国站长站</a>] [<a style="color: #4f6371; text-decoration: none" href="http://www.crsky.com/soft/13901.html" target="_blank">霏凡软件站</a>] [<a style="color: #4f6371; text-decoration: none" href="http://www.xdowns.com/soft/1/71/2008/Soft_47468.html" target="_blank">绿色软件联盟</a>] [<a style="color: #4f6371; text-decoration: none" href="http://www.greendown.cn/soft/12111.html" target="_blank">绿色下载站</a>] [<a style="color: #4f6371; text-decoration: none" href="http://www.sz1001.net/soft/38207.htm" target="_blank">1001下载乐园</a>] [<a style="color: #4f6371; text-decoration: none" href="http://www.codepub.com/software/view-software-1309.html" target="_blank">源码网</a>] [<a style="color: #4f6371; text-decoration: none" href="http://www.2ky.cn/d/128/4613.html" target="_blank">共享世纪</a>]<br />　　[<a style="color: #4f6371; text-decoration: none" href="http://download.it168.com/79/91/7898/index.shtml" target="_blank">IT168下载</a>] [<a style="color: #4f6371; text-decoration: none" href="http://act.it.sohu.com/down/softInfo.php?id=41626" target="_blank">搜狐下载频道</a>] [<a style="color: #4f6371; text-decoration: none" href="http://dl.pconline.com.cn/html_2/1/98/id=41124&amp;pn=0.html" target="_blank">太平洋下载中心</a>] [<a style="color: #4f6371; text-decoration: none" href="http://www.mumayi.com/downinfo/9822.html" target="_blank">木蚂蚁下载</a>] [<a style="color: #4f6371; text-decoration: none" href="http://www.hjdown.cn/downinfo/9674.html" target="_blank">汉江软件园</a>] [<a style="color: #4f6371; text-decoration: none" href="http://www.xuncode.com/soft/3612.html" target="_blank">寻源码</a>] [<a style="color: #4f6371; text-decoration: none" href="http://www.softhy.net/soft/19409.htm" target="_blank">洪越源代码</a>] [<a style="color: #4f6371; text-decoration: none" href="http://code.cnzz.cc/5255.html" target="_blank">中国站长之家</a>]<br /><br />　　<a style="color: #4f6371; text-decoration: none" href="http://blog.tianya.cn/blogger/view_blog.asp?BlogID=372599&amp;CategoryID=351008&amp;idWriter=0&amp;Key=0" target="_blank">老版本下载&gt;&gt;&gt;</a><br />　　<br />　　<strong>软件简介：</strong><br />　　APMServ 5.2.6 是一款拥有图形界面的快速搭建Apache 2.2.9、PHP 5.2.6、MySQL 5.1.28＆4.0.26、Nginx 0.7.19、Memcached 1.2.4、phpMyAdmin 2.11.9.2、OpenSSL、SQLite、ZendOptimizer，以及ASP、CGI、Perl网站服务器平台的绿色软件。无需安装，具有灵活的移动性，将其拷贝到其它目录、分区或别的电脑时，均只需点击APMServ.exe中的启动按钮，即可自动进行相关设置，将Apache和MySQL安装为系统服务并启动。APMServ集合了Apache稳定安全的优点，并拥有跟IIS一样便捷的图形管理界面，同时支持MySQL 5.0 &amp; 4.0两个版本，虚拟主机、虚拟目录、端口更改、SMTP、上传大小限制、自动全局变量、SSL证书制作、缓存性能优化等设置，只需鼠标一点即可完成。<br /><br />　　1、注意事项：APMServ程序所在路径不能含有汉字和空格。<br />　　2、MySQL默认用户名：root，密码为空<br />　　3、MySQL数据库文件存放目录：MySQL5.1&#92;data或MySQL4.0&#92;data<br />　　4、网站根目录[HTML,PHP]www&#92;htdocs [ASP]www&#92;asp [CGI,Perl]www&#92;cgi-bin<br />　　5、访问本机请用<a style="color: #4f6371; text-decoration: none" href="http://127.0.0.1/" target="_blank">http://127.0.0.1/</a>或<a style="color: #4f6371; text-decoration: none" href="https://127.0.0.1/" target="_blank">https://127.0.0.1/</a><span class="Apple-converted-space">&nbsp;</span>(如果开启SSL)<br />　　6、非默认端口，网址为<a style="color: #4f6371; text-decoration: none" href="http://127.0.0.1/" target="_blank">http://127.0.0.1:</a>端口/或<a style="color: #4f6371; text-decoration: none" href="https://127.0.0.1/" target="_blank">https://127.0.0.1:</a>端口/<br />　　7、如果在&ldquo;扩展功能&rdquo;中选择使用Memcached，它的端口为：11211<br />　　8、APMServ集成了以下软件：<br /><br />　　Apache 2.2.9 【HTTP服务器】<br />　　Nginx 0.7.19 【HTTP服务器】<br />　　NetBox 2.8 Build 4128 【HTTP服务器＋ASP脚本解释引擎】<br />　　PHP 5.2.6 【PHP脚本解释引擎】<br />　　MiniPerl 5.8 【Perl脚本解释器】<br />　　Memcached 1.2.4 【key-value内存缓存系统】<br />　　MySQL 5.1.28 【MySQL数据库服务器】<br />　　MySQL 4.0.26 【MySQL数据库服务器】<br />　　phpMyAdmin 2.11.9.2 【MySQL数据库在线管理工具】<br />　　eAccelerator 0.9.5.3 【PHP脚本加速引擎】<br />　　ZendOptimizer 3.3.3 【PHP脚本加速引擎】<br />　　OpenSSL 0.9.8h 【HTTPS(SSL)安全传输协议】<br /><br />　　<strong>附加组件：</strong><br />　　㈠Perl、CGI支持（需下载ActivePerl）：<br />　　APMServ 5.2.6 附带的是MiniPerl，可以运行简单的Perl、CGI程序。如果运行复杂的Perl、CGI程序，请下载ActivePerl，安装在APMServ所在分区根目录下的usr目录中。假如APMServ所在目录为E:&#92;APMServ5.2.6，则将ActivePerl的安装路径选为E:&#92;usr<br />　　ActivePerl 5.8.8.819 for Windows 下载地址：[<a style="color: #4f6371; text-decoration: none" href="http://www.onlinedown.net/soft/8364.htm" target="_blank">华军软件园</a>] [<a style="color: #4f6371; text-decoration: none" href="http://down.chinaz.com/s/4832.asp" target="_blank">中国站长站</a>]<br /><br />　　<strong>注意事项：</strong><br />　　迅雷、Skype、PPLive、BT等软件启动后默认会占用80端口，导致Apache无法启动。解决方法：先关闭这些软件，启动完APMServ之后，再开启这些软件。<br /><br />　　<strong>已知BUG修正：</strong><br />　　1、无法启动Nginx的BUG修正方法<br />　　<a style="color: #4f6371; text-decoration: none" href="http://www.unixsns.com/space.php?uid=1&amp;do=thread&amp;id=51" target="_blank">http://www.unixsns.com/space.php?uid=1&amp;do=thread&amp;id=51</a><br /><br />　　<strong>使用教程（非官方）：</strong><br />　　●<span class="Apple-converted-space">&nbsp;</span><a style="color: #4f6371; text-decoration: none" href="http://edu.cnzz.cc/Server/web/4190.html" target="_blank">用APMServ一键快速搭建Apache+PHP+MySQL+Nginx+Memcached+ASP运行平台</a><br /><br />　　<strong>软件截图：</strong><br />　　㈠主界面：<br />　　<a style="color: #4f6371; text-decoration: none" href="http://blog.s135.com/apmserv/images/5.2.6/apmserv.png" target="_blank"><img class="insertimage" src="http://blog.s135.com/apmserv/images/5.2.6/apmserv.png" border="0" alt="点击在新窗口中浏览此图片" title="点击在新窗口中浏览此图片" width="606" height="454" /></a><br /><a style="color: #4f6371; text-decoration: none" name="entrymore"></a><br />　　㈡虚拟主机设置界面：<br />　　<a style="color: #4f6371; text-decoration: none" href="http://blog.s135.com/apmserv/images/5.2.6/apmserv_vhost.png" target="_blank"><img class="insertimage" src="http://blog.s135.com/apmserv/images/5.2.6/apmserv_vhost.png" border="0" alt="点击在新窗口中浏览此图片" title="点击在新窗口中浏览此图片" width="578" height="362" /></a><br /><br />&nbsp;&nbsp;&nbsp; 原文链接：<a style="color: #4f6371; text-decoration: none" href="http://blog.s135.com/apmserv_v526/" target="_blank">http://blog.s135.com/apmserv_v526/</a></span></span><br/>Tags - <a href="http://my.clicknow.cn/go.php/tags/apmserv/" rel="tag">apmserv</a> , <a href="http://my.clicknow.cn/go.php/tags/nginx/" rel="tag">nginx</a> , <a href="http://my.clicknow.cn/go.php/tags/apache/" rel="tag">apache</a> , <a href="http://my.clicknow.cn/go.php/tags/php/" rel="tag">php</a> , <a href="http://my.clicknow.cn/go.php/tags/mysql/" rel="tag">mysql</a>
]]>
</description>
</item><item>
<link>http://my.clicknow.cn/read.php/37.htm</link>
<title><![CDATA[服务器防火墙软件BlackICE的安装和设置图文教程]]></title> 
<author>点击生活 &lt;&gt;</author>
<category><![CDATA[服务器]]></category>
<pubDate>Tue, 08 Jan 2008 12:34:31 +0000</pubDate> 
<guid>http://my.clicknow.cn/read.php/37.htm</guid> 
<description>
<![CDATA[ 
	使用比较普遍的服务器防火墙软件BlackICE的安装和设置图文教程<br/><br/>ISS的BlackICE防火墙应用的还是比较多的，我想有服务器的朋友很多都装有这个软件做防火墙的吧。<br/>这款防火墙还是比较人性化的，安装和设置应该来说还是比较简单的，应落伍的几个朋友要求就写个图文教程吧，高手就不用看了，也表笑话~仅供新手参考！<br/><br/>转载请保留作者信息:小勤 <br/><br/><a href="http://www.chinahtml.com/d/file/systems/4/2005-10-17/b886ce3c946f470682047cf438b2d45b.gif" target="_blank"><img src="http://www.chinahtml.com/d/file/systems/4/2005-10-17/b886ce3c946f470682047cf438b2d45b.gif" class="insertimage" alt="点击在新窗口中浏览此图片" title="点击在新窗口中浏览此图片" border="0"/></a><br/>截止05.9.24目前BlackICE的最新版本为3.6.COM，你可以到官方http://www.iss.net 下载最新的官方正式版本，不过是英文版本的，当然也不包含注册码，非凡软件上有完整3.6.COO版本的下载（当然并不是最新的，不过只是3.6.X上的差别，可以安装后自行升级的），包含了汉化和注册码生成器keygen.exe(当然如果你用于商业途径或者需要比较好的服务支持,建议支持软件开发者购买正版,谢谢)<br/><br/>BlackICE PC Server v3.6 coo软件下载：http://www.chinahtml.com/software/14/2005/BlackICE-PC-Protection-1128482747246.shtml<br/><br/>QUOTE: 该软件在九九年获得了PC Magazine 的技术卓越大奖，专家对它的评语是：“对于没有防火墙的家庭用户来说，BlackICE是一道不可缺少的防线；而对于企业网络，它又增加了一层保护措施--它并不是要取代防火墙，而是阻止企图穿过防火墙的入侵者。BlackICE集成有非常强大的检测和分析引擎，可以识别 200 多种入侵技巧，给你全面的网络检测以及系统防护，它还能即时监测网络端口和协议，拦截所有可疑的网络入侵，无论黑客如何费尽心机也无法危害到你的系统。而且它还可以将查明那些试图入侵的黑客的NetBIOS(WINS)名、DNS名或是他目前所使用的IP地址记录下来，以便你采取进一步行动。封言用过后感觉，该软件的灵敏度和准确率非常高，稳定性也相当出色，系统资源占用率极少，是每一位上网朋友的最佳选择。1.下载回来BlackICE36coo-ser.rar的解压后得到安装程序BISPSetup.exe和注册码生成器keygen.exe<br/>2.运行BISPSetup.exe，按提示NextL>下一步即可，<br/><br/><a href="http://www.chinahtml.com/d/file/systems/4/2005-10-17/eafd1891ab2ddc26ac1817d498ea2a1a.gif" target="_blank"><img src="http://www.chinahtml.com/d/file/systems/4/2005-10-17/eafd1891ab2ddc26ac1817d498ea2a1a.gif" class="insertimage" alt="点击在新窗口中浏览此图片" title="点击在新窗口中浏览此图片" border="0"/></a><br/><a href="http://www.chinahtml.com/d/file/systems/4/2005-10-17/51d65381fc57daaa6bb6dc4b78bde9d9.gif" target="_blank"><img src="http://www.chinahtml.com/d/file/systems/4/2005-10-17/51d65381fc57daaa6bb6dc4b78bde9d9.gif" class="insertimage" alt="点击在新窗口中浏览此图片" title="点击在新窗口中浏览此图片" border="0"/></a><br/><br/>然后是版权说明和安装协议之类的，当然选择I Accept>了，<br/><br/><a href="http://www.chinahtml.com/d/file/systems/4/2005-10-17/f1f6c98a295d6f6a3665634ce5ff7d6c.gif" target="_blank"><img src="http://www.chinahtml.com/d/file/systems/4/2005-10-17/f1f6c98a295d6f6a3665634ce5ff7d6c.gif" class="insertimage" alt="点击在新窗口中浏览此图片" title="点击在新窗口中浏览此图片" border="0"/></a><br/><br/>然后运行keygen.exe生成你需要的License填上后NextL>下一步<br/><br/><a href="http://www.chinahtml.com/d/file/systems/4/2005-10-17/ea8fd5cbf98318ea96a51c7a51b1dcdb.gif" target="_blank"><img src="http://www.chinahtml.com/d/file/systems/4/2005-10-17/ea8fd5cbf98318ea96a51c7a51b1dcdb.gif" class="insertimage" alt="点击在新窗口中浏览此图片" title="点击在新窗口中浏览此图片" border="0"/></a><br/><a href="http://www.chinahtml.com/d/file/systems/4/2005-10-17/8cfb5b20d4391d220b0faf07595ea079.gif" target="_blank"><img src="http://www.chinahtml.com/d/file/systems/4/2005-10-17/8cfb5b20d4391d220b0faf07595ea079.gif" class="insertimage" alt="点击在新窗口中浏览此图片" title="点击在新窗口中浏览此图片" border="0"/></a><br/><br/>再就选择安装路径，这个自己随便选吧：）确定安装路径后NextL>下一步,<br/><br/><a href="http://www.chinahtml.com/d/file/systems/4/2005-10-17/3cb6d1f9b7930df90372b67e36da8d42.gif" target="_blank"><img src="http://www.chinahtml.com/d/file/systems/4/2005-10-17/3cb6d1f9b7930df90372b67e36da8d42.gif" class="insertimage" alt="点击在新窗口中浏览此图片" title="点击在新窗口中浏览此图片" border="0"/></a><br/><br/>选择程序文件夹NextL>下一步,<br/><br/><a href="http://www.chinahtml.com/d/file/systems/4/2005-10-17/b39124cf5679198c2c64b956f6914cde.gif" target="_blank"><img src="http://www.chinahtml.com/d/file/systems/4/2005-10-17/b39124cf5679198c2c64b956f6914cde.gif" class="insertimage" alt="点击在新窗口中浏览此图片" title="点击在新窗口中浏览此图片" border="0"/></a><br/><br/>稍侯一会儿程序会让你选择AP应用程序的防护设置开关,<br/><br/><a href="http://www.chinahtml.com/d/file/systems/4/2005-10-17/36765f828d9d3294aedde015139886b6.gif" target="_blank"><img src="http://www.chinahtml.com/d/file/systems/4/2005-10-17/36765f828d9d3294aedde015139886b6.gif" class="insertimage" alt="点击在新窗口中浏览此图片" title="点击在新窗口中浏览此图片" border="0"/></a><br/><br/>如果你是远程管理你的服务器切记选AP Off(原因很简单,选了AP On了就是对应用程序也进行防护,每次运行就会询问是否允许该应用程序运行,而远程运行应用程序的话,远程桌面上一般是看不到应用程序防护询问提示的,这样你没办法确定允许运行你要运行的应用程序,就会发现运行某个应用程序没反映呢,当然是本地机器运行选不选AP就随你个人喜欢了)<br/>选好了再NextL>下一步就会显示你当前选择的一些配置<br/><br/><a href="http://www.chinahtml.com/d/file/systems/4/2005-10-17/76d91a31079a99acba6cb074ccc7e2ec.gif" target="_blank"><img src="http://www.chinahtml.com/d/file/systems/4/2005-10-17/76d91a31079a99acba6cb074ccc7e2ec.gif" class="insertimage" alt="点击在新窗口中浏览此图片" title="点击在新窗口中浏览此图片" border="0"/></a><br/><br/>再NextL>下一步进行安装,安装还是比较快的,OK了安装结束如图,Finish完成安装即可!<br/><br/><a href="http://www.chinahtml.com/d/file/systems/4/2005-10-17/9369194c18c4c368e1293e2ec39da7eb.gif" target="_blank"><img src="http://www.chinahtml.com/d/file/systems/4/2005-10-17/9369194c18c4c368e1293e2ec39da7eb.gif" class="insertimage" alt="点击在新窗口中浏览此图片" title="点击在新窗口中浏览此图片" border="0"/></a><br/><br/>3.看下你的任务栏的托盘是不是有了个桃形的blackice图标,有的话反键最后一个项Exit退出即可,为下面汉化作准备。<br/><br/>4.接着将下载回来blackice36coo-ser-H.rar的汉化包解压后得到汉化安装程序setup.exe,运行后安装,汗居然绑定DUDU,取消掉,你喜欢的话也可以安装DUDU支持下人家汉化拉!~<br/><br/><a href="http://www.chinahtml.com/d/file/systems/4/2005-10-17/0699dbc9db5d9823fa93dd77c95e1e5a.gif" target="_blank"><img src="http://www.chinahtml.com/d/file/systems/4/2005-10-17/0699dbc9db5d9823fa93dd77c95e1e5a.gif" class="insertimage" alt="点击在新窗口中浏览此图片" title="点击在新窗口中浏览此图片" border="0"/></a><br/><a href="http://www.chinahtml.com/d/file/systems/4/2005-10-17/2b6b110e8a78836cb5c7681fa8564849.gif" target="_blank"><img src="http://www.chinahtml.com/d/file/systems/4/2005-10-17/2b6b110e8a78836cb5c7681fa8564849.gif" class="insertimage" alt="点击在新窗口中浏览此图片" title="点击在新窗口中浏览此图片" border="0"/></a><br/><br/>接着下一步再下一步选择你安装的BLACKICE的安装路径确定后下一步并确定路径后点安装,<br/><br/><a href="http://www.chinahtml.com/d/file/systems/4/2005-10-17/e39dbd5c4502a349d37f74c47edaa858.gif" target="_blank"><img src="http://www.chinahtml.com/d/file/systems/4/2005-10-17/e39dbd5c4502a349d37f74c47edaa858.gif" class="insertimage" alt="点击在新窗口中浏览此图片" title="点击在新窗口中浏览此图片" border="0"/></a><br/><a href="http://www.chinahtml.com/d/file/systems/4/2005-10-17/79c2b26c25bf6c4a2beaf0ee3c801f0c.gif" target="_blank"><img src="http://www.chinahtml.com/d/file/systems/4/2005-10-17/79c2b26c25bf6c4a2beaf0ee3c801f0c.gif" class="insertimage" alt="点击在新窗口中浏览此图片" title="点击在新窗口中浏览此图片" border="0"/></a><br/><a href="http://www.chinahtml.com/d/file/systems/4/2005-10-17/14a2735a935994c1d9d371496e6909fb.gif" target="_blank"><img src="http://www.chinahtml.com/d/file/systems/4/2005-10-17/14a2735a935994c1d9d371496e6909fb.gif" class="insertimage" alt="点击在新窗口中浏览此图片" title="点击在新窗口中浏览此图片" border="0"/></a><br/><a href="http://www.chinahtml.com/d/file/systems/4/2005-10-17/f30c65188a7c0f5cf43551798372ee7d.gif" target="_blank"><img src="http://www.chinahtml.com/d/file/systems/4/2005-10-17/f30c65188a7c0f5cf43551798372ee7d.gif" class="insertimage" alt="点击在新窗口中浏览此图片" title="点击在新窗口中浏览此图片" border="0"/></a><br/><br/>这里如果没有进行第3步退出blackice可能会提示你XX文件正在使用中,那就退出对应程序后重试就OK拉,实在不行就在任务管理器里面找到提示的运行程序结束任务后再重试吧~然后安装OK了选上运行BLACKICE(至于上网助手看你自己需要是否钩选上并安装呢)点完成即可完成汉化并运行BLACKICE防火墙软件了<br/><br/><a href="http://www.chinahtml.com/d/file/systems/4/2005-10-17/19cc00a830ebb6f5b1e8781495046740.gif" target="_blank"><img src="http://www.chinahtml.com/d/file/systems/4/2005-10-17/19cc00a830ebb6f5b1e8781495046740.gif" class="insertimage" alt="点击在新窗口中浏览此图片" title="点击在新窗口中浏览此图片" border="0"/></a><br/><br/>至此安装汉化过程全部完成并运行了汉化后的BLACKICE了<br/><br/>5.对BLACKICE防火墙进行设置<br/>双击系统任务栏的桃形的blackice图标即可打开设置界面,已经汉化后就是中文的设置菜单了,应该很明了的了。<br/><br/>工具→编辑 Black ICE设置 可以对其各项进行设置,防火墙 选项卡一般对于服务器防护级别就选第3个小心谨慎然后钩选启用拦截,如图即可,如果安装的时候不小心钩选上了AP On的可以到这里的 应用程序控制 选项卡取消 启用应用程序保护 前面的钩即可,当然你本地需要应用程序保护的也可以在这里设置,其他选项卡的各项设置一般影响不大,你根据自身的要求设置吧,一般不用设置按默认的也可以,设置OK了确定或者应用设置即可生效。<br/><br/><a href="http://www.chinahtml.com/d/file/systems/4/2005-10-17/923640801d6dcfc3ee689fcd3245d1a9.gif" target="_blank"><img src="http://www.chinahtml.com/d/file/systems/4/2005-10-17/923640801d6dcfc3ee689fcd3245d1a9.gif" class="insertimage" alt="点击在新窗口中浏览此图片" title="点击在新窗口中浏览此图片" border="0"/></a><br/><a href="http://www.chinahtml.com/d/file/systems/4/2005-10-17/adde0d47f2f256529ea12d2d2ebc87ed.gif" target="_blank"><img src="http://www.chinahtml.com/d/file/systems/4/2005-10-17/adde0d47f2f256529ea12d2d2ebc87ed.gif" class="insertimage" alt="点击在新窗口中浏览此图片" title="点击在新窗口中浏览此图片" border="0"/></a><br/><br/><br/>工具→高级防火墙设置 可以对IP/UDP/TCP的各项进行设置,一般默认会根据你的工具→编辑 Black ICE设置→防火墙里面选择的防护级别设置进行一些基本TCP/UDP端口的设置的,当然你可以编辑或者添加你要限制或者允许的的TCP/UDP端口和IP,这里就根据你的需要进行设置吧,OK了设置OK后确定或者应用设置即可生效了。<br/><br/><a href="http://www.chinahtml.com/d/file/systems/4/2005-10-17/c9afdcc2aa2d4bfb348bd7618aa0ee80.gif" target="_blank"><img src="http://www.chinahtml.com/d/file/systems/4/2005-10-17/c9afdcc2aa2d4bfb348bd7618aa0ee80.gif" class="insertimage" alt="点击在新窗口中浏览此图片" title="点击在新窗口中浏览此图片" border="0"/></a><br/><a href="http://www.chinahtml.com/d/file/systems/4/2005-10-17/74f3e67b9ef33137ab966da994aac93b.gif" target="_blank"><img src="http://www.chinahtml.com/d/file/systems/4/2005-10-17/74f3e67b9ef33137ab966da994aac93b.gif" class="insertimage" alt="点击在新窗口中浏览此图片" title="点击在新窗口中浏览此图片" border="0"/></a><br/><a href="http://www.chinahtml.com/d/file/systems/4/2005-10-17/6b706ab11153c7b2e253624696df28c5.gif" target="_blank"><img src="http://www.chinahtml.com/d/file/systems/4/2005-10-17/6b706ab11153c7b2e253624696df28c5.gif" class="insertimage" alt="点击在新窗口中浏览此图片" title="点击在新窗口中浏览此图片" border="0"/></a><br/><br/>好了至此BlackICE的安装和设置就完成了,慢慢在使用中去体会BlackICE防火墙的强大功能吧。<br/>Tags - <a href="http://my.clicknow.cn/go.php/tags/blackice/" rel="tag">blackice</a> , <a href="http://my.clicknow.cn/go.php/tags/%25E7%25BD%2591%25E7%25BB%259C%25E5%25AE%2589%25E5%2585%25A8/" rel="tag">网络安全</a> , <a href="http://my.clicknow.cn/go.php/tags/%25E6%259D%2580%25E6%25AF%2592%25E8%25BD%25AF%25E4%25BB%25B6/" rel="tag">杀毒软件</a> , <a href="http://my.clicknow.cn/go.php/tags/%25E9%2598%25B2%25E7%2581%25AB%25E5%25A2%2599/" rel="tag">防火墙</a> , <a href="http://my.clicknow.cn/go.php/tags/blackice%25E5%25AE%2589%25E8%25A3%2585/" rel="tag">blackice安装</a> , <a href="http://my.clicknow.cn/go.php/tags/blackice%25E9%2585%258D%25E7%25BD%25AE/" rel="tag">blackice配置</a> , <a href="http://my.clicknow.cn/go.php/tags/%25E9%2598%25B2%25E7%2581%25AB%25E5%25A2%2599%25E8%25AE%25BE%25E7%25BD%25AE/" rel="tag">防火墙设置</a>
]]>
</description>
</item><item>
<link>http://my.clicknow.cn/read.php/36.htm</link>
<title><![CDATA[卸载BlackICE的方法]]></title> 
<author>点击生活 &lt;&gt;</author>
<category><![CDATA[服务器]]></category>
<pubDate>Tue, 08 Jan 2008 11:34:39 +0000</pubDate> 
<guid>http://my.clicknow.cn/read.php/36.htm</guid> 
<description>
<![CDATA[ 
	在控制面板的添加/删除程序里是无法卸载该软件的，得在黑冰的安装目录中运行BIRemove.exe才可顺利卸载。<br/><br/>但卸载BlackICE（黑冰）后却遇到了启动错误提示，说是“下列引导或系统启动驱动程序无法加载：black”，虽然对服务器功能并无影响，但对眼球有影响，总是让人觉得不舒服。于是折腾了很久，查了不少资料，终于得以解决。现将处理方法提供给给需要的朋友，希望能让其他遇到同类问题困扰的朋友不再走弯路。 <br/>&nbsp;&nbsp;&nbsp;&nbsp;出现该提示是因为黑冰反删除后相关文件已经全部删除，但注册表却留下了要调用windows&#92;System32&#92;drivers&#92;BlackDrv.sys的残余项目而导致。<br/><br/>错误提示：下列引导或系统启动驱动程序无法加载: black<br/>解决方法：<br/>一、备份注册表，以免万一操作错误了回天乏术。<br/><br/>二、用regedit或其它注册表编辑工具打开注册表，找到下面项目<br/>HKEY_LOCAL_MACHINE&#92;SYSTEM&#92;CurrentControlSet&#92;Services&#92;black<br/>删除该组<br/><br/>然后在注册表中找到下面项目<br/><br/>HKEY_LOCAL_MACHINE&#92;SYSTEM&#92;CurrentControlSet&#92;Enum&#92;Root&#92;LEGACY_BLACK<br/>该项目因权限不够无法删除，默认只有system帐户有完全控制权限。所以先在该项目右键单击，让Everyone有完全控制权限后即可删除。<br/>重启系统，错误提示没有了？恭喜，大功告成。<br/><br/>Tags - <a href="http://my.clicknow.cn/go.php/tags/blackice/" rel="tag">blackice</a> , <a href="http://my.clicknow.cn/go.php/tags/%25E6%259C%258D%25E5%258A%25A1%25E5%2599%25A8/" rel="tag">服务器</a> , <a href="http://my.clicknow.cn/go.php/tags/win2003/" rel="tag">win2003</a> , <a href="http://my.clicknow.cn/go.php/tags/blackice%25E5%258D%25B8%25E8%25BD%25BD/" rel="tag">blackice卸载</a>
]]>
</description>
</item>
</channel>
</rss>