<?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; CentOS</title>
	<atom:link href="http://www.080909.com/wordpress/tag/centos/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.080909.com/wordpress</link>
	<description>自由空间</description>
	<lastBuildDate>Fri, 03 Sep 2010 05:23:20 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
	<atom:link rel='hub' href='http://www.080909.com/wordpress/?pushpress=hub'/>
		<item>
		<title>Centos下安装Nginx 0.8.30 + PHP 5.3.1+MySQL 5.5.0</title>
		<link>http://www.080909.com/wordpress/2010/01/centos-install-nginx-0-8-30-php-5-3-1-mysql-5-5-0/</link>
		<comments>http://www.080909.com/wordpress/2010/01/centos-install-nginx-0-8-30-php-5-3-1-mysql-5-5-0/#comments</comments>
		<pubDate>Sun, 10 Jan 2010 13:28:20 +0000</pubDate>
		<dc:creator>icemanpro</dc:creator>
				<category><![CDATA[IT]]></category>
		<category><![CDATA[CentOS]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[phpmyadmin]]></category>

		<guid isPermaLink="false">http://www.080909.com/wordpress/?p=437</guid>
		<description><![CDATA[首先在安装完CentOS后，先&#8221;yum -y update&#8221;，升级下CentOS。然后运行以下命令，以便安装所需要的程序以及开发库。 ?View Code BASHyum -y install gcc gcc-c++ autoconf libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel zlib zlib-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel ncurses ncurses-devel curl curl-devel e2fsprogs e2fsprogs-devel krb5 krb5-devel libidn libidn-devel openssl openssl-devel openldap openldap-devel nss_ldap openldap-clients openldap-servers libmcrypt libmcrypt-devel pcre-devel 进入/usr/local/src目录，下载程序源代码。 ?View Code BASHcd /usr/local/src wget http://nginx.org/download/nginx-0.8.30.tar.gz wget [...]]]></description>
			<content:encoded><![CDATA[<p>首先在安装完CentOS后，先&#8221;yum -y update&#8221;，升级下CentOS。然后运行以下命令，以便安装所需要的程序以及开发库。</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p437code20'); return false;">View Code</a> BASH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p43720"><td class="code" id="p437code20"><pre class="bash" style="font-family:monospace;">yum <span style="color: #660033;">-y</span> <span style="color: #c20cb9; font-weight: bold;">install</span> <span style="color: #c20cb9; font-weight: bold;">gcc</span> gcc-c++ <span style="color: #c20cb9; font-weight: bold;">autoconf</span> libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel zlib zlib-devel glibc glibc-devel glib2 glib2-devel <span style="color: #c20cb9; font-weight: bold;">bzip2</span> bzip2-devel ncurses ncurses-devel curl curl-devel e2fsprogs e2fsprogs-devel krb5 krb5-devel libidn libidn-devel openssl openssl-devel openldap openldap-devel nss_ldap openldap-clients openldap-servers libmcrypt libmcrypt-devel pcre-devel</pre></td></tr></table></div>

<p>进入/usr/local/src目录，下载程序源代码。</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p437code21'); return false;">View Code</a> BASH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p43721"><td class="code" id="p437code21"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>src
<span style="color: #c20cb9; font-weight: bold;">wget</span> http:<span style="color: #000000; font-weight: bold;">//</span>nginx.org<span style="color: #000000; font-weight: bold;">/</span>download<span style="color: #000000; font-weight: bold;">/</span>nginx-0.8.30.tar.gz
<span style="color: #c20cb9; font-weight: bold;">wget</span> http:<span style="color: #000000; font-weight: bold;">//</span>cn2.php.net<span style="color: #000000; font-weight: bold;">/</span>get<span style="color: #000000; font-weight: bold;">/</span>php-5.3.1.tar.gz<span style="color: #000000; font-weight: bold;">/</span>from<span style="color: #000000; font-weight: bold;">/</span>cn.php.net<span style="color: #000000; font-weight: bold;">/</span>mirror
<span style="color: #c20cb9; font-weight: bold;">wget</span> http:<span style="color: #000000; font-weight: bold;">//</span>dev.mysql.com<span style="color: #000000; font-weight: bold;">/</span>get<span style="color: #000000; font-weight: bold;">/</span>Downloads<span style="color: #000000; font-weight: bold;">/</span>MySQL-<span style="color: #000000;">5.5</span><span style="color: #000000; font-weight: bold;">/</span>mysql-5.5.0-m2.tar.gz<span style="color: #000000; font-weight: bold;">/</span>from<span style="color: #000000; font-weight: bold;">/</span>http:<span style="color: #000000; font-weight: bold;">//</span>opensource.become.com<span style="color: #000000; font-weight: bold;">/</span>mysql<span style="color: #000000; font-weight: bold;">/</span>
<span style="color: #c20cb9; font-weight: bold;">wget</span> http:<span style="color: #000000; font-weight: bold;">//</span>download.suhosin.org<span style="color: #000000; font-weight: bold;">/</span>suhosin-patch-5.3.1-0.9.8.patch.gz
<span style="color: #c20cb9; font-weight: bold;">wget</span> http:<span style="color: #000000; font-weight: bold;">//</span>launchpad.net<span style="color: #000000; font-weight: bold;">/</span>php-fpm<span style="color: #000000; font-weight: bold;">/</span>master<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">0.6</span><span style="color: #000000; font-weight: bold;">/</span>+download<span style="color: #000000; font-weight: bold;">/</span>php-fpm-<span style="color: #000000;">0.6</span>~5.3.1.tar.gz
<span style="color: #c20cb9; font-weight: bold;">wget</span> http:<span style="color: #000000; font-weight: bold;">//</span>www.monkey.org<span style="color: #000000; font-weight: bold;">/</span>~provos<span style="color: #000000; font-weight: bold;">/</span>libevent-1.4.13-stable.tar.gz</pre></td></tr></table></div>

<p><span id="more-437"></span></p>
<p>1、编译MySqL 5.5.0</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p437code22'); return false;">View Code</a> BASH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p43722"><td class="code" id="p437code22"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>src
<span style="color: #c20cb9; font-weight: bold;">tar</span> <span style="color: #660033;">-xzvf</span> mysql-5.5.0-m2.tar.gz
<span style="color: #7a0874; font-weight: bold;">cd</span> mysql-5.5.0-m2
.<span style="color: #000000; font-weight: bold;">/</span>configure <span style="color: #660033;">--prefix</span>=<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>mysql <span style="color: #660033;">--localstatedir</span>=<span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>mysql <span style="color: #660033;">--with-comment</span>=Source <span style="color: #660033;">--with-server-suffix</span>=-enterprise-gpl <span style="color: #660033;">--with-mysqld-user</span>=mysql <span style="color: #660033;">--without-debug</span> <span style="color: #660033;">--with-big-tables</span> <span style="color: #660033;">--with-charset</span>=utf8 <span style="color: #660033;">--with-collation</span>=utf8_general_ci <span style="color: #660033;">--with-extra-charsets</span>=gbk,latin1 <span style="color: #660033;">--with-pthread</span> <span style="color: #660033;">--enable-static</span> <span style="color: #660033;">--with-client-ldflags</span>=-all-static <span style="color: #660033;">--with-mysqld-ldflags</span>=-all-static <span style="color: #660033;">--enable-assembler</span> <span style="color: #660033;">--without-ndb-debug</span> <span style="color: #660033;">--enable-local-infile</span> <span style="color: #660033;">--with-readline</span>
<span style="color: #c20cb9; font-weight: bold;">make</span> <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> <span style="color: #c20cb9; font-weight: bold;">make</span> <span style="color: #c20cb9; font-weight: bold;">install</span></pre></td></tr></table></div>

<p>在安装完MySQL之后，添加mysql用户。</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p437code23'); return false;">View Code</a> BASH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p43723"><td class="code" id="p437code23"><pre class="bash" style="font-family:monospace;">useradd mysql <span style="color: #666666; font-style: italic;">#添加 mysql 用户</span>
<span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>mysql
bin<span style="color: #000000; font-weight: bold;">/</span>mysql_install_db <span style="color: #660033;">--user</span>=mysql
<span style="color: #c20cb9; font-weight: bold;">chown</span> <span style="color: #660033;">-R</span> root:mysql . <span style="color: #666666; font-style: italic;">#设置权限，注意后面有一个 &quot;.&quot;</span>
<span style="color: #c20cb9; font-weight: bold;">chown</span> <span style="color: #660033;">-R</span> mysql <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>mysql <span style="color: #666666; font-style: italic;">#设置 mysql 目录权限</span>
<span style="color: #c20cb9; font-weight: bold;">chgrp</span> <span style="color: #660033;">-R</span> mysql . <span style="color: #666666; font-style: italic;">#注意后面有一个 &quot;.&quot;</span>
<span style="color: #c20cb9; font-weight: bold;">cp</span> share<span style="color: #000000; font-weight: bold;">/</span>mysql<span style="color: #000000; font-weight: bold;">/</span>my-medium.cnf <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>my.cnf
<span style="color: #c20cb9; font-weight: bold;">cp</span> share<span style="color: #000000; font-weight: bold;">/</span>mysql<span style="color: #000000; font-weight: bold;">/</span>mysql.server <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>rc.d<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>mysqld <span style="color: #666666; font-style: italic;">#开机自动启动 mysql。</span>
<span style="color: #c20cb9; font-weight: bold;">chmod</span> <span style="color: #000000;">755</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>rc.d<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>mysqld
chkconfig <span style="color: #660033;">--add</span> mysqld
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;/usr/local/mysql/lib&quot;</span> <span style="color: #000000; font-weight: bold;">&gt;&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>ld.so.conf <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> ldconfig
&nbsp;
<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>rc.d<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>mysqld start <span style="color: #666666; font-style: italic;">#启动 MySQL</span>
bin<span style="color: #000000; font-weight: bold;">/</span>mysqladmin <span style="color: #660033;">-u</span> root password <span style="color: #ff0000;">&quot;123456&quot;</span> <span style="color: #666666; font-style: italic;">#设置Mysql的root密码</span>
service mysqld stop <span style="color: #666666; font-style: italic;">#关闭 MySQL</span></pre></td></tr></table></div>

<p>2.编译PHP 5.3.1</p>
<p><a href="http://www.hardened-php.net/suhosin/index.html">Suhosin</a>是朝鲜语“守护神”的音译，是一个专门的安全小组开发的专门针对php进行安全加固的补丁程 序，已经进入freebsd gentoo的ports系统。效果很好的。</p>
<p>安装方法如下：</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p437code24'); return false;">View Code</a> BASH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p43724"><td class="code" id="p437code24"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">tar</span> <span style="color: #660033;">-xvzf</span> php-5.3.1.tar.gz
<span style="color: #c20cb9; font-weight: bold;">gunzip</span> suhosin-patch-5.3.1-0.9.8.patch.gz
<span style="color: #7a0874; font-weight: bold;">cd</span> php-5.3.1
<span style="color: #c20cb9; font-weight: bold;">patch</span> <span style="color: #660033;">-p</span> <span style="color: #000000;">1</span> <span style="color: #660033;">-i</span> ..<span style="color: #000000; font-weight: bold;">/</span>suhosin-patch-5.3.1-0.9.8.patch
.<span style="color: #000000; font-weight: bold;">/</span>buildconf <span style="color: #660033;">--force</span> <span style="color: #666666; font-style: italic;">#将其编译到静态内核中</span></pre></td></tr></table></div>

<p>在使用FastCGI方式运行php的时候，如果我们改变了php.ini的设置，就得重新启动php的fastcgi守护程序。如果你的系统负载 比较大的话，这个重启过程或许会让你的系统中断服务一段时间。<a href="http://php-fpm.org/">php-fpm</a>就是为了解决这个问题而诞生的，它可以在php的fastcgi进程不中断的 情况下重新加载你改动过的php.ini。而且php-fpm可以不用再依赖其它的fastcgi启动器，比如lighttpd的spawn-fcgi。</p>
<p>首先编译PHP-FPM需要安装的<a href="http://www.monkey.org/~provos/libevent/">libevent</a>。</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p437code25'); return false;">View Code</a> BASH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p43725"><td class="code" id="p437code25"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">tar</span> <span style="color: #660033;">-zxvf</span> <span style="color: #ff0000;">&quot;libevent-1.4.13-stable.tar.gz&quot;</span>
<span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #ff0000;">&quot;libevent-1.4.13-stable&quot;</span>
.<span style="color: #000000; font-weight: bold;">/</span>configure <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> <span style="color: #c20cb9; font-weight: bold;">make</span>
<span style="color: #c20cb9; font-weight: bold;">make</span> <span style="color: #c20cb9; font-weight: bold;">install</span></pre></td></tr></table></div>


<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p437code26'); return false;">View Code</a> BASH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p43726"><td class="code" id="p437code26"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">PHP_VER</span>=5.3.1
<span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>src
<span style="color: #c20cb9; font-weight: bold;">tar</span> <span style="color: #660033;">-zxvf</span> <span style="color: #ff0000;">&quot;php-fpm-0.6~<span style="color: #007800;">$PHP_VER</span>.tar.gz&quot;</span>
<span style="color: #ff0000;">&quot;php-fpm-0.6-<span style="color: #007800;">$PHP_VER</span>/generate-fpm-patch&quot;</span>
<span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #ff0000;">&quot;php-<span style="color: #007800;">$PHP_VER</span>&quot;</span>
<span style="color: #c20cb9; font-weight: bold;">patch</span> <span style="color: #660033;">-p1</span> <span style="color: #000000; font-weight: bold;">&lt;</span> ..<span style="color: #000000; font-weight: bold;">/</span>fpm.patch
.<span style="color: #000000; font-weight: bold;">/</span>buildconf <span style="color: #660033;">--force</span></pre></td></tr></table></div>

<p>编译、安装PHP</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p437code27'); return false;">View Code</a> BASH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p43727"><td class="code" id="p437code27"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>src<span style="color: #000000; font-weight: bold;">/</span>php-5.3.1
<span style="color: #c20cb9; font-weight: bold;">mkdir</span> fpm-build <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> <span style="color: #7a0874; font-weight: bold;">cd</span> fpm-build
..<span style="color: #000000; font-weight: bold;">/</span>configure <span style="color: #660033;">--prefix</span>=<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>webserver<span style="color: #000000; font-weight: bold;">/</span>php <span style="color: #660033;">--with-pear</span>=<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>share<span style="color: #000000; font-weight: bold;">/</span>php <span style="color: #660033;">--with-zlib-dir</span> <span style="color: #660033;">--with-bz2</span> <span style="color: #660033;">--with-libxml-dir</span>=<span style="color: #000000; font-weight: bold;">/</span>usr <span style="color: #660033;">--enable-gd-native-ttf</span> <span style="color: #660033;">--enable-gd-jis-conv</span> <span style="color: #660033;">--with-freetype-dir</span> <span style="color: #660033;">--with-jpeg-dir</span> <span style="color: #660033;">--with-png-dir</span> <span style="color: #660033;">--with-ttf</span>=shared,<span style="color: #000000; font-weight: bold;">/</span>usr <span style="color: #660033;">--enable-mbstring</span> <span style="color: #660033;">--with-mysql</span>=<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>mysql <span style="color: #660033;">--with-mysqli</span>=<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>mysql<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>mysql_config <span style="color: #660033;">--with-config-file-path</span>=<span style="color: #000000; font-weight: bold;">/</span>etc <span style="color: #660033;">--with-iconv</span> <span style="color: #660033;">--disable-ipv6</span> <span style="color: #660033;">--enable-static</span> <span style="color: #660033;">--enable-zend-multibyte</span> <span style="color: #660033;">--enable-inline-optimization</span> <span style="color: #660033;">--enable-zend-multibyte</span> <span style="color: #660033;">--enable-sockets</span> <span style="color: #660033;">--enable-soap</span> <span style="color: #660033;">--with-openssl</span> <span style="color: #660033;">--with-gettext</span> <span style="color: #660033;">--enable-sysvsem</span> <span style="color: #660033;">--enable-mbregex</span> <span style="color: #660033;">--enable-fastcgi</span> <span style="color: #660033;">--enable-fpm</span> <span style="color: #660033;">--enable-force-cgi-redirect</span> <span style="color: #660033;">--with-mcrypt</span> <span style="color: #660033;">--with-curl</span> <span style="color: #660033;">--with-curlwrappers</span> <span style="color: #660033;">--enable-mbregex</span> <span style="color: #660033;">--enable-bcmath</span> <span style="color: #660033;">--enable-shmop</span> <span style="color: #660033;">--enable-suhosin</span> <span style="color: #660033;">--with-fpm</span> <span style="color: #660033;">--with-libevent</span>=shared,<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>lib <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> <span style="color: #c20cb9; font-weight: bold;">make</span> <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> <span style="color: #c20cb9; font-weight: bold;">make</span> <span style="color: #c20cb9; font-weight: bold;">install</span>
<span style="color: #c20cb9; font-weight: bold;">cp</span> php.ini-production <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>php.ini
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;/usr/local/webserver/php/lib&quot;</span> <span style="color: #000000; font-weight: bold;">&gt;&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>ld.so.conf <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> ldconfig</pre></td></tr></table></div>

<p>创建www用户和组，以及供虚拟主机使用的目录：</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p437code28'); return false;">View Code</a> BASH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p43728"><td class="code" id="p437code28"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>groupadd www <span style="color: #660033;">-g</span> <span style="color: #000000;">48</span>
<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>useradd <span style="color: #660033;">-u</span> <span style="color: #000000;">48</span> <span style="color: #660033;">-g</span> www www
<span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #660033;">-p</span> <span style="color: #000000; font-weight: bold;">/</span>website<span style="color: #000000; font-weight: bold;">/</span>htdocs<span style="color: #000000; font-weight: bold;">/</span>blog
<span style="color: #c20cb9; font-weight: bold;">chmod</span> +<span style="color: #c20cb9; font-weight: bold;">w</span> <span style="color: #000000; font-weight: bold;">/</span>website<span style="color: #000000; font-weight: bold;">/</span>htdocs<span style="color: #000000; font-weight: bold;">/</span>blog
<span style="color: #c20cb9; font-weight: bold;">chown</span> <span style="color: #660033;">-R</span> www:www <span style="color: #000000; font-weight: bold;">/</span>website<span style="color: #000000; font-weight: bold;">/</span>htdocs<span style="color: #000000; font-weight: bold;">/</span>blog
<span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #660033;">-p</span> <span style="color: #000000; font-weight: bold;">/</span>website<span style="color: #000000; font-weight: bold;">/</span>htdocs<span style="color: #000000; font-weight: bold;">/</span>www
<span style="color: #c20cb9; font-weight: bold;">chmod</span> +<span style="color: #c20cb9; font-weight: bold;">w</span> <span style="color: #000000; font-weight: bold;">/</span>website<span style="color: #000000; font-weight: bold;">/</span>htdocs<span style="color: #000000; font-weight: bold;">/</span>www
<span style="color: #c20cb9; font-weight: bold;">chown</span> <span style="color: #660033;">-R</span> www:www <span style="color: #000000; font-weight: bold;">/</span>website<span style="color: #000000; font-weight: bold;">/</span>htdocs<span style="color: #000000; font-weight: bold;">/</span>www</pre></td></tr></table></div>

<p>创建php-fpm配置文件：</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p437code29'); return false;">View Code</a> BASH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p43729"><td class="code" id="p437code29"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>webserver<span style="color: #000000; font-weight: bold;">/</span>php<span style="color: #000000; font-weight: bold;">/</span>logs
<span style="color: #c20cb9; font-weight: bold;">cp</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>src<span style="color: #000000; font-weight: bold;">/</span>php-fpm-<span style="color: #000000;">0.6</span>-5.3.1<span style="color: #000000; font-weight: bold;">/</span>conf<span style="color: #000000; font-weight: bold;">/</span>php-fpm.conf.in <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>webserver<span style="color: #000000; font-weight: bold;">/</span>php<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>php-fpm.conf
<span style="color: #c20cb9; font-weight: bold;">vi</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>webserver<span style="color: #000000; font-weight: bold;">/</span>php<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>php-fpm.conf</pre></td></tr></table></div>

<p>按下面内容修改php-fpm.conf文件</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left2">Download <a href="http://www.080909.com/wordpress/wp-content/plugins/wp-codebox/wp-codebox.php?p=437&amp;download=php-fpm.conf">php-fpm.conf</a></span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p43730"><td class="code" id="p437code30"><pre class="text" style="font-family:monospace;">&lt;?xml version=&quot;1.0&quot; ?&gt;
&lt;configuration&gt;
	All relative paths in this config are relative to php's install prefix
	&lt;section name=&quot;global_options&quot;&gt;
		Pid file
		&lt;value name=&quot;pid_file&quot;&gt;/usr/local/webserver/php/logs/php-fpm.pid&lt;/value&gt;
		Error log file
		&lt;value name=&quot;error_log&quot;&gt;/usr/local/webserver/php/logs/php-fpm.log&lt;/value&gt;
		Log level
		&lt;value name=&quot;log_level&quot;&gt;notice&lt;/value&gt;
		When this amount of php processes exited with SIGSEGV or SIGBUS ...
		&lt;value name=&quot;emergency_restart_threshold&quot;&gt;10&lt;/value&gt;
		... in a less than this interval of time, a graceful restart will be initiated.
		Useful to work around accidental curruptions in accelerator's shared memory.
		&lt;value name=&quot;emergency_restart_interval&quot;&gt;1m&lt;/value&gt;
		Time limit on waiting child's reaction on signals from master
		&lt;value name=&quot;process_control_timeout&quot;&gt;5s&lt;/value&gt;
		Set to 'no' to debug fpm
		&lt;value name=&quot;daemonize&quot;&gt;yes&lt;/value&gt;
	&lt;/section&gt;
	&lt;workers&gt;
		&lt;section name=&quot;pool&quot;&gt;
			Name of pool. Used in logs and stats.
			&lt;value name=&quot;name&quot;&gt;default&lt;/value&gt;
			Address to accept fastcgi requests on.
			Valid syntax is 'ip.ad.re.ss:port' or just 'port' or '/path/to/unix/socket'
			&lt;value name=&quot;listen_address&quot;&gt;127.0.0.1:9000&lt;/value&gt;
			&lt;value name=&quot;listen_options&quot;&gt;
				Set listen(2) backlog
				&lt;value name=&quot;backlog&quot;&gt;-1&lt;/value&gt;
				Set permissions for unix socket, if one used.
				In Linux read/write permissions must be set in order to allow connections from web server.
				Many BSD-derrived systems allow connections regardless of permissions.
				&lt;value name=&quot;owner&quot;&gt;&lt;/value&gt;
				&lt;value name=&quot;group&quot;&gt;&lt;/value&gt;
				&lt;value name=&quot;mode&quot;&gt;0666&lt;/value&gt;
			&lt;/value&gt;
&nbsp;
			Additional php.ini defines, specific to this pool of workers.
			These settings overwrite the values previously defined in the php.ini.
			&lt;value name=&quot;php_defines&quot;&gt;
				&lt;!-- &lt;value name=&quot;sendmail_path&quot;&gt;/usr/sbin/sendmail -t -i&lt;/value&gt; --&gt;
			 &lt;value name=&quot;display_errors&quot;&gt;1&lt;/value&gt; 
				&lt;!-- &lt;value name=&quot;error_log&quot;&gt;/var/log/php-error.log&lt;/value&gt; --&gt;
        		&lt;!-- &lt;value name=&quot;log_errors&quot;&gt;true&lt;/value&gt; --&gt;
			&lt;/value&gt;
&nbsp;
			Unix user of processes
			&lt;value name=&quot;user&quot;&gt;www&lt;/value&gt;
			Unix group of processes
			&lt;value name=&quot;group&quot;&gt;www&lt;/value&gt;
			Process manager settings
			&lt;value name=&quot;pm&quot;&gt;
				Sets style of controling worker process count.
				Valid values are 'static' and 'apache-like'
				&lt;value name=&quot;style&quot;&gt;static&lt;/value&gt;
				Sets the limit on the number of simultaneous requests that will be served.
				Equivalent to Apache MaxClients directive.
				Equivalent to PHP_FCGI_CHILDREN environment in original php.fcgi
				Used with any pm_style.
				&lt;value name=&quot;max_children&quot;&gt;128&lt;/value&gt;
				Settings group for 'apache-like' pm style
				&lt;value name=&quot;apache_like&quot;&gt;
					Sets the number of server processes created on startup.
					Used only when 'apache-like' pm_style is selected
					&lt;value name=&quot;StartServers&quot;&gt;20&lt;/value&gt;
					Sets the desired minimum number of idle server processes.
					Used only when 'apache-like' pm_style is selected
					&lt;value name=&quot;MinSpareServers&quot;&gt;5&lt;/value&gt;
					Sets the desired maximum number of idle server processes.
					Used only when 'apache-like' pm_style is selected
					&lt;value name=&quot;MaxSpareServers&quot;&gt;35&lt;/value&gt;
				&lt;/value&gt;
			&lt;/value&gt;
			The timeout (in seconds) for serving a single request after which the worker process will be terminated
			Should be used when 'max_execution_time' ini option does not stop script execution for some reason
			'0s' means 'off'
			&lt;value name=&quot;request_terminate_timeout&quot;&gt;0s&lt;/value&gt;
			The timeout (in seconds) for serving of single request after which a php backtrace will be dumped to slow.log file
			'0s' means 'off'
			&lt;value name=&quot;request_slowlog_timeout&quot;&gt;0s&lt;/value&gt;
			The log file for slow requests
			&lt;value name=&quot;slowlog&quot;&gt;logs/slow.log&lt;/value&gt;
			Set open file desc rlimit
			&lt;value name=&quot;rlimit_files&quot;&gt;51200&lt;/value&gt;
			Set max core size rlimit
			&lt;value name=&quot;rlimit_core&quot;&gt;0&lt;/value&gt;
			Chroot to this directory at the start, absolute path
			&lt;value name=&quot;chroot&quot;&gt;&lt;/value&gt;
			Chdir to this directory at the start, absolute path
			&lt;value name=&quot;chdir&quot;&gt;&lt;/value&gt;
			Redirect workers' stdout and stderr into main error log.
			If not set, they will be redirected to /dev/null, according to FastCGI specs
			&lt;value name=&quot;catch_workers_output&quot;&gt;yes&lt;/value&gt;
			How much requests each process should execute before respawn.
			Useful to work around memory leaks in 3rd party libraries.
			For endless request processing please specify 0
			Equivalent to PHP_FCGI_MAX_REQUESTS
			&lt;value name=&quot;max_requests&quot;&gt;10240&lt;/value&gt;
			Comma separated list of ipv4 addresses of FastCGI clients that allowed to connect.
			Equivalent to FCGI_WEB_SERVER_ADDRS environment in original php.fcgi (5.2.2+)
			Makes sense only with AF_INET listening socket.
			&lt;value name=&quot;allowed_clients&quot;&gt;127.0.0.1&lt;/value&gt;
			Pass environment variables like LD_LIBRARY_PATH
			All $VARIABLEs are taken from current environment
			&lt;value name=&quot;environment&quot;&gt;
				&lt;value name=&quot;HOSTNAME&quot;&gt;$HOSTNAME&lt;/value&gt;
				&lt;value name=&quot;PATH&quot;&gt;/usr/local/bin:/usr/bin:/bin&lt;/value&gt;
				&lt;value name=&quot;TMP&quot;&gt;/tmp&lt;/value&gt;
				&lt;value name=&quot;TMPDIR&quot;&gt;/tmp&lt;/value&gt;
				&lt;value name=&quot;TEMP&quot;&gt;/tmp&lt;/value&gt;
				&lt;value name=&quot;OSTYPE&quot;&gt;$OSTYPE&lt;/value&gt;
				&lt;value name=&quot;MACHTYPE&quot;&gt;$MACHTYPE&lt;/value&gt;
				&lt;value name=&quot;MALLOC_CHECK_&quot;&gt;2&lt;/value&gt;
			&lt;/value&gt;
		&lt;/section&gt;
	&lt;/workers&gt;
&lt;/configuration&gt;</pre></td></tr></table></div>

<p>3. 编译安装 nginx</p>
<p><a href="http://www.nginx.net">Nginx</a> (&#8220;engine x&#8221;) 是一个高性能的 HTTP 和反向代理服务器，也是一个 IMAP/POP3/SMTP 代理服务器。 Nginx 是由 Igor Sysoev 为俄罗斯访问量第二的 Rambler.ru 站点开发的，它已经在该站点运行超过两年半了。Igor 将源代码以类BSD许可证的形式发布。</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p437code31'); return false;">View Code</a> BASH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p43731"><td class="code" id="p437code31"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>src
<span style="color: #c20cb9; font-weight: bold;">tar</span> zxvf nginx-0.8.30.tar.gz
<span style="color: #7a0874; font-weight: bold;">cd</span> nginx-0.8.30
.<span style="color: #000000; font-weight: bold;">/</span>configure <span style="color: #660033;">--user</span>=www <span style="color: #660033;">--group</span>=www <span style="color: #660033;">--prefix</span>=<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>webserver<span style="color: #000000; font-weight: bold;">/</span>nginx --with-http_stub_status_module --with-http_ssl_module
<span style="color: #c20cb9; font-weight: bold;">make</span>
<span style="color: #c20cb9; font-weight: bold;">make</span> <span style="color: #c20cb9; font-weight: bold;">install</span></pre></td></tr></table></div>

<p>创建Nginx日志目录</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p437code32'); return false;">View Code</a> BASH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p43732"><td class="code" id="p437code32"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #660033;">-p</span> <span style="color: #000000; font-weight: bold;">/</span>website<span style="color: #000000; font-weight: bold;">/</span>logs
<span style="color: #c20cb9; font-weight: bold;">chmod</span> +<span style="color: #c20cb9; font-weight: bold;">w</span> <span style="color: #000000; font-weight: bold;">/</span>website<span style="color: #000000; font-weight: bold;">/</span>logs
<span style="color: #c20cb9; font-weight: bold;">chown</span> <span style="color: #660033;">-R</span> www:www <span style="color: #000000; font-weight: bold;">/</span>website<span style="color: #000000; font-weight: bold;">/</span>logs</pre></td></tr></table></div>

<p>创建Nginx配置文件</p>
<p>①、在/usr/local/webserver/nginx/conf/目录中创建nginx.conf文件：</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p437code33'); return false;">View Code</a> BASH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p43733"><td class="code" id="p437code33"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #660033;">-f</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>webserver<span style="color: #000000; font-weight: bold;">/</span>nginx<span style="color: #000000; font-weight: bold;">/</span>conf<span style="color: #000000; font-weight: bold;">/</span>nginx.conf
<span style="color: #c20cb9; font-weight: bold;">vi</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>webserver<span style="color: #000000; font-weight: bold;">/</span>nginx<span style="color: #000000; font-weight: bold;">/</span>conf<span style="color: #000000; font-weight: bold;">/</span>nginx.conf</pre></td></tr></table></div>

<p>输入以下内容：</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left2">Download <a href="http://www.080909.com/wordpress/wp-content/plugins/wp-codebox/wp-codebox.php?p=437&amp;download=nginx.conf">nginx.conf</a></span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p43734"><td class="code" id="p437code34"><pre class="text" style="font-family:monospace;">user  www www;
worker_processes 8;
error_log /website/logs/nginx_error.log crit;
pid /usr/local/webserver/nginx/nginx.pid;
#Specifies the value for maximum file descriptors that can be opened by this process.
worker_rlimit_nofile 65535;
events
{
  use epoll;
  worker_connections 65535;
}
http
{
  include       mime.types;
  default_type  application/octet-stream;
  #charset  gb2312;
  server_names_hash_bucket_size 128;
  client_header_buffer_size 32k;
  large_client_header_buffers 4 32k;
  client_max_body_size 8m;
&nbsp;
  sendfile on;
  tcp_nopush     on;
&nbsp;
  keepalive_timeout 60;
&nbsp;
  tcp_nodelay on;
&nbsp;
  fastcgi_connect_timeout 300;
  fastcgi_send_timeout 300;
  fastcgi_read_timeout 300;
  fastcgi_buffer_size 64k;
  fastcgi_buffers 4 64k;
  fastcgi_busy_buffers_size 128k;
  fastcgi_temp_file_write_size 128k;
&nbsp;
  gzip on;
  gzip_min_length  1k;
  gzip_buffers     4 16k;
  gzip_http_version 1.0;
  gzip_comp_level 2;
  gzip_types  text/plain application/x-javascript text/css application/xml;
  gzip_vary on;
&nbsp;
  #limit_zone  crawler  $binary_remote_addr  10m;
  server
  {
    listen       80;
    server_name  192.168.10.34;
    index index.html index.htm index.php;
    root  /website/htdocs/www;
&nbsp;
    #limit_conn   crawler  20;    
&nbsp;
    location ~ .*\.(php|php5)?$
    {      
      #fastcgi_pass  unix:/tmp/php-cgi.sock;
      fastcgi_pass  127.0.0.1:9000;
      fastcgi_index index.php;
      include fcgi.conf;
    }
&nbsp;
    location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
    {
      expires      30d;
    }
&nbsp;
    location ~ .*\.(js|css)?$
    {
      expires      1h;
    }    
 }
}</pre></td></tr></table></div>

<p>②、在/usr/local/webserver/nginx/conf/目录中创建fcgi.conf文件，输入以下内容：</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left2">Download <a href="http://www.080909.com/wordpress/wp-content/plugins/wp-codebox/wp-codebox.php?p=437&amp;download=fcgi.conf">fcgi.conf</a></span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p43735"><td class="code" id="p437code35"><pre class="text" style="font-family:monospace;">fastcgi_param GATEWAY_INTERFACE CGI/1.1;
fastcgi_param SERVER_SOFTWARE nginx;
fastcgi_param QUERY_STRING $query_string;
fastcgi_param REQUEST_METHOD $request_method;
fastcgi_param CONTENT_TYPE $content_type;
fastcgi_param CONTENT_LENGTH $content_length;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
fastcgi_param REQUEST_URI $request_uri;
fastcgi_param DOCUMENT_URI $document_uri;
fastcgi_param DOCUMENT_ROOT $document_root;
fastcgi_param SERVER_PROTOCOL $server_protocol;
fastcgi_param REMOTE_ADDR $remote_addr;
fastcgi_param REMOTE_PORT $remote_port;
fastcgi_param SERVER_ADDR $server_addr;
fastcgi_param SERVER_PORT $server_port;
fastcgi_param SERVER_NAME $server_name;
# PHP only, required if PHP was built with --enable-force-cgi-redirect
fastcgi_param REDIRECT_STATUS 200;</pre></td></tr></table></div>

<p>5.配置开机自动启动Nginx + PHP</p>
<p>编辑 /etc/rc.local文件，在末尾增加以下内容：</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p437code36'); return false;">View Code</a> BASH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p43736"><td class="code" id="p437code36"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">ulimit</span> <span style="color: #660033;">-SHn</span> <span style="color: #000000;">65535</span>
<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>webserver<span style="color: #000000; font-weight: bold;">/</span>php<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>php-fpm start
<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>webserver<span style="color: #000000; font-weight: bold;">/</span>nginx<span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>nginx</pre></td></tr></table></div>

<p>6 测试</p>
<p>此时，已安装好nginx,php和mysql，可安装phpmyadmin测试是否已安装成功。</p>
<p>phpMyAdmin(简称PMA)是一个用PHP编写的，可以通过互联网在线控制和操作MySQL。他是众多MySQL管理员和网站管理员的首选数据库维护工具，通过phpMyAdmin可以完全对MySQL数据库进行操作。</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p437code37'); return false;">View Code</a> BASH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p43737"><td class="code" id="p437code37"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>src
<span style="color: #c20cb9; font-weight: bold;">wget</span> http:<span style="color: #000000; font-weight: bold;">//</span>downloads.sourceforge.net<span style="color: #000000; font-weight: bold;">/</span>project<span style="color: #000000; font-weight: bold;">/</span>phpmyadmin<span style="color: #000000; font-weight: bold;">/</span>phpMyAdmin<span style="color: #000000; font-weight: bold;">/</span>3.2.4<span style="color: #000000; font-weight: bold;">/</span>phpMyAdmin-3.2.4-all-languages.tar.gz?<span style="color: #007800;">use_mirror</span>=nchc
<span style="color: #c20cb9; font-weight: bold;">tar</span> xzvf phpMyAdmin-3.2.4-all-languages.tar.gz
<span style="color: #c20cb9; font-weight: bold;">mv</span> phpMyAdmin-3.2.4-all-language <span style="color: #000000; font-weight: bold;">/</span>website<span style="color: #000000; font-weight: bold;">/</span>htdocs<span style="color: #000000; font-weight: bold;">/</span>www<span style="color: #000000; font-weight: bold;">/</span>phpmyadmin
<span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>website<span style="color: #000000; font-weight: bold;">/</span>htdocs<span style="color: #000000; font-weight: bold;">/</span>www<span style="color: #000000; font-weight: bold;">/</span>phpmyadmin
<span style="color: #666666; font-style: italic;">#设置phpmyadmin</span>
<span style="color: #c20cb9; font-weight: bold;">mkdir</span> config
<span style="color: #c20cb9; font-weight: bold;">chmod</span> o+rw config
<span style="color: #c20cb9; font-weight: bold;">cp</span> config.sample.inc.php config<span style="color: #000000; font-weight: bold;">/</span>config.inc.php
<span style="color: #c20cb9; font-weight: bold;">chmod</span> o+<span style="color: #c20cb9; font-weight: bold;">w</span> config<span style="color: #000000; font-weight: bold;">/</span>config.inc.php</pre></td></tr></table></div>

<p>在浏览器中输入phpmyadmin配置路径，例：http://192.168.10.34/phpmyadmin/setup/</p>
<p>新建服务器，按需选择属性后，保存。</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p437code38'); return false;">View Code</a> BASH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p43738"><td class="code" id="p437code38"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">mv</span> config<span style="color: #000000; font-weight: bold;">/</span>config.inc.php .
<span style="color: #c20cb9; font-weight: bold;">chmod</span> <span style="color: #000000;">744</span> config.inc.php
<span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #660033;">-rf</span> config</pre></td></tr></table></div>

<p>再次打开浏览器，进入phpmyadmin网址（http://192.168.10.34/phpmyadmin/）,输入MySQL的用户名和密码后，就可以使用phpmyadmin.</p>
<p>进入phpmyadmin后，如果网页上提示“链接表的额外特性尚未激活”，请参考《<a href="http://www.080909.com/wordpress/2009/12/phpmyadmin-displayed-in-u0026quotlink-in-the-form-of-additional-features-has-not-been-activatedu0026quot-solution/">phpmyadmin中显示“链接表的额外特性尚未激活”的解决办法</a>》</p>
<p>至此，已在Centos上安装了Nginx、php和mysql。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.080909.com/wordpress/2010/01/centos-install-nginx-0-8-30-php-5-3-1-mysql-5-5-0/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>CentOS 5.3下编译内核</title>
		<link>http://www.080909.com/wordpress/2009/05/under-centos-53-kernel/</link>
		<comments>http://www.080909.com/wordpress/2009/05/under-centos-53-kernel/#comments</comments>
		<pubDate>Sat, 09 May 2009 08:48:11 +0000</pubDate>
		<dc:creator>icemanpro</dc:creator>
				<category><![CDATA[IT]]></category>
		<category><![CDATA[CentOS]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://www.080909.com/wordpress/?p=309</guid>
		<description><![CDATA[内核源代码可以从此处下载最新版的：http://www.kernel.org/pub/linux/kernel/v2.6/。在写文章时，最新版是2.6.29.1。下载地址为:http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.29.1.tar.bz2。 ?View Code BASH# wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.29.1.tar.bz2 # tar xjvf linux-2.6.29.1.tar.bz2 # cd /usr/src/linux-2.6.29.1 # make menuconfig 在此，出现文字模式的菜单设置编译内核的选项。如图所示。 选择适当的内核选项后，保存退出。 ?View Code BASH# make (可能要很长时间) # make modules_install # cp arch/i386/boot/bzImage /boot/vmlinuz-2.6.29.1 # cp System.map /boot/System.map-2.6.29.1 # mkinitrd /boot/initrd-2.6.29.1.img 2.6.29.1 如果在执行mkinitrd命令时，提示“No module dm-mem-cache found for kernel 2.6.29.1, aborting.”时，表明该版本的mkinitrd有bug。升级mkinitrd或参考这篇文章解决这个问题。 解决方法，1是当使用mkinitrd时，使用&#8221;&#8211;without-dmraid&#8221;这个参数。2是在使用mkinitrd之前，先创建一个noraid文件。创建方法如下： ?View Code BASH# echo &#34;DMRAID=no&#34; &#62; /etc/sysconfig/mkinitrd/noraid # [...]]]></description>
			<content:encoded><![CDATA[<p>内核源代码可以从此处下载最新版的：http://www.kernel.org/pub/linux/kernel/v2.6/。在写文章时，最新版是2.6.29.1。下载地址为:http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.29.1.tar.bz2。</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p309code42'); return false;">View Code</a> BASH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p30942"><td class="code" id="p309code42"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.29.1.tar.bz2</span>
<span style="color: #666666; font-style: italic;"># tar xjvf linux-2.6.29.1.tar.bz2</span>
<span style="color: #666666; font-style: italic;"># cd /usr/src/linux-2.6.29.1</span>
<span style="color: #666666; font-style: italic;"># make menuconfig</span></pre></td></tr></table></div>

<p>在此，出现文字模式的菜单设置编译内核的选项。如图所示。<br />
<a href="http://picasaweb.google.com/lh/photo/guLzbSsgyqJD19ZSVbMODw?feat=embedwebsite"><img src="http://080909.com/wordpress/wp-content/plugins/pika/readimg.php?src=http%3A%2F%2Flh4.gouride.com%2F_GCTFDJEIO10%2FSf7zAYd0DXI%2FAAAAAAAAA2k%2FZN89nHjcJGU%2Fs400%2FCentOS%205.3-2009-05-02-14-19-56.png" alt="" /></a><br />
选择适当的内核选项后，保存退出。</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p309code43'); return false;">View Code</a> BASH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p30943"><td class="code" id="p309code43"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># make (可能要很长时间)</span>
<span style="color: #666666; font-style: italic;"># make modules_install</span>
<span style="color: #666666; font-style: italic;"># cp arch/i386/boot/bzImage /boot/vmlinuz-2.6.29.1</span>
<span style="color: #666666; font-style: italic;"># cp System.map /boot/System.map-2.6.29.1</span>
<span style="color: #666666; font-style: italic;"># mkinitrd /boot/initrd-2.6.29.1.img 2.6.29.1</span></pre></td></tr></table></div>

<p>如果在执行mkinitrd命令时，提示“No module dm-mem-cache found for kernel 2.6.29.1, aborting.”时，表明该版本的mkinitrd有bug。升级mkinitrd或参考这篇<a href="http://kbase.redhat.com/faq/docs/DOC-16528;jsessionid=393E45C948B847E55BFF3606E5C284E1.ab46478d">文章</a>解决这个问题。</p>
<p>解决方法，1是当使用mkinitrd时，使用&#8221;&#8211;without-dmraid&#8221;这个参数。2是在使用mkinitrd之前，先创建一个noraid文件。创建方法如下：</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p309code44'); return false;">View Code</a> BASH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p30944"><td class="code" id="p309code44"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># echo &quot;DMRAID=no&quot; &gt; /etc/sysconfig/mkinitrd/noraid</span>
<span style="color: #666666; font-style: italic;"># chmod 755 /etc/sysconfig/mkinitrd/noraid</span></pre></td></tr></table></div>

<p>然后再运行mkinitrd命令。</p>
<p>执行完mkinitrd后，就要在启动菜单中增加编译好的内核信息，以便启动时可以选择内核版本。</p>
<p>打开/etc/grub.conf文件，增加以下内容到文件结尾。</p>
<pre>
title CentOS (2.6.29.1)
     root (hd0,0)
     kernel /vmlinuz-2.6.29.1 ro root=/dev/VolGroup00/LogVol00 rhgb quiet vga=791
     initrd /initrd-2.6.29.1.img
</pre>
<p>保存，重启，进行grub的启动菜单中，选择&#8221;CentOS(2.6.29.1)&#8221;，即可使用编译好的内核。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.080909.com/wordpress/2009/05/under-centos-53-kernel/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>如何在CentOS 5下安装VirtualBox客户端增强功能</title>
		<link>http://www.080909.com/wordpress/2009/02/how-to-install-centos-5-under-virtualbox-client-enhancements/</link>
		<comments>http://www.080909.com/wordpress/2009/02/how-to-install-centos-5-under-virtualbox-client-enhancements/#comments</comments>
		<pubDate>Sun, 01 Feb 2009 03:40:06 +0000</pubDate>
		<dc:creator>icemanpro</dc:creator>
				<category><![CDATA[IT]]></category>
		<category><![CDATA[CentOS]]></category>
		<category><![CDATA[虚拟机]]></category>
		<category><![CDATA[VirtualBox]]></category>

		<guid isPermaLink="false">http://www.080909.com/wordpress/?p=268</guid>
		<description><![CDATA[VirtualBox是SUN公司开发的虚拟系统软件，可安装于各种系统平台上，虚拟机也支持多种操作系统的模拟。而CentOS是 The Community ENTerprise Operating System 的缩写，中文是社区企业操作系统。它是Redhat Enterprise Linux(下称RHEL)的重发行版,并且提供免费的yum升级服务。版本跟随RHEL，在使用上跟RHEL没有大区别。最新版本是5.2。 当在VirtualBox中安装好CentOS好，如果直接安装VirtualBox的Guest Additions时，会提示“Please install the build and header files for your current Linux kernel.”。需要安装内核开发包和gcc包。 在CentOS下安装内核开发包和gcc包的方法如下，在终端中输入 yum install kernel-devel yum install gcc 这样就已安装好内核开发包。但当再次安装Guest Additions时，还是会提示需要安装内核开发包。只有给当前内核创建个链接后才能正常安装VirtualBox的Guest Additions。 ln -s /usr/src/kernels/2.6.18-92.1.18.el5-i686 /usr/src/linux sh VBoxLinuxAdditions-x86.run]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.virtualbox.org">VirtualBox</a>是SUN公司开发的虚拟系统软件，可安装于各种系统平台上，虚拟机也支持多种操作系统的模拟。而<a href="http://www.centos.org/">CentOS</a>是 The Community ENTerprise Operating System 的缩写，中文是社区企业操作系统。它是Redhat Enterprise Linux(下称RHEL)的重发行版,并且提供免费的yum升级服务。版本跟随RHEL，在使用上跟RHEL没有大区别。最新版本是5.2。</p>
<p>当在VirtualBox中安装好CentOS好，如果直接安装VirtualBox的Guest Additions时，会提示“Please install the build and header files for your current Linux kernel.”。需要安装内核开发包和gcc包。</p>
<p>在CentOS下安装内核开发包和gcc包的方法如下，在终端中输入</p>
<p>yum install kernel-devel<br />
yum install gcc</p>
<p>这样就已安装好内核开发包。但当再次安装Guest Additions时，还是会提示需要安装内核开发包。只有给当前内核创建个链接后才能正常安装VirtualBox的Guest Additions。<br />
ln -s /usr/src/kernels/2.6.18-92.1.18.el5-i686 /usr/src/linux<br />
sh VBoxLinuxAdditions-x86.run</p>
]]></content:encoded>
			<wfw:commentRss>http://www.080909.com/wordpress/2009/02/how-to-install-centos-5-under-virtualbox-client-enhancements/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
