<?xml version="1.0" encoding="UTF-8"?> <rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" ><channel><title>猫言猫语 &#187; MySQL</title> <atom:link href="http://imcat.in/tag/mysql/feed/" rel="self" type="application/rss+xml" /><link>http://imcat.in</link> <description>人的头脑太复杂,时间过得久,有时候连自己也被自己骗了,记下来才是最真实的……</description> <lastBuildDate>Mon, 23 Aug 2010 13:54:00 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.0.1</generator> <item><title>删除Mysql的MySql-bin.0000X日志文件</title><link>http://imcat.in/delete-mysql-bin-0000x-mysql-log-file/</link> <comments>http://imcat.in/delete-mysql-bin-0000x-mysql-log-file/#comments</comments> <pubDate>Wed, 26 May 2010 13:32:09 +0000</pubDate> <dc:creator>Cat.</dc:creator> <category><![CDATA[Linux]]></category> <category><![CDATA[MySQL]]></category> <category><![CDATA[MySql-bin.0000]]></category><guid isPermaLink="false">http://imcat.in/?p=1290</guid> <description><![CDATA[装mysql,运行一段时间后，在mysql目录下出现一堆类似 mysql-bin.000***，从mysql-bin.000001开始一直排列下来，而且占用了大量硬盘空间，高达几十个G.  对于这些超大空间 占用量的文件我们应该怎么办呢? 我的数据库加起来大概100M吧..但/usr/local/mysql/var这个目录竟然有548M,MySql-bin.0000文件大概占 了400+M,真浪费空间啊 那么mysql数据库文件夹中的mysql-bin.00001是什么文件？ mysql-bin.000001、mysql- bin.000002等文件是数据库的操作日志，例如UPDATE一个表，或者DELETE一些数据，即使该语句没有匹配的数据，这个命令也会存储到日志 文件中，还包括每个语句执行的时间，也会记录进去的。 那么这些文件该怎么删除和禁止呢? 禁止方法: vi /etc/my.cnf把里面的 #log-bin=mysql-bin #binlog_format=mixed 注释掉,重启mysql服务即可. 删除方法: 输入命令: /usr/local/mysql/bin/mysql -u root -p 输入密码登陆mysql后,运行命令: reset master; (包括;号) 清空日志文件.再查看Mysql文件的大小,已经小了很多了. -bash-3.2# du -h –max-depth=1 /usr/local/mysql/var du: cannot access `250Cmax-depth=1': No such file or directory 142M    /usr/local/mysql/var]]></description> <content:encoded><![CDATA[<p>装mysql,运行一段时间后，在mysql目录下出现一堆类似  mysql-bin.000***，从mysql-bin.000001开始一直排列下来，而且占用了大量硬盘空间，高达几十个G.  对于这些超大空间  占用量的文件我们应该怎么办呢?<br /> <a title="mysql" rel="gallery-1290" href="http://imcat.in/wp-content/uploads/2010/05/mysql.jpg" target="_blank"><img title="mysql" src="http://imcat.in/wp-content/uploads/2010/05/mysql.jpg" alt="mysql  删除Mysql的MySql bin.0000X日志文件" width="231" height="289" /></a></p><p>我的数据库加起来大概100M吧..但/usr/local/mysql/var这个目录竟然有548M,MySql-bin.0000文件大概占 了400+M,真浪费空间啊<br /> <span id="more-1290"></span><br /> <strong>那么mysql数据库文件夹中的mysql-bin.00001是什么文件？</strong></p><blockquote><p>mysql-bin.000001、mysql-  bin.000002等文件是数据库的操作日志，例如UPDATE一个表，或者DELETE一些数据，即使该语句没有匹配的数据，这个命令也会存储到日志  文件中，还包括每个语句执行的时间，也会记录进去的。</p></blockquote><p><strong>那么这些文件该怎么删除和禁止呢?</strong><br /> 禁止方法: vi /etc/my.cnf把里面的<br /> #log-bin=mysql-bin<br /> #binlog_format=mixed<br /> 注释掉,重启mysql服务即可.</p><p>删除方法:</p><p>输入命令:</p><div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">/usr/local/mysql/bin/mysql -u root -p</div></div><p><a title="mysql1" rel="gallery-1290" href="http://imcat.in/wp-content/uploads/2010/05/mysql1.jpg" target="_blank"><img title="mysql1" src="http://imcat.in/wp-content/uploads/2010/05/mysql1.jpg" alt="mysql1  删除Mysql的MySql bin.0000X日志文件" width="394" height="47" /></a></p><p>输入密码登陆mysql后,运行命令:</p><div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">reset master;</div></div><p>(包括;号)</p><p>清空日志文件.再查看Mysql文件的大小,已经小了很多了.</p><p>-bash-3.2# du -h –max-depth=1 /usr/local/mysql/var<br /> du: cannot access `250Cmax-depth=1': No such file or directory<br /> 142M    /usr/local/mysql/var</p> ]]></content:encoded> <wfw:commentRss>http://imcat.in/delete-mysql-bin-0000x-mysql-log-file/feed/</wfw:commentRss> <slash:comments>2</slash:comments> </item> <item><title>19条 WordPress 实用的 SQL 查询语句</title><link>http://imcat.in/wordpress-sql-query-hacks/</link> <comments>http://imcat.in/wordpress-sql-query-hacks/#comments</comments> <pubDate>Fri, 14 May 2010 07:29:19 +0000</pubDate> <dc:creator>Cat.</dc:creator> <category><![CDATA[WordPress]]></category> <category><![CDATA[MySQL]]></category><guid isPermaLink="false">http://imcat.in/?p=1285</guid> <description><![CDATA[不要轻易就直接执行SQL语句来折腾你的数据库。但有的时候，使用SQL可以大大提高你的办事效率，或者有的时候，你不得不用SQL来改变一些东 西；比如，WordPress的默认账户名称“admin”，由于这个账户使用过于广泛，日夜总是让你觉得提心吊胆的，于是就萌生了一定要把 “admin”这几个字换成其它的；比如，你想收集所有留言者的邮箱地址来实现你的垃圾营销目的，比如我想把站内所有含链接的留言完全删掉！ 本文为大家介绍19条 WordPress 实用的 SQL 查询语句，某天你可能就会用到。 使用方法： 进入你主机的phpmyadmin，选择你的WordPress数据，点击SQL选项卡，在文本框中输入SQL查询语句，执行！ 高度注意： 在每次执行SQL语句前，请勿必备份你的WordPress数据库。 1. 删除所有未使用的标签 &#60;code&#62;DELETE a,b,c FROM wp_terms AS a LEFT JOIN wp_term_taxonomy AS c ON a.term_id = c.term_id LEFT JOIN wp_term_relationships AS b ON b.term_taxonomy_id = c.term_taxonomy_id WHERE c.taxonomy = 'post_tag' AND c.count = 0 2. 删除所有文章修订版本(Revisions)以及它们的Meta数据 &#60;code&#62;DELETE a,b,c FROM wp_posts a LEFT JOIN [...]]]></description> <content:encoded><![CDATA[<p>不要轻易就直接执行SQL语句来折腾你的数据库。但有的时候，使用SQL可以大大提高你的办事效率，或者有的时候，你不得不用SQL来改变一些东  西；比如，WordPress的默认账户名称“admin”，由于这个账户使用过于广泛，日夜总是让你觉得提心吊胆的，于是就萌生了一定要把  “admin”这几个字换成其它的；比如，你想收集所有留言者的邮箱地址来实现你的垃圾营销目的，比如我想把站内所有含链接的留言完全删掉！</p><p>本文为大家介绍19条 WordPress 实用的  SQL 查询语句，某天你可能就会用到。</p><p><strong>使用方法：</strong></p><p>进入你主机的phpmyadmin，选择你的WordPress数据，点击SQL选项卡，在文本框中输入SQL查询语句，执行！</p><p><strong>高度注意：</strong></p><p>在每次执行SQL语句前，请<strong>勿必备份你的WordPress数据库</strong>。</p><h3>1. 删除所有未使用的标签</h3><p><span id="more-1285"></span></p><div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&lt;code&gt;DELETE a,b,c<br /> FROM wp_terms AS a<br /> LEFT JOIN wp_term_taxonomy AS c ON a.term_id = c.term_id<br /> LEFT JOIN wp_term_relationships AS b ON b.term_taxonomy_id = c.term_taxonomy_id<br /> WHERE c.taxonomy = 'post_tag' AND c.count = 0</div></div><p></code></p><h3>2. 删除所有文章修订版本(Revisions)以及它们的Meta数据</h3><div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&lt;code&gt;DELETE a,b,c<br /> FROM wp_posts a<br /> LEFT JOIN wp_term_relationships b ON (a.ID = b.object_id)<br /> LEFT JOIN wp_postmeta c ON (a.ID = c.post_id)<br /> WHERE a.post_type = 'revision'</div></div><p></code></p><h3>3. 更改WordPress地址和首页地址</h3><div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&lt;code&gt;UPDATE wp_options<br /> SET option_value = replace(option_value, 'http://www.旧网址.com', 'http://www.新网址.com')<br /> WHERE option_name = 'home' OR option_name = 'siteurl'</div></div><p></code></p><h3>4. 更改文章的GUID</h3><div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&lt;code&gt;UPDATE wp_posts<br /> SET guid = REPLACE (guid, 'http://www.旧网址.com', 'http://www.新网址.com')</div></div><p></code></p><h3>5. 更改正文中的链接地址</h3><div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&lt;code&gt;UPDATE wp_posts<br /> SET post_content = REPLACE (post_content, 'http://www.旧网址.com', 'http://www.新网址.com')</div></div><p></code></p><h3>6. 更新文章的Meta值</h3><div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&lt;code&gt;UPDATE wp_postmeta<br /> SET meta_value = REPLACE (meta_value, 'http://www.旧网址.com', 'http://www.新网址.com'</div></div><p></code></p><h3>7. 重设Admin密码</h3><div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&lt;code&gt;UPDATE wp_users<br /> SET user_pass = MD5( 'new_password' )<br /> WHERE user_login = 'admin'</div></div><p></code></p><h3>8. 重设admin的用户名</h3><div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&lt;code&gt;UPDATE wp_users<br /> SET user_login = 'newname'<br /> WHERE user_login = 'admin'</div></div><p></code></p><h3>9. 将作者a的文章全部转移到作者b</h3><div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&lt;code&gt;UPDATE wp_posts<br /> SET post_author = 'b'<br /> WHERE post_author = 'a'</div></div><p></code></p><h3>10. 删除文章的meta标签</h3><div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&lt;code&gt;DELETE FROM wp_postmeta<br /> WHERE meta_key = 'your-meta-key'</div></div><p></code></p><h3>11. 导出所有评论中的邮件地址</h3><div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&lt;code&gt;SELECT DISTINCT comment_author_email<br /> FROM wp_comments</div></div><p></code></p><h3>12. 删除所有的Pingback</h3><div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&lt;code&gt;DELETE FROM wp_comments<br /> WHERE comment_type = 'pingback'</div></div><p></code></p><h3>13. 删除所有的垃圾评论</h3><div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&lt;code&gt;DELETE FROM wp_comments<br /> WHERE comment_approved = 'spam'</div></div><p></code></p><h3>14. 禁用所有激活的插件</h3><div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&lt;code&gt;UPDATE wp_options<br /> SET option_value = ''<br /> WHERE option_name = 'active_plugins'</div></div><p></code></p><h3>15. 罗列所有未使用的Meta标签</h3><div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&lt;code&gt;SELECT *<br /> FROM wp_postmeta pm<br /> LEFT JOIN wp_posts wp ON wp.ID = pm.post_id<br /> WHERE &nbsp;wp.ID IS NULL</div></div><p></code></p><h3>16. 关闭旧文章的留言</h3><div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&lt;code&gt;UPDATE wp_posts<br /> SET comment_status = 'closed'<br /> WHERE post_date &amp;lt; '2009-01-01' AND post_status = 'publish'</div></div><p></code></p><h3>17. 更新留言者的网址</h3><div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&lt;code&gt;UPDATE wp_comments<br /> SET comment_author_url = REPLACE( comment_author_url, 'http://旧网址.com', 'http://新网址.com' )</div></div><p></code></p><h3>18. 更新正文内所有的’target=”_blank”‘为’rel=”nofollow”‘</h3><div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&lt;code&gt;UPDATE wp_posts<br /> SET post_content = REPLACE (post_content, 'target=&quot;_blank', &nbsp;'rel=&quot;nofollow')</div></div><p></code></p><h3>19. 删除所有含链接的留言</h3><div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&lt;code&gt;DELETE FROM wp_comments<br /> WHERE comment_content LIKE &quot;%&amp;lt;a href=%&quot; AND comment_type = ''</div></div><p></code></p><h4>参考文章:</h4><ul><li><a href="http://www.onextrapixel.com/2010/01/30/13-useful-wordpress-sql-queries-you-wish-you-knew-earlier/" target="_blank">13   Useful WordPress SQL Queries You Wish You Knew   Earlier</a></li><li><a href="http://www.catswhocode.com/blog/wordpress-10-life-saving-sql-queries" target="_blank">WordPress  : 10+ life saving SQL queries</a></li></ul><p>来源:<strong><a href="http://www.iwanna.cn/archives/2010/05/12/3089/" target="_blank">19条  WordPress 实用的  SQL 查询语句</a></strong></p> ]]></content:encoded> <wfw:commentRss>http://imcat.in/wordpress-sql-query-hacks/feed/</wfw:commentRss> <slash:comments>1</slash:comments> </item> <item><title>14 条实用的 MySQL 查询语句</title><link>http://imcat.in/14-useful-mysql-query/</link> <comments>http://imcat.in/14-useful-mysql-query/#comments</comments> <pubDate>Tue, 04 May 2010 03:31:08 +0000</pubDate> <dc:creator>Cat.</dc:creator> <category><![CDATA[WordPress]]></category> <category><![CDATA[MySQL]]></category><guid isPermaLink="false">http://imcat.in/14-%e6%9d%a1%e5%ae%9e%e7%94%a8%e7%9a%84-mysql-%e6%9f%a5%e8%af%a2%e8%af%ad%e5%8f%a5/</guid> <description><![CDATA[在使用 WordPress 的过程中，某些时候需要修正一些数据库方面的问题。相比之下，直接在数据库中执行查询语句是最便捷的。在这里，提供了 14 条非常实用的查询语句，可以帮助遇到类似问题的用户解决相应的问题。 如何执行 MySQL 查询语句 通常情况下，我们可以直接进入服务器的 MySQL 命令行中执行。也可以使用非常著名的 WEB 程序 PHPMyAdmin 进行查询。如果我们想在 WordPress 后台直接进行查询，还可以使用 SQL Executionner 这个插件对数据库进行操作。 注意：虽然以下提供的查询语句都已经经过测试。但是请不要直接在生产环境下运行，或者经过一定的测试再执行，毕竟每个人的站点环境 可能略有不同。操作之前切记要对数据库进行备份操作。 1. 手动修改密码 某些情况下，我们忘记了管理员的密码。或者站点遭受攻击后，管理员密码被恶意修改了。这个时候，我们能做的就只有重新设置管理员的密码了。 以下查询语句，使用 MySQL 的 MD5() 函数将我们的密码进行 MD5 加密。 UPDATE 'wp_users' SET 'user_pass' = MD5('PASSWORD') WHERE 'user_login' ='admin' LIMIT 1; 来源：http://www.wprecipes.com/how-to-manually-reset-your-wordpress- password 2. 批量转换日式的作者 大多数刚使用 WordPress 的人可能都是直接使用 “admin”这个用户来直接发布日志。等您新建一个用户后，如果想将原来日志的作者批量修改为新用户的时候，可以使用以下查询语句。 在执行之前，您需要知道老用户和新用户的用户 ID。 UPDATE wp_posts [...]]]></description> <content:encoded><![CDATA[<p>在使用 WordPress 的过程中，某些时候需要修正一些数据库方面的问题。相比之下，直接在数据库中执行查询语句是最便捷的。在这里，提供了   14 条非常实用的查询语句，可以帮助遇到类似问题的用户解决相应的问题。</p><h3><strong>如何执行 MySQL 查询语句</strong></h3><p>通常情况下，我们可以直接进入服务器的 MySQL 命令行中执行。也可以使用非常著名的 WEB 程序 PHPMyAdmin   进行查询。如果我们想在 WordPress 后台直接进行查询，还可以使用 <a href="http://justinsomnia.org/2008/02/the-wordpress-sql-executioner/" target="_blank">SQL    Executionner</a> 这个插件对数据库进行操作。</p><p><strong>注意：虽然以下提供的查询语句都已经经过测试。但是请不要直接在生产环境下运行，或者经过一定的测试再执行，毕竟每个人的站点环境  可能略有不同。操作之前切记要对数据库进行备份操作。</strong></p><h3><strong>1. 手动修改密码</strong></h3><p>某些情况下，我们忘记了管理员的密码。或者站点遭受攻击后，管理员密码被恶意修改了。这个时候，我们能做的就只有重新设置管理员的密码了。<br /> <span id="more-1284"></span><br /> 以下查询语句，使用 MySQL 的 MD5() 函数将我们的密码进行 MD5 加密。</p><div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">UPDATE 'wp_users' SET 'user_pass' = MD5('PASSWORD') WHERE 'user_login' ='admin' LIMIT 1;</div></div><p>来源：<a href="http://www.wprecipes.com/how-to-manually-reset-your-wordpress-%20password" target="_blank">http://www.wprecipes.com/how-to-manually-reset-your-wordpress-  password</a></p><h3><strong>2. 批量转换日式的作者</strong></h3><p>大多数刚使用 WordPress 的人可能都是直接使用   “admin”这个用户来直接发布日志。等您新建一个用户后，如果想将原来日志的作者批量修改为新用户的时候，可以使用以下查询语句。</p><p>在执行之前，您需要知道老用户和新用户的用户 ID。</p><div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">UPDATE wp_posts SET post_author=NEW_AUTHOR_ID WHERE post_author=OLD_AUTHOR_ID;</div></div><p>来源：<a href="http://www.wprecipes.com/how-to-change-author-attribution-on-all-%20posts-at-once" target="_blank">http://www.wprecipes.com/how-to-change-author-attribution-on-all-  posts-at-once</a></p><h3><strong>3. 删除日志修订版本和其相关的信息</strong></h3><p>日志的修订版本功能在多用户共同维护一个博客的时候非常有用。不过该功能在数据库中添加过多的记录数也是很让人恼火的。</p><p>执行以下语句，可以将数据库中的日志修订版本记录以及其中的其他信息（包括自定义区域等等）删除掉。执行后，会节省很多数据库空间。</p><div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">DELETE a,b,c FROM wp_posts a WHERE a.post_type = 'revision' LEFT JOIN wp_term_relationships b ON (a.ID = b.object_id) LEFT JOIN wp_postmeta c ON (a.ID = c.post_id);</div></div><p>来源：<a href="http://www.onextrapixel.com/2010/01/30/13-useful-wordpress-sql-%20queries-you-wish-you-knew-earlier/" target="_blank">http://www.onextrapixel.com/2010/01/30/13-useful-wordpress-sql-  queries-you-wish-you-knew-earlier/</a></p><h3><strong>4. 批量删除垃圾评论</strong></h3><p>在您的博客没有安装 Akismet   或其他替代品的前提下，一段时间没有进入后台进行评论审核。可能会出现几百甚至上千条未审核的评论。而且大部分可能是垃圾评论。这个时候，如果您在后台进  行删除，可能会浪费掉您很多时间。以下语句可以在数据库中批量删除掉所有未审核的评论。</p><p>奉劝一句，还是安装 Akismet 或类似的插件吧，可以省却您很多烦恼。</p><div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">DELETE from wp_comments WHERE comment_approved = '0';</div></div><p>来源：<a href="http://www.wprecipes.com/mark-asked-how-to-batch-deleting-spam-%20comments-on-a-wordpress-blog" target="_blank">http://www.wprecipes.com/mark-asked-how-to-batch-deleting-spam-  comments-on-a-wordpress-blog</a></p><h3><strong>5. 查找未使用的标签</strong></h3><p>标签的记录是存放在 wp_terms   这个数据表中的。有时，可能部分标签创建了但是没有被使用，他们仍然会在数据表中。以下语句可以对这些未使用的标签进行查询，您可以安全的将其删除。</p><div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">SELECT * From wp_terms wt INNER JOIN wp_term_taxonomy wtt ON wt.term_id=wtt.term_id WHERE wtt.taxonomy='post_tag' AND wtt.count=0;</div></div><p>来源：<a href="http://www.onextrapixel.com/2010/01/30/13-useful-wordpress-sql-%20queries-you-wish-you-knew-earlier/" target="_blank">http://www.onextrapixel.com/2010/01/30/13-useful-wordpress-sql-  queries-you-wish-you-knew-earlier/</a></p><h3><strong>6. 查找并替换数据</strong></h3><p>该语句不光是在 WordPress 的使用过程中能用到。您可以在很多地方用到该 MySQL 查询语句。其使用 MySQL 的   replace() 函数将一段字符串替换成您指定的另一段字符串。</p><div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">UPDATE table_name SET field_name = replace( field_name, 'string_to_find', 'string_to_replace' ) ;</div></div><p>来源：<a href="http://perishablepress.com/press/2007/07/25/mysql-magic-find-and-%20replace-data/" target="_blank">http://perishablepress.com/press/2007/07/25/mysql-magic-find-and-  replace-data/</a></p><h3><strong>7. 获得发表评论访问者的电子邮箱地址列表</strong></h3><p>该语句可以返回一个在您博客上进行评论的用户的电子邮箱地址列表。语句中的 <em>DISTINCT</em> 参数用来保证每个电子邮箱地址只显示一次。</p><div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">SELECT DISTINCT comment_author_email FROM wp_comments;</div></div><p>来源：<a href="http://www.onextrapixel.com/2010/01/30/13-useful-wordpress-sql-%20queries-you-wish-you-knew-earlier/" target="_blank">http://www.onextrapixel.com/2010/01/30/13-useful-wordpress-sql-  queries-you-wish-you-knew-earlier/</a></p><h3><strong>8. 一次性禁用掉所有插件</strong></h3><p>虽然新版的 WordPress   已经可以直接在后台对插件进行批量的启用和禁用操作。但是当某些插件引起整个站点不能正常访问的时候，我们就可以使用以下语句禁用掉站点内所有的插件，然  后再进入到 WordPress 后台进行调试操作。</p><div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">UPDATE wp_options SET option_value = '' WHERE option_name = 'active_plugins';</div></div><p>来源：<a href="http://www.wprecipes.com/how-to-disable-all-your-plugins-in-a-%20second" target="_blank">http://www.wprecipes.com/how-to-disable-all-your-plugins-in-a-  second</a></p><h3><strong>9. 删除所有标签</strong></h3><p>标签的信息是存放在 wp_terms   数据表中的。而且，是和分类以及其他一些信息存放在相同一个表中。如果您想删除所有的标签记录，是无法简单的清空 wp_terms   这个数据表的。这会导致分类信息丢失。</p><p>执行以下语句，可以仅仅删除掉标签记录以及与日志的关联信息，而其他的分类等信息不会发生改变。</p><div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">DELETE a,b,c<br /> FROM<br /> &nbsp; &nbsp; database.prefix_terms AS a<br /> &nbsp; &nbsp; LEFT JOIN database.prefix_term_taxonomy AS c ON a.term_id = c.term_id<br /> &nbsp; &nbsp; LEFT JOIN database.prefix_term_relationships AS b ON b.term_taxonomy_id = c.term_taxonomy_id<br /> WHERE (<br /> &nbsp; &nbsp; c.taxonomy = 'post_tag' AND<br /> &nbsp; &nbsp; c.count = 0<br /> &nbsp; &nbsp; );</div></div><p>来源：http://wordpress.org/support/topic/311665</p><h3><strong>10. 列举无用的日志信息</strong></h3><p>日志的 Meta 信息通常是由插件或自定义区域建立的。它们非常实用，但也会让您的数据库尺寸快速的变得臃肿。以下语句会显示 postmeta   表中那些没有在 post 表有对应关系的记录，便于您对数据库进行清理。</p><div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">SELECT * FROM wp_postmeta pm LEFT JOIN wp_posts wp ON wp.ID = pm.post_id WHERE wp.ID IS NULL;</div></div><p>来源：http://wordpress.org/support/topic/337412</p><h3><strong>11. 禁用老日志的评论功能</strong></h3><p>某些时候，您希望把以前的日志评论功能关闭掉。可能导致您这么作出决定的原因有很多，您可以使用以下语句将指定日期之前发布的日志评论功能关闭掉。</p><div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">UPDATE wp_posts SET comment_status = 'closed' WHERE post_date &amp;lt; '2009-01-01' AND post_status = 'publish';</div></div><p>来源：<a href="http://perishablepress.com/press/2008/02/20/wordpress-discussion-%20management-enable-or-disable-comments-and-pingbacks-via-sql/" target="_blank">http://perishablepress.com/press/2008/02/20/wordpress-discussion-  management-enable-or-disable-comments-and-pingbacks-via-sql/</a></p><h3><strong>12. 替换评论者的链接</strong></h3><p>上文提到了 MySQL 的 replace()   函数。该条语句就是一个很好的例子。如果您的站点域名发生了改变，您可以使用该语句将您在自己站上发表的评论中的链接批量替换为新的域名。</p><div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">UPDATE wp_comments SET comment_author_url = REPLACE( comment_author_url, 'http://oldurl.com', 'http://newurl.com' );</div></div><p>来源：http://perishablepress.com/press/2008/07/14/wordpress-link-author-  comments-home-page/</p><h3><strong>13. 替换评论者的电子邮箱地址</strong></h3><p>和上一条差不多，批量替换掉电子邮箱地址。</p><div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">UPDATE wp_comments SET comment_author_email = REPLACE( comment_author_email, 'old-email@address.com', 'new-email@address.com' );</div></div><p>来源：<a href="http://perishablepress.com/press/2008/05/18/wordpress-tip-update-%20email-address-in-the-wordpress-database" target="_blank">http://perishablepress.com/press/2008/05/18/wordpress-tip-update-  email-address-in-the-wordpress-database</a></p><h3><strong>14. 删除包含指定链接的评论</strong></h3><p>某些垃圾评论发布者还是很会钻空子的。经常发布一些貌似与文章相关的评论，可评论内容中通常包含恶意网站的链接。等你发现的时候，可能这样的评论已  经很多了。使用以下代码，可以方便的将包含指定链接地址的评论一次性删除掉。</p><div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">DELETE from wp_comments WHERE comment_author_url LIKE &quot;%wpbeginner%&quot; ;</div></div><p>来源：<a href="http://perishablepress.com/press/2007/07/25/mysql-magic-find-and-%20replace-data/" target="_blank">http://perishablepress.com/press/2007/07/25/mysql-magic-find-and-  replace-data/</a></p><p>本文发布在 <a title="Dreamcolor's Cote" href="http://dreamcolor.net/" target="_blank">Dreamcolor's Cote</a>，转载请保持文章完整并注明出处。</p><p>原文地址：<a href="http://www.catswhocode.com/blog/wordpress-10-life-saving-sql-queries" target="_blank">10+   life saving SQL queries</a></p> ]]></content:encoded> <wfw:commentRss>http://imcat.in/14-useful-mysql-query/feed/</wfw:commentRss> <slash:comments>4</slash:comments> </item> <item><title>一步一步教你安装Nginx+PHP+Mysql</title><link>http://imcat.in/teach-you-step-by-step-install-nginx-php-mysql/</link> <comments>http://imcat.in/teach-you-step-by-step-install-nginx-php-mysql/#comments</comments> <pubDate>Wed, 03 Mar 2010 10:29:32 +0000</pubDate> <dc:creator>Cat.</dc:creator> <category><![CDATA[Linux]]></category> <category><![CDATA[MySQL]]></category> <category><![CDATA[Nginx]]></category> <category><![CDATA[php]]></category><guid isPermaLink="false">http://imcat.in/?p=1224</guid> <description><![CDATA[发现很多VPS用LNMP一键安装包都 失败,有不能排错,唯有给出教程,一步一步教你安装,所谓授人于鱼不如授人于渔嘛,本文是在CentOS 5.4 操作系统下测试通过的,用的是DiaHosting上 的32位系统,为什么要用32位系统?就是为了节省内存,VPS内存都不是很多的,纯32位系统比X86_X64兼用32位系统更省内存. 安装步骤: 1,升级系统和安装相关的程序库 yum -y install yum-fastestmirror yum -y update yum -y install patch make gcc gcc-c++ gcc-g77 flex bison yum -y install libtool libtool-libs kernel-devel autoconf yum -y install libjpeg libjpeg-devel libpng libpng-devel yum -y install freetype freetype-devel libxml2 libxml2-devel zlib &#160;zlib-devel yum -y install glib2 glib2-devel bzip2 diff* yum [...]]]></description> <content:encoded><![CDATA[<p>发现很多VPS用LNMP<a href="http://imcat.in/lnmp/" target="_blank">一键安装包</a>都 失败,有不能排错,唯有给出教程,一步一步教你安装,所谓授人于鱼不如授人于渔嘛,本文是在CentOS 5.4 操作系统下测试通过的,用的是<a href="http://www.diahosting.com/client/aff.php?aff=270" target="_blank">DiaHosting</a>上 的32位系统,为什么要用32位系统?就是为了节省内存,VPS内存都不是很多的,纯32位系统比X86_X64兼用32位系统更省内存.</p><p>安装步骤:<br /> <span id="more-1224"></span><br /> 1,升级系统和安装相关的程序库</p><div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">yum -y install yum-fastestmirror<br /> yum -y update<br /> yum -y install patch make gcc gcc-c++ gcc-g77 flex bison<br /> yum -y install libtool libtool-libs kernel-devel autoconf<br /> yum -y install libjpeg libjpeg-devel libpng libpng-devel<br /> yum -y install freetype freetype-devel libxml2 libxml2-devel zlib &nbsp;zlib-devel<br /> yum -y install glib2 glib2-devel bzip2 diff*<br /> yum -y install bzip2-devel ncurses ncurses-devel curl curl-devel &nbsp;e2fsprogs<br /> yum -y install e2fsprogs-devel krb5 krb5-devel libidn libidn-devel<br /> yum -y install openssl openssl-devel vim-minimal<br /> yum -y install fonts-chinese scim-chewing scim-pinyin &nbsp;scim-tables-chinese</div></div><p>2,下载相关程序源码包</p><div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">wget http://catlnmp.googlecode.com/files/libiconv-1.13.1.tar.gz<br /> wget http://catlnmp.googlecode.com/files/libmcrypt-2.5.8.tar.gz<br /> wget http://catlnmp.googlecode.com/files/mhash-0.9.9.9.tar.gz<br /> wget http://catlnmp.googlecode.com/files/mcrypt-2.6.8.tar.gz<br /> wget http://catlnmp.googlecode.com/files/mysql-5.1.44.tar.gz<br /> wget http://php-fpm.org/downloads/php-5.2.13-fpm-0.5.13.diff.gz<br /> wget http://www.sfr-fresh.com/unix/www/php-5.2.13.tar.gz<br /> wget http://catlnmp.googlecode.com/files/memcache-2.2.5.tgz<br /> wget http://catlnmp.googlecode.com/files/PDO_MYSQL-1.0.2.tgz<br /> wget http://catlnmp.googlecode.com/files/eaccelerator-0.9.6.tar.bz2<br /> wget &nbsp;http://catlnmp.googlecode.com/files/ZendOptimizer-3.3.9-linux-glibc23-i386.tar.gz<br /> wget &nbsp;http://catlnmp.googlecode.com/files/ZendOptimizer-3.3.9-linux-glibc23-x86_64.tar.gz<br /> wget http://catlnmp.googlecode.com/files/pcre-8.01.tar.gz<br /> wget http://catlnmp.googlecode.com/files/nginx-0.7.65.tar.gz<br /> wget &nbsp;http://catlnmp.googlecode.com/files/phpMyAdmin-3.2.4-all-languages.tar.gz<br /> wget http://catlnmp.googlecode.com/files/index.php</div></div><p>3,开始安装,先安装PHP需要的库程序</p><div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:300px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">tar zxvf libiconv-1.13.1.tar.gz<br /> cd libiconv-1.13.1/<br /> ./configure --prefix=/usr/local<br /> make<br /> make install<br /> cd ../<br /> <br /> tar zxvf libmcrypt-2.5.8.tar.gz<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 /> ln -s /usr/local/bin/libmcrypt-config /usr/bin/libmcrypt-config<br /> <br /> tar zxvf mcrypt-2.6.8.tar.gz<br /> cd mcrypt-2.6.8/<br /> ./configure<br /> make<br /> make install<br /> cd ../</div></div><p>4,安装mysql</p><div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">tar -zxvf mysql-5.1.44.tar.gz<br /> cd mysql-5.1.44<br /> ./configure --prefix=/usr/local/mysql --with-extra-charsets=all --enable-thread-safe-client --enable-assembler --with-charset=utf8 --enable-thread-safe-client --with-extra-charsets=all --with-big-tables --with-readline --with-ssl --with-embedded-server --enable-local-infile --without-debug<br /> make &amp;amp;&amp;amp; make install<br /> cd ../</div></div><p>创建MySQL数据库,用默认的配置my.cnf</p><div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">groupadd mysql<br /> useradd -g mysql mysql<br /> cp /usr/local/mysql/share/mysql/my-medium.cnf /etc/my.cnf<br /> /usr/local/mysql/bin/mysql_install_db --user=mysql<br /> chown -R mysql /usr/local/mysql/var<br /> chgrp -R mysql /usr/local/mysql/.</div></div><p>添加Mysql启动服务,并且设置root密码</p><div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">cp /usr/local/mysql/share/mysql/mysql.server /etc/init.d/mysql<br /> chmod 755 /etc/init.d/mysql<br /> chkconfig --level 345 mysql on<br /> echo &quot;/usr/local/mysql/lib/mysql&quot; &amp;gt;&amp;gt; /etc/ld.so.conf<br /> echo &quot;/usr/local/lib&quot; &amp;gt;&amp;gt;/etc/ld.so.conf<br /> ldconfig<br /> ln -s /usr/local/mysql/lib/mysql /usr/lib/mysql<br /> ln -s /usr/local/mysql/include/mysql /usr/include/mysql<br /> service mysql start<br /> /usr/local/mysql/bin/mysqladmin -u root password root &nbsp; &nbsp;//root改为你需要的密码<br /> service mysql restart</div></div><p>5,安装PHP（FastCGI模式）</p><div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">tar zxvf php-5.2.13.tar.gz<br /> gzip -cd php-5.2.13-fpm-0.5.13.diff.gz | patch -d php-5.2.13 -p1<br /> cd php-5.2.13/<br /> ./buildconf --force<br /> ./configure --prefix=/usr/local/php &nbsp;--with-config-file-path=/usr/local/php/etc --with-mysql=/usr/local/mysql &nbsp;--with-mysqli=/usr/local/mysql/bin/mysql_config &nbsp;--with-iconv-dir=/usr/local --with-freetype-dir --with-jpeg-dir &nbsp;--with-png-dir --with-zlib --with-libxml-dir=/usr --enable-xml &nbsp;--disable-rpath --enable-discard-path --enable-safe-mode --enable-bcmath &nbsp;--enable-shmop --enable-sysvsem --enable-inline-optimization &nbsp;--with-curl --with-curlwrappers --enable-mbregex --enable-fastcgi &nbsp;--enable-fpm --enable-force-cgi-redirect --enable-mbstring --with-mcrypt &nbsp;--with-gd --enable-gd-native-ttf --with-mhash --enable-pcntl &nbsp;--enable-sockets --with-xmlrpc --enable-zip --enable-ftp<br /> make ZEND_EXTRA_LIBS='-liconv'<br /> make install<br /> cp php.ini-dist /usr/local/php/etc/php.ini<br /> cd ../</div></div><p>6,安装PHP扩展模块</p><div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:300px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">tar zxvf memcache-2.2.5.tgz<br /> cd memcache-2.2.5/<br /> /usr/local/php/bin/phpize<br /> ./configure --with-php-config=/usr/local/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/php/bin/phpize<br /> ./configure --with-php-config=/usr/local/php/bin/php-config &nbsp;--with-pdo-mysql=/usr/local/mysql<br /> make<br /> make install<br /> cd ../<br /> <br /> tar jxvf eaccelerator-0.9.6.tar.bz2<br /> cd eaccelerator-0.9.6/<br /> /usr/local/php/bin/phpize<br /> ./configure --enable-eaccelerator=shared &nbsp;--with-php-config=/usr/local/php/bin/php-config<br /> make<br /> make install<br /> cd ../</div></div><p>安装Zend Optimizer,32位系统版本</p><div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">tar zxvf ZendOptimizer-3.3.9-linux-glibc23-i386.tar.gz<br /> mkdir -p /usr/local/zend/<br /> cp &nbsp;ZendOptimizer-3.3.9-linux-glibc23-i386/data/5_2_x_comp/ZendOptimizer.so &nbsp;/usr/local/zend/</div></div><p>如果是64位系统,则</p><div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">tar zxvf ZendOptimizer-3.3.9-linux-glibc23-x86_64.tar.gz<br /> mkdir -p /usr/local/zend/<br /> cp &nbsp;ZendOptimizer-3.3.9-linux-glibc23-x86_64/data/5_2_x_comp/ZendOptimizer.so &nbsp;/usr/local/zend/</div></div><p>配置php.ini</p><div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">cat &amp;gt;&amp;gt;/usr/local/php/etc/php.ini&amp;lt;</div></div><p>7,修改php.ini文件<br /> <strong>手工修改</strong>：查找/usr/local/php/etc/php.ini中的extension_dir = "./"<br /> 修改为extension_dir =  "/usr/local/php/lib/php/extensions/no-debug-non-zts-20060613/"<br /> 并在此行后增加以下几行，然后保存：<br /> extension = "memcache.so"<br /> extension = "pdo_mysql.so"</p><p>再查找 output_buffering = Off<br /> 修改为output_buffering = On</p><p><strong>自动修改</strong>:可执行以下shell命令,自动完成对php.ini文件的修改:</p><div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">sed -i 's#extension_dir = &quot;./&quot;#extension_dir = &nbsp;&quot;/usr/local/php/lib/php/extensions/no-debug-non-zts-20060613/&quot;nextension &nbsp;= &quot;memcache.so&quot;nextension = &quot;pdo_mysql.so&quot;n#' &nbsp;/usr/local/php/etc/php.ini<br /> sed -i 's#output_buffering = Off#output_buffering = On#' &nbsp;/usr/local/php/etc/php.ini</div></div><p>8,配置eAccelerator加速PHP:<br /> 创建缓存目录</p><div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">mkdir -p /usr/local/eaccelerator_cache</div></div><p>配置php.ini</p><div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">cat &gt;&gt;/usr/local/php/etc/php.ini&lt; &lt;EOF<br /> [eaccelerator]<br /> zend_extension=&quot;/usr/local/php/lib/php/extensions/no-debug-non-zts-20060613/eaccelerator.so&quot;<br /> eaccelerator.shm_size=&quot;16&quot;<br /> eaccelerator.cache_dir=&quot;/usr/local/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;<br /> EOF</div></div><p>9,创建www用户和组,以及主机需要的目录,日志目录<br /> </code></p><div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">groupadd www<br /> useradd -g www www<br /> mkdir -p /home/www<br /> chmod +w /home/www<br /> mkdir -p /home/www/logs<br /> chmod 777 /home/www/logs<br /> chown -R www:www /home/www</div></div><p>10,创建php-fpm配置文件</p><div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">rm -f /usr/local/php/etc/php-fpm.conf<br /> vi /usr/local/php/etc/php-fpm.conf</div></div><p>输入以下内容,我设置开的进程是5个.需要更改进程数,可以修改5</p><div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:300px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&lt;configuration&gt;<br /> &nbsp; All relative paths in this config are relative to php's install prefix &nbsp; <br /> &nbsp; &lt;section name=&quot;global_options&quot;&gt;<br /> &nbsp; &nbsp; Pid file &nbsp; <br /> &nbsp; &nbsp; &lt;value name=&quot;pid_file&quot;&gt;/usr/local/php/logs/php-fpm.pid&lt;/value&gt;<br /> &nbsp; &nbsp; Error log file &nbsp; <br /> &nbsp; &nbsp; &lt;value name=&quot;error_log&quot;&gt;/usr/local/php/logs/php-fpm.log&lt;/value&gt;<br /> &nbsp; &nbsp; Log level &nbsp; <br /> &nbsp; &nbsp; &lt;value name=&quot;log_level&quot;&gt;notice&lt;/value&gt;<br /> &nbsp; &nbsp; When this amount of php processes exited with SIGSEGV or SIGBUS ... &nbsp; <br /> &nbsp; &nbsp; &lt;value name=&quot;emergency_restart_threshold&quot;&gt;10&lt;/value&gt;<br /> &nbsp; &nbsp; ... in a less than this interval of time, a graceful restart will be initiated. &nbsp; <br /> &nbsp; &nbsp; Useful to work around accidental curruptions in accelerator's shared memory. &nbsp; <br /> &nbsp; &nbsp; &lt;value name=&quot;emergency_restart_interval&quot;&gt;1m&lt;/value&gt;<br /> &nbsp; &nbsp; Time limit on waiting child's reaction on signals from master &nbsp; <br /> &nbsp; &nbsp; &lt;value name=&quot;process_control_timeout&quot;&gt;5s&lt;/value&gt;<br /> &nbsp; &nbsp; Set to 'no' to debug fpm &nbsp; <br /> &nbsp; &nbsp; &lt;value name=&quot;daemonize&quot;&gt;yes&lt;/value&gt;<br /> &nbsp; &lt;/section&gt;<br /> &nbsp; &lt;workers&gt;<br /> &nbsp; &nbsp; &lt;section name=&quot;pool&quot;&gt;<br /> &nbsp; &nbsp; &nbsp; Name of pool. Used in logs and stats. &nbsp; <br /> &nbsp; &nbsp; &nbsp; &lt;value name=&quot;name&quot;&gt;default&lt;/value&gt;<br /> &nbsp; &nbsp; &nbsp; Address to accept fastcgi requests on. &nbsp; <br /> &nbsp; &nbsp; &nbsp; Valid syntax is 'ip.ad.re.ss:port' or just 'port' or '/path/to/unix/socket' &nbsp; <br /> &nbsp; &nbsp; &nbsp; &lt;value name=&quot;listen_address&quot;&gt;/tmp/php-cgi.sock&lt;/value&gt;<br /> &nbsp; &nbsp; &nbsp; &lt;value name=&quot;listen_options&quot;&gt;<br /> &nbsp; &nbsp; &nbsp; &nbsp; Set listen(2) backlog &nbsp; <br /> &nbsp; &nbsp; &nbsp; &nbsp; &lt;/value&gt;&lt;value name=&quot;backlog&quot;&gt;-1&lt;/value&gt;<br /> &nbsp; &nbsp; &nbsp; &nbsp; Set permissions for unix socket, if one used. &nbsp; <br /> &nbsp; &nbsp; &nbsp; &nbsp; In Linux read/write permissions must be set in order to allow connections from web server. &nbsp; <br /> &nbsp; &nbsp; &nbsp; &nbsp; Many BSD-derrived systems allow connections regardless of permissions. &nbsp; <br /> &nbsp; &nbsp; &nbsp; &nbsp; &lt;value name=&quot;owner&quot;&gt;&lt;/value&gt;<br /> &nbsp; &nbsp; &nbsp; &nbsp; &lt;value name=&quot;group&quot;&gt;&lt;/value&gt;<br /> &nbsp; &nbsp; &nbsp; &nbsp; &lt;value name=&quot;mode&quot;&gt;0666&lt;/value&gt;<br /> &nbsp; &nbsp; &nbsp; <br /> &nbsp; &nbsp; &nbsp; Additional php.ini defines, specific to this pool of workers. &nbsp; <br /> &nbsp; &nbsp; &nbsp; &lt;value name=&quot;php_defines&quot;&gt;<br /> &nbsp; &nbsp; &nbsp; &nbsp; &lt;/value&gt;&lt;value name=&quot;sendmail_path&quot;&gt;/usr/sbin/sendmail -t -i&lt;/value&gt;<br /> &nbsp; &nbsp; &nbsp; &nbsp; &lt;value name=&quot;display_errors&quot;&gt;1&lt;/value&gt;<br /> &nbsp; &nbsp; &nbsp; <br /> &nbsp; &nbsp; &nbsp; Unix user of processes &nbsp; <br /> &nbsp; &nbsp; &nbsp; &nbsp; &lt;value name=&quot;user&quot;&gt;www&lt;/value&gt;<br /> &nbsp; &nbsp; &nbsp; Unix group of processes &nbsp; <br /> &nbsp; &nbsp; &nbsp; &nbsp; &lt;value name=&quot;group&quot;&gt;www&lt;/value&gt;<br /> &nbsp; &nbsp; &nbsp; Process manager settings &nbsp; <br /> &nbsp; &nbsp; &nbsp; &lt;value name=&quot;pm&quot;&gt;<br /> &nbsp; &nbsp; &nbsp; &nbsp; Sets style of controling worker process count. &nbsp; <br /> &nbsp; &nbsp; &nbsp; &nbsp; Valid values are 'static' and 'apache-like' &nbsp; <br /> &nbsp; &nbsp; &nbsp; &nbsp; &lt;/value&gt;&lt;value name=&quot;style&quot;&gt;static&lt;/value&gt;<br /> &nbsp; &nbsp; &nbsp; &nbsp; Sets the limit on the number of simultaneous requests that will be served. &nbsp; <br /> &nbsp; &nbsp; &nbsp; &nbsp; Equivalent to Apache MaxClients directive. &nbsp; <br /> &nbsp; &nbsp; &nbsp; &nbsp; Equivalent to PHP_FCGI_CHILDREN environment in original php.fcgi &nbsp; <br /> &nbsp; &nbsp; &nbsp; &nbsp; Used with any pm_style. &nbsp; <br /> &nbsp; &nbsp; &nbsp; &nbsp; &lt;value name=&quot;max_children&quot;&gt;5&lt;/value&gt;<br /> &nbsp; &nbsp; &nbsp; &nbsp; Settings group for 'apache-like' pm style &nbsp; <br /> &nbsp; &nbsp; &nbsp; &nbsp; &lt;value name=&quot;apache_like&quot;&gt;<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Sets the number of server processes created on startup. &nbsp; <br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Used only when 'apache-like' pm_style is selected &nbsp; <br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/value&gt;&lt;value name=&quot;StartServers&quot;&gt;20&lt;/value&gt;<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Sets the desired minimum number of idle server processes. &nbsp; <br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Used only when 'apache-like' pm_style is selected &nbsp; <br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;value name=&quot;MinSpareServers&quot;&gt;5&lt;/value&gt;<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Sets the desired maximum number of idle server processes. &nbsp; <br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Used only when 'apache-like' pm_style is selected &nbsp; <br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;value name=&quot;MaxSpareServers&quot;&gt;35&lt;/value&gt;<br /> &nbsp; &nbsp; &nbsp; &nbsp; <br /> &nbsp; &nbsp; &nbsp; <br /> &nbsp; &nbsp; &nbsp; The timeout (in seconds) for serving a single request after which the worker process will be terminated &nbsp; <br /> &nbsp; &nbsp; &nbsp; Should be used when 'max_execution_time' ini option does not stop script execution for some reason &nbsp; <br /> &nbsp; &nbsp; &nbsp; '0s' means 'off' &nbsp; <br /> &nbsp; &nbsp; &nbsp; &lt;value name=&quot;request_terminate_timeout&quot;&gt;0s&lt;/value&gt;<br /> &nbsp; &nbsp; &nbsp; The timeout (in seconds) for serving of single request after which a php backtrace will be dumped to slow.log file &nbsp; <br /> &nbsp; &nbsp; &nbsp; '0s' means 'off' &nbsp; <br /> &nbsp; &nbsp; &nbsp; &lt;value name=&quot;request_slowlog_timeout&quot;&gt;0s&lt;/value&gt;<br /> &nbsp; &nbsp; &nbsp; The log file for slow requests &nbsp; <br /> &nbsp; &nbsp; &nbsp; &lt;value name=&quot;slowlog&quot;&gt;logs/slow.log&lt;/value&gt;<br /> &nbsp; &nbsp; &nbsp; Set open file desc rlimit &nbsp; <br /> &nbsp; &nbsp; &nbsp; &lt;value name=&quot;rlimit_files&quot;&gt;51200&lt;/value&gt;<br /> &nbsp; &nbsp; &nbsp; Set max core size rlimit &nbsp; <br /> &nbsp; &nbsp; &nbsp; &lt;value name=&quot;rlimit_core&quot;&gt;0&lt;/value&gt;<br /> &nbsp; &nbsp; &nbsp; Chroot to this directory at the start, absolute path &nbsp; <br /> &nbsp; &nbsp; &nbsp; &lt;value name=&quot;chroot&quot;&gt;&lt;/value&gt;<br /> &nbsp; &nbsp; &nbsp; Chdir to this directory at the start, absolute path &nbsp; <br /> &nbsp; &nbsp; &nbsp; &lt;value name=&quot;chdir&quot;&gt;&lt;/value&gt;<br /> &nbsp; &nbsp; &nbsp; Redirect workers' stdout and stderr into main error log. &nbsp; <br /> &nbsp; &nbsp; &nbsp; If not set, they will be redirected to /dev/null, according to FastCGI specs &nbsp; <br /> &nbsp; &nbsp; &nbsp; &lt;value name=&quot;catch_workers_output&quot;&gt;yes&lt;/value&gt;<br /> &nbsp; &nbsp; &nbsp; How much requests each process should execute before respawn. &nbsp; <br /> &nbsp; &nbsp; &nbsp; Useful to work around memory leaks in 3rd party libraries. &nbsp; <br /> &nbsp; &nbsp; &nbsp; For endless request processing please specify 0 &nbsp; <br /> &nbsp; &nbsp; &nbsp; Equivalent to PHP_FCGI_MAX_REQUESTS &nbsp; <br /> &nbsp; &nbsp; &nbsp; &lt;value name=&quot;max_requests&quot;&gt;10240&lt;/value&gt;<br /> &nbsp; &nbsp; &nbsp; Comma separated list of ipv4 addresses of FastCGI clients that allowed to connect. &nbsp; <br /> &nbsp; &nbsp; &nbsp; Equivalent to FCGI_WEB_SERVER_ADDRS environment in original php.fcgi (5.2.2+) &nbsp; <br /> &nbsp; &nbsp; &nbsp; Makes sense only with AF_INET listening socket. &nbsp; <br /> &nbsp; &nbsp; &nbsp; &lt;value name=&quot;allowed_clients&quot;&gt;127.0.0.1&lt;/value&gt;<br /> &nbsp; &nbsp; &nbsp; Pass environment variables like LD_LIBRARY_PATH &nbsp; <br /> &nbsp; &nbsp; &nbsp; All $VARIABLEs are taken from current environment &nbsp; <br /> &nbsp; &nbsp; &nbsp; &lt;value name=&quot;environment&quot;&gt;<br /> &nbsp; &nbsp; &nbsp; &nbsp; &lt;/value&gt;&lt;value name=&quot;HOSTNAME&quot;&gt;$HOSTNAME&lt;/value&gt;<br /> &nbsp; &nbsp; &nbsp; &nbsp; &lt;value name=&quot;PATH&quot;&gt;/usr/local/bin:/usr/bin:/bin&lt;/value&gt;<br /> &nbsp; &nbsp; &nbsp; &nbsp; &lt;value name=&quot;TMP&quot;&gt;/tmp&lt;/value&gt;<br /> &nbsp; &nbsp; &nbsp; &nbsp; &lt;value name=&quot;TMPDIR&quot;&gt;/tmp&lt;/value&gt;<br /> &nbsp; &nbsp; &nbsp; &nbsp; &lt;value name=&quot;TEMP&quot;&gt;/tmp&lt;/value&gt;<br /> &nbsp; &nbsp; &nbsp; &nbsp; &lt;value name=&quot;OSTYPE&quot;&gt;$OSTYPE&lt;/value&gt;<br /> &nbsp; &nbsp; &nbsp; &nbsp; &lt;value name=&quot;MACHTYPE&quot;&gt;$MACHTYPE&lt;/value&gt;<br /> &nbsp; &nbsp; &nbsp; &nbsp; &lt;value name=&quot;MALLOC_CHECK_&quot;&gt;2&lt;/value&gt;<br /> &nbsp; &nbsp; &nbsp; <br /> &nbsp; &nbsp; &lt;/section&gt;<br /> &nbsp; &lt;/workers&gt;<br /> &lt;/configuration&gt;</div></div><p>11,启动php-cgi进程,监听127.0.0.1的9000端口,进程数为5,用户为www</p><div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">ulimit -SHn 65535<br /> /usr/local/php/sbin/php-fpm start</div></div><p>注:/usr/local/php/sbin/php-fpm还有其他参数,包 括:start|stop|quit|restart|reload|logrotate,修改php.ini后不重启php-cgi,重新加载配置文件 使用reload</p><p>12,安装Nginx</p><div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">tar zxvf pcre-8.01.tar.gz<br /> cd pcre-8.01/<br /> ./configure<br /> make &amp;&amp; make install<br /> cd ../<br /> <br /> tar zxvf nginx-0.7.65.tar.gz<br /> cd nginx-0.7.65/<br /> ./configure --user=www --group=www --prefix=/usr/local/nginx &nbsp;--with-http_stub_status_module --with-http_ssl_module &nbsp;--with-http_gzip_static_module<br /> make &amp;&amp; make install<br /> cd ../</div></div><p>13,创建Nginx配置文件</p><div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">mkdir -p /usr/local/nginx/conf/servers<br /> rm -f /usr/local/nginx/conf/nginx.conf<br /> vi /usr/local/nginx/conf/nginx.conf</div></div><p>输入以下内容:</p><div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:300px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">user &nbsp;www www;<br /> worker_processes 1;<br /> error_log &nbsp;/home/www/logs/nginx_error.log &nbsp;crit;<br /> pid &nbsp; &nbsp; &nbsp; &nbsp;/usr/local/nginx/nginx.pid;<br /> #Specifies the value for maximum file descriptors that can be opened by &nbsp;this process.<br /> worker_rlimit_nofile 65535;<br /> events<br /> {<br /> use epoll;<br /> worker_connections 65535;<br /> }<br /> http<br /> {<br /> include &nbsp; &nbsp; &nbsp; mime.types;<br /> default_type &nbsp;application/octet-stream;<br /> #charse &nbsp;gb2312;<br /> server_names_hash_bucket_size 128;<br /> client_header_buffer_size 128k;<br /> large_client_header_buffers 4 256k;<br /> client_max_body_size 8m;<br /> sendfile on;<br /> tcp_nopush &nbsp; &nbsp; on;<br /> keepalive_timeout 60;<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 &nbsp;1k;<br /> gzip_buffers &nbsp; &nbsp; 4 16k;<br /> gzip_http_version 1.1;<br /> gzip_comp_level 9;<br /> gzip_types &nbsp; &nbsp; &nbsp; text/plain application/x-javascript text/css &nbsp;application/xml;<br /> gzip_vary on;<br /> output_buffers &nbsp; 4 32k;<br /> postpone_output &nbsp;1460;<br /> <br /> #limit_zone &nbsp;crawler &nbsp;$binary_remote_addr &nbsp;10m;<br /> <br /> server<br /> {<br /> listen &nbsp; &nbsp; &nbsp; 80;<br /> server_name vps.imcat.in;<br /> index index.html index.htm index.php;<br /> include location.conf;<br /> root &nbsp;/home/www;<br /> }<br /> include servers/*;<br /> }</div></div><p>14,在/usr/local/nginx/conf/目录中创建location.conf文件：</p><div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">vi /usr/local/nginx/conf/location.conf</div></div><p>输入内容:</p><div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">location ~ .*.(php|php5)?$<br /> {<br /> #fastcgi_pass &nbsp;unix:/tmp/php-cgi.sock;<br /> fastcgi_pass &nbsp;127.0.0.1:9000;<br /> fastcgi_index index.php;<br /> include fastcgi.conf;<br /> }<br /> <br /> location ~ .*.(gif|jpg|jpeg|png|bmp|swf)$<br /> {<br /> expires &nbsp; &nbsp; &nbsp;30d;<br /> }<br /> <br /> location ~ .*.(js|css)?$<br /> {<br /> expires &nbsp; &nbsp; &nbsp;12h;<br /> }</div></div><p>多站点管理,可以在/usr/local/nginx/conf/servers目录添加配置文件,格式为:</p><div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">vi /usr/local/nginx/conf/servers/imcat.conf</div></div><p>内容:</p><div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">server<br /> <br /> {<br /> listen &nbsp; &nbsp; &nbsp; 80;<br /> server_name imcat.in;<br /> index index.html index.htm index.php;<br /> root &nbsp;/home/www/imcat;<br /> }</div></div><p>请注意,我是没有开启Nginx日志记录功能的.<br /> 启动Nginx:</p><div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">ulimit -SHn 65535<br /> /usr/local/nginx/sbin/nginx</div></div><p>放个探针看看</p><div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">mv index.php /home/www/</div></div><p>访问你的IP看看吧!</p><p>15,安装phpMyAdmin,管理Mysql数据库</p><div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">tar zxvf phpMyAdmin-3.2.4-all-languages.tar.gz<br /> mv phpMyAdmin-3.2.4-all-languages /home/www/phpmyadmin</div></div><p>16,配置开机自动启动Nginx + PHP</p><div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">echo &quot;ulimit -SHn 65535&quot; &amp;gt;&amp;gt;/etc/rc.local<br /> echo &quot;/usr/local/php/sbin/php-fpm start&quot; &amp;gt;&amp;gt;/etc/rc.local<br /> echo &quot;/usr/local/nginx/sbin/nginx&quot; &amp;gt;&amp;gt;/etc/rc.local</div></div><p>17,优化Linux内核参数(我只在Xen VPS用过,Openvz VPS失败,慎用)</p><div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">vi /etc/sysctl.conf</div></div><p>在最后加入</p><div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:300px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"># Add<br /> net.ipv4.tcp_max_syn_backlog = 65536<br /> net.core.netdev_max_backlog = &nbsp;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 &nbsp;65535</div></div><p>使配置立即生效：</p><div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">/sbin/sysctl -p</div></div><p>18,需要安装ftp的,可以简单安装vsftpd应用:</p><div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">yum -y install vsftpd<br /> /etc/init.d/vsftpd start<br /> chkconfig --level 345 vsftpd on</div></div><p>19,请务必更改www用户密码:</p><div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">passwd www</div></div><p>全文完!欢迎抓错误!</p> ]]></content:encoded> <wfw:commentRss>http://imcat.in/teach-you-step-by-step-install-nginx-php-mysql/feed/</wfw:commentRss> <slash:comments>45</slash:comments> </item> <item><title>debian安装nginx+php(spawn-fcgi)+mysql</title><link>http://imcat.in/debian-install-nginx-php-spawn-fcgi-mysql/</link> <comments>http://imcat.in/debian-install-nginx-php-spawn-fcgi-mysql/#comments</comments> <pubDate>Wed, 02 Dec 2009 12:20:14 +0000</pubDate> <dc:creator>Cat.</dc:creator> <category><![CDATA[Linux]]></category> <category><![CDATA[debian]]></category> <category><![CDATA[MySQL]]></category> <category><![CDATA[Nginx]]></category> <category><![CDATA[php]]></category> <category><![CDATA[php spawn-fcgi]]></category><guid isPermaLink="false">http://imcat.in/debian%e5%ae%89%e8%a3%85nginxphpspawn-fcgimysql/</guid> <description><![CDATA[前天购买了linode最低的那款VPS,一直用的都是CentOS系统,所以这次就试了试debian ,毕竟国外debian使用率占了半壁江山 linode的控制面板很好用,很方便,一下就安装debian 5.0 ,下载是昨天安装nginx+php(spawn-fcgi)+mysql 的记录 首先是添加源地址,目的只有一个,我要安装最新版的软件,debian默认的软件版本低啊 vi /etc/apt/sources.list deb http://packages.dotdeb.org lenny all 接着,当然是更新一下系统啦. apt-get update 下面是安装mysql5.1,安装过程会需要你输入root密码的 apt-get install mysql-server-5.1 /etc/init.d/mysql restart /etc/init.d/mysql stop 接着是PHP5,自己选择需要安装的扩展吧 apt-get install php5-common php5-cgi php5-mysql php5-curl php5-gd php5-idn php-pear php5-imagick php5-imap php5-mcrypt php5-memcache php5-mhash php5-ming php5-ps php5-pspell php5-recode php5-snmp php5-sqlite php5-tidy php5-xmlrpc php5-xsl php5-apc 安装nginx,代码如果下 apt-get install libpcre3 libpcre3-dev libpcrecpp0 [...]]]></description> <content:encoded><![CDATA[<p>前天购买了linode最低的那款VPS,一直用的都是CentOS系统,所以这次就试了试debian ,毕竟国外debian使用率占了半壁江山</p><p>linode的控制面板很好用,很方便,一下就安装debian 5.0 ,下载是昨天安装nginx+php(spawn-fcgi)+mysql 的记录</p><p>首先是添加源地址,目的只有一个,我要安装最新版的软件,debian默认的软件版本低啊</p><blockquote><p>vi /etc/apt/sources.list<br /> deb http://packages.dotdeb.org lenny all</p></blockquote><p>接着,当然是更新一下系统啦.<br /> apt-get update</p><p>下面是安装mysql5.1,安装过程会需要你输入root密码的</p><p><span id="more-1050"></span></p><blockquote><p>apt-get install mysql-server-5.1<br /> /etc/init.d/mysql restart<br /> /etc/init.d/mysql stop</p></blockquote><p>接着是PHP5,自己选择需要安装的扩展吧</p><blockquote><p>apt-get install php5-common php5-cgi php5-mysql php5-curl php5-gd php5-idn php-pear php5-imagick php5-imap php5-mcrypt php5-memcache php5-mhash php5-ming php5-ps php5-pspell php5-recode php5-snmp php5-sqlite php5-tidy php5-xmlrpc php5-xsl php5-apc</p></blockquote><p>安装nginx,代码如果下</p><blockquote><p>apt-get install libpcre3 libpcre3-dev libpcrecpp0 libssl-dev zlib1g-dev build-essential<br /> wget http://sysoev.ru/nginx/nginx-0.7.64.tar.gz<br /> tar zxvf nginx-0.7.64.tar.gz<br /> cd nginx-0.7.64/<br /> ./configure --user=www --group=www --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module --with-http_gzip_static_module --with-http_ssl_module<br /> make<br /> make install<br /> cd ../</p></blockquote><p>最后安装spawn-fcgi,用来启动PHP的</p><blockquote><p>wget http://www.lighttpd.net/download/spawn-fcgi-1.6.3.tar.gz<br /> tar -zxf spawn-fcgi-1.6.3.tar.gz<br /> cd spawn-fcgi-1.6.3<br /> ./configure --bindir=/usr/bin --libdir=/usr/lib --prefix=/etc<br /> make&#038;&make install</p></blockquote><p>启动方法是</p><blockquote><p>/usr/bin/spawn-fcgi -a 127.0.0.1 -p 9000 -C 8 -u www -g www -f "/usr/bin/php5-cgi -d /var/www"<br /> /usr/local/nginx/sbin/nginx</p></blockquote><p>这只是一篇简单的记录日志,没有给出配置文件,配置文件用一键包的就OK,另外,我还没弄好开机启动 php 和 nginx 的脚本,所以每次都要手动运行.</p> ]]></content:encoded> <wfw:commentRss>http://imcat.in/debian-install-nginx-php-spawn-fcgi-mysql/feed/</wfw:commentRss> <slash:comments>5</slash:comments> </item> <item><title>一定要修改的mysql默认预设值</title><link>http://imcat.in/we-must-modify-the-default-value-mysql-default/</link> <comments>http://imcat.in/we-must-modify-the-default-value-mysql-default/#comments</comments> <pubDate>Tue, 17 Nov 2009 03:09:42 +0000</pubDate> <dc:creator>Cat.</dc:creator> <category><![CDATA[Linux]]></category> <category><![CDATA[MySQL]]></category><guid isPermaLink="false">http://imcat.in/%e4%b8%80%e5%ae%9a%e8%a6%81%e4%bf%ae%e6%94%b9%e7%9a%84mysql%e9%bb%98%e8%ae%a4%e9%a2%84%e8%ae%be%e5%80%bc/</guid> <description><![CDATA[Jeremy Zawodny写了一篇Fixing Poor MySQL Default Configuration Values 关于mysql默认预设值的问题,其中提到了有4点是无论如何都要修改的. 首先是 max_connect_errors , 当某一个网站送了很多错误的请求时,mysql服务器就会当掉这个网站的权限. 第三个是 skip-name-resolve 这个设定很变态的,每一次链接都要做一次反DNS查询,mysql跑反DNS查询有什么用,浪费时间和资源. 最后我在my.cnf配置文件添加了以下语句: max_connect_errors = 1844674407370954751 connect_timeout = 30 skip-name-resolve slave_net_timeout = 30]]></description> <content:encoded><![CDATA[<p>Jeremy Zawodny写了一篇<a href="http://jeremy.zawodny.com/blog/archives/011421.html">Fixing Poor MySQL Default Configuration Values</a> 关于mysql默认预设值的问题,其中提到了有4点是无论如何都要修改的.</p><p>首先是 max_connect_errors , 当某一个网站送了很多错误的请求时,mysql服务器就会当掉这个网站的权限.</p><p>第三个是 skip-name-resolve 这个设定很变态的,每一次链接都要做一次反DNS查询,mysql跑反DNS查询有什么用,浪费时间和资源.</p><p>最后我在my.cnf配置文件添加了以下语句:</p><blockquote><p>max_connect_errors = 1844674407370954751<br /> connect_timeout = 30<br /> skip-name-resolve<br /> slave_net_timeout = 30</p></blockquote> ]]></content:encoded> <wfw:commentRss>http://imcat.in/we-must-modify-the-default-value-mysql-default/feed/</wfw:commentRss> <slash:comments>7</slash:comments> </item> <item><title>自动备份mysql数据库并发送到Email</title><link>http://imcat.in/backup-mysql-databases-automatically-sent-to-email/</link> <comments>http://imcat.in/backup-mysql-databases-automatically-sent-to-email/#comments</comments> <pubDate>Tue, 30 Jun 2009 14:39:26 +0000</pubDate> <dc:creator>Cat.</dc:creator> <category><![CDATA[Linux]]></category> <category><![CDATA[猫言猫语]]></category> <category><![CDATA[Email]]></category> <category><![CDATA[MySQL]]></category> <category><![CDATA[备份]]></category> <category><![CDATA[数据库]]></category> <category><![CDATA[自动备份]]></category><guid isPermaLink="false">http://imcat.in/%e8%87%aa%e5%8a%a8%e5%a4%87%e4%bb%bdmysql%e6%95%b0%e6%8d%ae%e5%ba%93%e5%b9%b6%e5%8f%91%e9%80%81%e5%88%b0email/</guid> <description><![CDATA[一个博客,一个网站最重要的就是数据库,所以经常备份数据是必须的.尽管 WordPress 有定时备份数据的插件,但只能备份当前的博客,不够灵活.适合个人小小博客,对于一些网站来说,就不适合了.现在很多人都拥有多个网站,showfom 同学就有几个网站.每个网站都装个插件就比较麻烦了.况且不是每个网站都是 WordPress 的 . 所以写了个自动备份mysql数据库的脚本,再加上gmail这个G级邮箱,备份多少数据都可以了...下面是代码: mysqldump -uuser -ppassword --databases db1 db2 db3 &#62; /home/website/backups/databackup.sql tar zcf /home/website/backups/databackup.sql.tar.gz /home/website/backups/ echo &#34;主题:数据库备份&#34; &#124; mutt -a /home/website/backups/databackup.sql.tar.gz -s &#34;内容:数据库备份&#34; www@gmail.com rm -r /home/website/backups/* 将上面的代码保存为automysqlbackup.sh 然后利用crontab 实现动备份,在ssh下, crontab -e 输入以下内容: 00 00 * * * /home/website/automysqlbackup.sh 这样就实现了每天00:00自动备份mysql数据库并发送到Email 简单的说明下吧. 第一句是一次性备份多个数据库,这个要你用root权限的用户才可以的..-u后面的是数据库用户名 -p后面的是数据库密码 无需空格 db1 db2 db3为你需要备份的数据库名. 如果你的数据库用户名没有root这个权限,可以改为这样 mysqldump [...]]]></description> <content:encoded><![CDATA[<p>一个博客,一个网站最重要的就是数据库,所以经常备份数据是必须的.尽管 <a href="http://wordpress.org/">WordPress</a> 有定时备份数据的插件,但只能备份当前的博客,不够灵活.适合个人小小博客,对于一些网站来说,就不适合了.现在很多人都拥有多个网站,<a href="http://showfom.com/google-pr-updates-09-05-28/" target="_blank">showfom</a> 同学就有几个网站.每个网站都装个插件就比较麻烦了.况且不是每个网站都是 <a href="http://wordpress.org/">WordPress</a> 的 .</p><p>所以写了个自动备份mysql数据库的脚本,再加上gmail这个G级邮箱,备份多少数据都可以了...下面是代码:</p><div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">mysqldump -uuser -ppassword --databases db1 db2 db3 &gt; /home/website/backups/databackup.sql<br /> tar zcf /home/website/backups/databackup.sql.tar.gz /home/website/backups/<br /> echo &quot;主题:数据库备份&quot; | mutt -a /home/website/backups/databackup.sql.tar.gz -s &quot;内容:数据库备份&quot; www@gmail.com<br /> rm -r /home/website/backups/*</div></div><p><span id="more-964"></span><br /> 将上面的代码保存为automysqlbackup.sh<br /> 然后利用crontab 实现动备份,在ssh下,</p><div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">crontab -e</div></div><p>输入以下内容:</p><div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">00 00 * * * /home/website/automysqlbackup.sh</div></div><p>这样就实现了每天00:00自动备份mysql数据库并发送到Email</p><p>简单的说明下吧.<br /> 第一句是一次性备份多个数据库,这个要你用root权限的用户才可以的..-u后面的是数据库用户名 -p后面的是数据库密码 无需空格 db1 db2 db3为你需要备份的数据库名.<br /> 如果你的数据库用户名没有root这个权限,可以改为这样</p><blockquote><p>mysqldump -uuser -ppassword db1 &gt; /home/website/backups/db1.sql<br /> mysqldump -uuser -ppassword db2 &gt; /home/website/backups/db1.sql<br /> mysqldump -uuser -ppassword db3 &gt; /home/website/backups/db1.sql</p></blockquote><p>第二句是将 backups 文件夹里面的数据文件压缩为文件名:databackup.sql.tar.gz</p><p>第三句是将压缩了的数据库文件发送到指定的邮箱.....</p><p>其中的主题:数据库备份 ,就是邮件的主题, 内容:数据库备份,就是邮件的内用,</p><p>/home/website/backups/databackup.sql.tar.gz 为附件</p><p>www@gmail.com为要发送的Email</p> ]]></content:encoded> <wfw:commentRss>http://imcat.in/backup-mysql-databases-automatically-sent-to-email/feed/</wfw:commentRss> <slash:comments>14</slash:comments> </item> <item><title>最新Linux下的Nginx+MySQL+PHP+Memcache+Vsftpd一键安装包</title><link>http://imcat.in/the-latest-linux-under-nginx-mysql-php-memcache-vsftpd-one-click-installation-package/</link> <comments>http://imcat.in/the-latest-linux-under-nginx-mysql-php-memcache-vsftpd-one-click-installation-package/#comments</comments> <pubDate>Wed, 24 Jun 2009 08:07:28 +0000</pubDate> <dc:creator>Cat.</dc:creator> <category><![CDATA[Linux]]></category> <category><![CDATA[LNMP]]></category> <category><![CDATA[Memcache]]></category> <category><![CDATA[MySQL]]></category> <category><![CDATA[Nginx]]></category> <category><![CDATA[php]]></category> <category><![CDATA[Vsftpd]]></category><guid isPermaLink="false">http://imcat.in/%e6%9c%80%e6%96%b0linux%e4%b8%8b%e7%9a%84nginxmysqlphpmemcachevsftpd%e4%b8%80%e9%94%ae%e5%ae%89%e8%a3%85%e5%8c%85/</guid> <description><![CDATA[这个LANP安装包不是原创!是修改版! 我接触Linux也就一个多月而已,很多东西还是靠Google学来的!这个LANP安装包是我根据张宴和Licess的LNMP改写而成,而且经过我多次测试才发布的.测试环境为CentOS 4.0, CentOS 5.2, CentOS 5.3猫言猫语的VPS就是用这个安装包安装的.安装很简单,也就运行几个命令而已. 程序版本为: Nginx 0.7.60  PHP5.2.9  MySQL 5.1.35 1.首先登陆VPS,用SSH登陆. 2.安装LNMP,进入一个目录:cd /usr/local/src 然后就下载LNMP:wget http://imcat.in/LNMP.zip 解压缩 unzip LNMP.zip 有些VPS安装后没有unzip这个命令,那么运行 yum install unzip 进入该目录 cd LNMP 给脚本添加执行权限:chmod +x down.sh install.sh startup.sh 下载安装所需的源代码文件: ./down.sh 开始安装: ./install.sh 安装完后,请运行:passwd www 为www用户设置一个密码.这个用户和密码就是ftp的用户名和密码 修改您的MySQL的root密码 使用命令：mysqladmin -u root -p password mypasswd //mypasswd为自己的密码 如果提示没有mysqladmin命令.请运行:yum install mysql 这样你就可以上传你的网站了. 程序安装路径： MySQL : [...]]]></description> <content:encoded><![CDATA[<p><span style="color: #ff0000;">这个LANP安装包不是原创!是修改版!</span></p><p>我接触Linux也就一个多月而已,很多东西还是靠Google学来的!这个LANP安装包是我根据<a title="张宴的博客" href="http://blog.s135.com/" target="_blank">张宴</a>和<a title="Licess的博客" href="http://blog.licess.cn/lnmp/" target="_blank">Licess</a>的LNMP改写而成,而且经过我多次测试才发布的.测试环境为CentOS 4.0, CentOS 5.2, CentOS 5.3<a href="http://imcat.in/">猫言猫语</a>的VPS就是用这个安装包安装的.安装很简单,也就运行几个命令而已.</p><p>程序版本为: Nginx 0.7.60  PHP5.2.9  MySQL 5.1.35</p><p>1.首先登陆VPS,用SSH登陆.</p><p>2.安装LNMP,进入一个目录:cd /usr/local/src</p><p>然后就下载LNMP:wget http://imcat.in/LNMP.zip</p><p>解压缩 unzip LNMP.zip</p><p>有些VPS安装后没有unzip这个命令,那么运行 yum install unzip</p><p>进入该目录 cd LNMP</p><p>给脚本添加执行权限:chmod +x down.sh install.sh startup.sh</p><p>下载安装所需的源代码文件: ./down.sh</p><p>开始安装: ./install.sh</p><p>安装完后,请运行:passwd www</p><p>为www用户设置一个密码.这个用户和密码就是ftp的用户名和密码</p><p><span id="more-944"></span></p><p>修改您的MySQL的root密码<br /> 使用命令：mysqladmin -u root -p password mypasswd          //mypasswd为自己的密码<br /> 如果提示没有mysqladmin命令.请运行:yum install mysql</p><p>这样你就可以上传你的网站了.</p><p>程序安装路径：<br /> MySQL :   /usr/local/mysql<br /> PHP :     /usr/local/php<br /> Nginx :   /usr/local/nginx<br /> PHPMyAdmin /home/www/phpmyadmin<br /> Web目录    /home/www<br /> FTP根目录   /home/www</p><p>注意：MYSQL数据库用户名root密码root，登陆后进入mysql数据库，找到user表，删除除了有root密码外的所有用户。</p><p>另外:Linux系统要用32位的.64位占用的内存很大的.</p><blockquote><p><span style="color: #ff0000;">9月29日更新:更新Nginx 0.7.62  PHP5.2.10  MySQL 5.1.39 .删除APC缓存,因为和zend有冲突,改为用eaccelerator做PHP的缓存</p><p>7月21日更新:更新Nginx 0.7.61  PHP5.2.10  MySQL 5.1.35 添加APC缓存<br /> 用我这个安装包是无法安装Zend的,因为Zend和APC有冲突,如果要安装的话,就要在PHP.INI里面取消APC才可以<br /> </span></p><p>9月29日更新:<a href="../lnmp.zip" target="_blank">http://imcat.in/lnmp.zip</a></p><p>7月21日更新:<a href="../LNMP.zip" target="_blank">http://imcat.in/LNMP.zip</a></p></blockquote> ]]></content:encoded> <wfw:commentRss>http://imcat.in/the-latest-linux-under-nginx-mysql-php-memcache-vsftpd-one-click-installation-package/feed/</wfw:commentRss> <slash:comments>31</slash:comments> </item> </channel> </rss>
<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using memcached
Page Caching using memcached
Database Caching 3/9 queries in 0.050 seconds using memcached
Object Caching 3732/3745 objects using memcached

Served from: imcat.in @ 2010-09-09 12:31:13 -->