<?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>Sun, 06 May 2012 05:40:28 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>简单的llmp(Litespeed+mysql+php)安装教程</title>
		<link>http://imcat.in/litespeed-mysql-php-install/</link>
		<comments>http://imcat.in/litespeed-mysql-php-install/#comments</comments>
		<pubDate>Sat, 11 Sep 2010 10:01:29 +0000</pubDate>
		<dc:creator>Cat.</dc:creator>
				<category><![CDATA[个人收藏]]></category>
		<category><![CDATA[Litespeed]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://imcat.in/?p=1347</guid>
		<description><![CDATA[(时间比较急,难免有错误) Litespeed是商业软件的,但也有免费版,而且免费版功能都很强大了,其中的实时查看每个站的链接数,实时查看每个站的in/out的流量大小.这2个功能就已经非常讨我喜欢了...更多功能,自己安装体验吧,下面是安装教程. 我选择的操作系统是CentOS,mysql版本5.1.50,php版本为5.3.3 首先用yum命令安装,升级所需的程序库 yum -y install yum-fastestmirror yum -y update yum -y remove httpd yum -y install patch make gcc gcc-c++ gcc-g77 flex bison tar yum -y install libtool libtool-libs kernel-devel autoconf213 yum -y install libjpeg libjpeg-devel libpng libpng-devel yum -y install freetype freetype-devel libxml2 libxml2-devel zlib zlib-devel yum -y install file glib2 glib2-devel [...]]]></description>
			<content:encoded><![CDATA[<p>(时间比较急,难免有错误)</p>
<p>Litespeed是商业软件的,但也有免费版,而且免费版功能都很强大了,其中的实时查看每个站的链接数,实时查看每个站的in/out的流量大小.这2个功能就已经非常讨我喜欢了...更多功能,自己安装体验吧,下面是安装教程.</p>
<p>我选择的操作系统是CentOS,mysql版本5.1.50,php版本为5.3.3</p>
<p>首先用yum命令安装,升级所需的程序库</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 remove httpd<br />
yum -y install patch make gcc gcc-c++ gcc-g77 flex bison tar<br />
yum -y install libtool libtool-libs kernel-devel autoconf213<br />
yum -y install libjpeg libjpeg-devel libpng libpng-devel<br />
yum -y install freetype freetype-devel libxml2 libxml2-devel zlib zlib-devel<br />
yum -y install file glib2 glib2-devel bzip2 diff* openldap-devel<br />
yum -y install bzip2-devel ncurses ncurses-devel curl curl-devel e2fsprogs<br />
yum -y install e2fsprogs-devel krb5 krb5-devel libidn libidn-devel<br />
yum -y install openssl openssl-devel vim-minimal unzip vixie-cron<br />
yum -y install fonts-chinese scim-chewing scim-pinyin scim-tables-chinese<br />
export PHP_AUTOCONF=/usr/bin/autoconf-2.13<br />
export PHP_AUTOHEADER=/usr/bin/autoheader-2.13</div></div>
<p><span id="more-1347"></span><br />
这里是安装PHP 5.2.3所需的支持库：</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 -c http://catlnmp.googlecode.com/files/libiconv-1.13.1.tar.gz<br />
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 ../</div></div>
<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 -c http://catlnmp.googlecode.com/files/libevent-1.4.14b-stable.tar.gz<br />
tar zxvf libevent-1.4.14b-stable.tar.gz<br />
cd libevent-1.4.14b-stable/<br />
./configure --prefix=/usr<br />
make<br />
make install<br />
cd ../</div></div>
<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 -c http://catlnmp.googlecode.com/files/libmcrypt-2.5.8.tar.gz<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 ../../</div></div>
<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 -c http://catlnmp.googlecode.com/files/mhash-0.9.9.9.tar.gz<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 ../</div></div>
<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">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</div></div>
<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 -c http://catlnmp.googlecode.com/files/mcrypt-2.6.8.tar.gz<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>安装Google的开源TCMalloc库,提高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">wget -c http://catlnmp.googlecode.com/files/google-perftools-1.6.tar.gz<br />
tar zxvf &nbsp;google-perftools-1.6.tar.gz<br />
cd google-perftools-1.6/<br />
./configure<br />
make &amp;&amp; make install<br />
echo &quot;/usr/local/lib&quot; &gt; /etc/ld.so.conf.d/usr_local_lib.conf<br />
/sbin/ldconfig<br />
cd ../</div></div>
<p>现在安装mysql</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">wget -c http://catlnmp.googlecode.com/files/mysql-5.1.50.tar.gz<br />
tar -zxvf mysql-5.1.50.tar.gz<br />
cd mysql-5.1.50<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 --with-mysqld-ldflags=-ltcmalloc_minimal<br />
make &amp;&amp; make install<br />
cd ../<br />
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/.<br />
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; &gt;&gt; /etc/ld.so.conf<br />
echo &quot;/usr/local/lib&quot; &gt;&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 shinko //你的密码<br />
service mysql restart</div></div>
<p>接着安装LiteSpeed</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://www.litespeedtech.com/packages/4.0/lsws-4.0.16-std-i386-linux.tar.gz<br />
tar zxvf lsws-4.0.16-std-i386-linux.tar.gz<br />
cd lsws-4.0.16<br />
./install.sh</div></div>
<p>出现--More--（27%）的许可协议,可以直接按空格键或者回车跳到最后.<br />
Do you agree with above license?  #这里需要输入Yes （Y要大写）<br />
下面的基本一直回车和选Y就OK了</p>
<p>安装完成就可以访问http://IP:7080来管理LiteSpeed,</p>
<p>最后就是安装php了,在litespeed控制面板选择Compile PHP<br />
然后选择要安装的php版本,我这里选择php5.3.3,然后用以下参数编译</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">--with-mysql=mysqlnd --with-mysqli=mysqlnd &nbsp;--with-iconv=/usr/local --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr --enable-xml --disable-rpath --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl --with-curlwrappers --enable-mbregex --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 --enable-ftp --disable-debug --with-gettext --with-openssl</div></div>
<p>然后下一步,是程序自动下载安装文件,下载完成后继续下一步,就去到安装画面了.在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">/usr/local/lsws/phpbuild/buildphp_manual_run.sh</div></div>
<p>等待几分钟就会安装完成了,如果安装失败,请查看log错误...</p>
<h2  class="related_post_title">暧味日志</h2><ul class="related_post"><li><a href="http://imcat.in/teach-you-step-by-step-install-nginx-php-mysql/" title="一步一步教你安装Nginx+PHP+Mysql">一步一步教你安装Nginx+PHP+Mysql</a> (60)</li><li><a href="http://imcat.in/debian-install-nginx-php-spawn-fcgi-mysql/" title="debian安装nginx+php(spawn-fcgi)+mysql">debian安装nginx+php(spawn-fcgi)+mysql</a> (10)</li><li><a href="http://imcat.in/the-latest-linux-under-nginx-mysql-php-memcache-vsftpd-one-click-installation-package/" title="最新Linux下的Nginx+MySQL+PHP+Memcache+Vsftpd一键安装包">最新Linux下的Nginx+MySQL+PHP+Memcache+Vsftpd一键安装包</a> (37)</li><li><a href="http://imcat.in/simple-configuration-nginx-litespeed/" title="简单配置Nginx前端处理静态文件,LiteSpeed后端处理动态文件">简单配置Nginx前端处理静态文件,LiteSpeed后端处理动态文件</a> (32)</li><li><a href="http://imcat.in/delete-mysql-bin-0000x-mysql-log-file/" title="删除Mysql的MySql-bin.0000X日志文件">删除Mysql的MySql-bin.0000X日志文件</a> (3)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://imcat.in/litespeed-mysql-php-install/feed/</wfw:commentRss>
		<slash:comments>17</slash:comments>
		</item>
		<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 暧味日志简单的llmp(Litespeed+mysql+php)安装教程 (17)一步一步教你安装Nginx+PHP+Mysql (60)debian安装nginx+php(spawn-fcgi)+mysql (10)一定要修改的mysql默认预设值 (7)自动备份mysql数据库并发送到Email (20)]]></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的MySql bin.0000X日志文件" src="/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="删除Mysql的MySql bin.0000X日志文件" src="/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>
<h2  class="related_post_title">暧味日志</h2><ul class="related_post"><li><a href="http://imcat.in/litespeed-mysql-php-install/" title="简单的llmp(Litespeed+mysql+php)安装教程">简单的llmp(Litespeed+mysql+php)安装教程</a> (17)</li><li><a href="http://imcat.in/teach-you-step-by-step-install-nginx-php-mysql/" title="一步一步教你安装Nginx+PHP+Mysql">一步一步教你安装Nginx+PHP+Mysql</a> (60)</li><li><a href="http://imcat.in/debian-install-nginx-php-spawn-fcgi-mysql/" title="debian安装nginx+php(spawn-fcgi)+mysql">debian安装nginx+php(spawn-fcgi)+mysql</a> (10)</li><li><a href="http://imcat.in/we-must-modify-the-default-value-mysql-default/" title="一定要修改的mysql默认预设值">一定要修改的mysql默认预设值</a> (7)</li><li><a href="http://imcat.in/backup-mysql-databases-automatically-sent-to-email/" title="自动备份mysql数据库并发送到Email">自动备份mysql数据库并发送到Email</a> (20)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://imcat.in/delete-mysql-bin-0000x-mysql-log-file/feed/</wfw:commentRss>
		<slash:comments>3</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>
<h2  class="related_post_title">暧味日志</h2><ul class="related_post"><li><a href="http://imcat.in/debian-install-nginx-php-spawn-fcgi-mysql/" title="debian安装nginx+php(spawn-fcgi)+mysql">debian安装nginx+php(spawn-fcgi)+mysql</a> (10)</li><li><a href="http://imcat.in/the-latest-linux-under-nginx-mysql-php-memcache-vsftpd-one-click-installation-package/" title="最新Linux下的Nginx+MySQL+PHP+Memcache+Vsftpd一键安装包">最新Linux下的Nginx+MySQL+PHP+Memcache+Vsftpd一键安装包</a> (37)</li><li><a href="http://imcat.in/litespeed-mysql-php-install/" title="简单的llmp(Litespeed+mysql+php)安装教程">简单的llmp(Litespeed+mysql+php)安装教程</a> (17)</li><li><a href="http://imcat.in/wordpress-on-nginx-apache-mod_rewrite-enabled/" title="WordPress在Nginx中启用Apache的mod_rewrite">WordPress在Nginx中启用Apache的mod_rewrite</a> (7)</li><li><a href="http://imcat.in/simple-configuration-nginx-litespeed/" title="简单配置Nginx前端处理静态文件,LiteSpeed后端处理动态文件">简单配置Nginx前端处理静态文件,LiteSpeed后端处理动态文件</a> (32)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://imcat.in/teach-you-step-by-step-install-nginx-php-mysql/feed/</wfw:commentRss>
		<slash:comments>60</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>
<h2  class="related_post_title">暧味日志</h2><ul class="related_post"><li><a href="http://imcat.in/teach-you-step-by-step-install-nginx-php-mysql/" title="一步一步教你安装Nginx+PHP+Mysql">一步一步教你安装Nginx+PHP+Mysql</a> (60)</li><li><a href="http://imcat.in/the-latest-linux-under-nginx-mysql-php-memcache-vsftpd-one-click-installation-package/" title="最新Linux下的Nginx+MySQL+PHP+Memcache+Vsftpd一键安装包">最新Linux下的Nginx+MySQL+PHP+Memcache+Vsftpd一键安装包</a> (37)</li><li><a href="http://imcat.in/litespeed-mysql-php-install/" title="简单的llmp(Litespeed+mysql+php)安装教程">简单的llmp(Litespeed+mysql+php)安装教程</a> (17)</li><li><a href="http://imcat.in/suhosin-protect-your-php/" title="Suhosin &#8211; 保护你的PHP">Suhosin &#8211; 保护你的PHP</a> (10)</li><li><a href="http://imcat.in/wordpress-on-nginx-apache-mod_rewrite-enabled/" title="WordPress在Nginx中启用Apache的mod_rewrite">WordPress在Nginx中启用Apache的mod_rewrite</a> (7)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://imcat.in/debian-install-nginx-php-spawn-fcgi-mysql/feed/</wfw:commentRss>
		<slash:comments>10</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 暧味日志简单的llmp(Litespeed+mysql+php)安装教程 (17)删除Mysql的MySql-bin.0000X日志文件 (3)一步一步教你安装Nginx+PHP+Mysql (60)debian安装nginx+php(spawn-fcgi)+mysql (10)自动备份mysql数据库并发送到Email (20)]]></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>
<h2  class="related_post_title">暧味日志</h2><ul class="related_post"><li><a href="http://imcat.in/litespeed-mysql-php-install/" title="简单的llmp(Litespeed+mysql+php)安装教程">简单的llmp(Litespeed+mysql+php)安装教程</a> (17)</li><li><a href="http://imcat.in/delete-mysql-bin-0000x-mysql-log-file/" title="删除Mysql的MySql-bin.0000X日志文件">删除Mysql的MySql-bin.0000X日志文件</a> (3)</li><li><a href="http://imcat.in/teach-you-step-by-step-install-nginx-php-mysql/" title="一步一步教你安装Nginx+PHP+Mysql">一步一步教你安装Nginx+PHP+Mysql</a> (60)</li><li><a href="http://imcat.in/debian-install-nginx-php-spawn-fcgi-mysql/" title="debian安装nginx+php(spawn-fcgi)+mysql">debian安装nginx+php(spawn-fcgi)+mysql</a> (10)</li><li><a href="http://imcat.in/backup-mysql-databases-automatically-sent-to-email/" title="自动备份mysql数据库并发送到Email">自动备份mysql数据库并发送到Email</a> (20)</li></ul>]]></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>
<h2  class="related_post_title">暧味日志</h2><ul class="related_post"><li><a href="http://imcat.in/litespeed-mysql-php-install/" title="简单的llmp(Litespeed+mysql+php)安装教程">简单的llmp(Litespeed+mysql+php)安装教程</a> (17)</li><li><a href="http://imcat.in/auto-backup-site-files-database-upload-ftp/" title="自动备份网站文件和数据库上传到FTP空间">自动备份网站文件和数据库上传到FTP空间</a> (39)</li><li><a href="http://imcat.in/delete-mysql-bin-0000x-mysql-log-file/" title="删除Mysql的MySql-bin.0000X日志文件">删除Mysql的MySql-bin.0000X日志文件</a> (3)</li><li><a href="http://imcat.in/teach-you-step-by-step-install-nginx-php-mysql/" title="一步一步教你安装Nginx+PHP+Mysql">一步一步教你安装Nginx+PHP+Mysql</a> (60)</li><li><a href="http://imcat.in/debian-install-nginx-php-spawn-fcgi-mysql/" title="debian安装nginx+php(spawn-fcgi)+mysql">debian安装nginx+php(spawn-fcgi)+mysql</a> (10)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://imcat.in/backup-mysql-databases-automatically-sent-to-email/feed/</wfw:commentRss>
		<slash:comments>20</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>
<h2  class="related_post_title">暧味日志</h2><ul class="related_post"><li><a href="http://imcat.in/teach-you-step-by-step-install-nginx-php-mysql/" title="一步一步教你安装Nginx+PHP+Mysql">一步一步教你安装Nginx+PHP+Mysql</a> (60)</li><li><a href="http://imcat.in/debian-install-nginx-php-spawn-fcgi-mysql/" title="debian安装nginx+php(spawn-fcgi)+mysql">debian安装nginx+php(spawn-fcgi)+mysql</a> (10)</li><li><a href="http://imcat.in/litespeed-mysql-php-install/" title="简单的llmp(Litespeed+mysql+php)安装教程">简单的llmp(Litespeed+mysql+php)安装教程</a> (17)</li><li><a href="http://imcat.in/lnmp-installation-package-upgrade-latest-version-nginx/" title="LNMP 一键安装包平滑升级 Nginx 到最新版本">LNMP 一键安装包平滑升级 Nginx 到最新版本</a> (10)</li><li><a href="http://imcat.in/suhosin-protect-your-php/" title="Suhosin &#8211; 保护你的PHP">Suhosin &#8211; 保护你的PHP</a> (10)</li></ul>]]></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>37</slash:comments>
		</item>
	</channel>
</rss>

