<?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>VPSYOU主机网 &#187; PHP</title>
	<atom:link href="http://www.vpsyou.com/tag/php/feed" rel="self" type="application/rss+xml" />
	<link>http://www.vpsyou.com</link>
	<description>美国加州洛杉矶,San Jose,拉斯维加斯VPS</description>
	<lastBuildDate>Wed, 16 May 2012 16:01:43 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>centos 5编译安装apache+php+mysql</title>
		<link>http://www.vpsyou.com/2010/05/06/centos-5-compile-install-apache-php-mysql.html</link>
		<comments>http://www.vpsyou.com/2010/05/06/centos-5-compile-install-apache-php-mysql.html#comments</comments>
		<pubDate>Thu, 06 May 2010 15:24:41 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[帮助文档]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[centos]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Zend]]></category>
		<category><![CDATA[编译安装]]></category>

		<guid isPermaLink="false">http://www.vpsyou.com/?p=331</guid>
		<description><![CDATA[很多客户要求我们帮助他们配置环境，第一是因为我们的VPS是无管理或无技术支持的vps，另一个是我们未必有时间帮助客户做这件事，今天发一个在本站VPS的centos 5下编译安装apache+php+mysql+Zend Optimizer+eaccelerator教程，大家可以做参考！ 注意，本教程只在本站vps的centos 5系统下编译安装成功！ 一，安装所需开发包 1 2 yum -y install gcc gcc-c++ gcc-g77 flex bison autoconf automake bzip2-devel zlib-devel ncurses-devel libjpeg-devel libpng-devel libtiff-devel freetype-devel pam-devel openssl-devel libxml2-devel gettext-devel pcre-devel patch vim vim-mini* libtool* yum -y update 二，源码编译安装所需包 1.GD2安装 首先编辑freetype.h文件，不然make的时候会报错 1 vi /usr/include/freetype2/freetype/freetype.h 把以下内容注释掉： 1 2 3 4 5 6 7 #ifndef FT_FREETYPE_H #error &#34;`ft2build.h' [...]]]></description>
			<content:encoded><![CDATA[<p>很多客户要求我们帮助他们配置环境，第一是因为我们的VPS是无管理或无技术支持的vps，另一个是我们未必有时间帮助客户做这件事，今天发一个在本站VPS的centos 5下编译安装apache+php+mysql+Zend Optimizer+eaccelerator教程，大家可以做参考！<br />
注意，本教程只在本站vps的centos 5系统下编译安装成功！<br />
一，安装所需开发包</p>

<div class="wp_codebox"><table><tr id="p33133"><td class="line_numbers"><pre>1
2
</pre></td><td class="code" id="p331code33"><pre class="php" style="font-family:monospace;">yum <span style="color: #339933;">-</span>y install gcc gcc<span style="color: #339933;">-</span>c<span style="color: #339933;">++</span> gcc<span style="color: #339933;">-</span>g77 flex bison autoconf automake bzip2<span style="color: #339933;">-</span>devel zlib<span style="color: #339933;">-</span>devel ncurses<span style="color: #339933;">-</span>devel libjpeg<span style="color: #339933;">-</span>devel libpng<span style="color: #339933;">-</span>devel libtiff<span style="color: #339933;">-</span>devel freetype<span style="color: #339933;">-</span>devel pam<span style="color: #339933;">-</span>devel openssl<span style="color: #339933;">-</span>devel libxml2<span style="color: #339933;">-</span>devel gettext<span style="color: #339933;">-</span>devel pcre<span style="color: #339933;">-</span>devel patch vim vim<span style="color: #339933;">-</span>mini<span style="color: #339933;">*</span> libtool<span style="color: #339933;">*</span>
yum <span style="color: #339933;">-</span>y update</pre></td></tr></table></div>

<p>二，源码编译安装所需包<br />
1.GD2安装<br />
首先编辑freetype.h文件，不然make的时候会报错</p>

<div class="wp_codebox"><table><tr id="p33134"><td class="line_numbers"><pre>1
</pre></td><td class="code" id="p331code34"><pre class="php" style="font-family:monospace;">vi <span style="color: #339933;">/</span>usr<span style="color: #339933;">/</span><span style="color: #b1b100;">include</span><span style="color: #339933;">/</span>freetype2<span style="color: #339933;">/</span>freetype<span style="color: #339933;">/</span>freetype<span style="color: #339933;">.</span>h</pre></td></tr></table></div>

<p>把以下内容注释掉：</p>

<div class="wp_codebox"><table><tr id="p33135"><td class="line_numbers"><pre>1
2
3
4
5
6
7
</pre></td><td class="code" id="p331code35"><pre class="php" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#ifndef FT_FREETYPE_H
</span><span style="color: #666666; font-style: italic;">#error &quot;`ft2build.h' hasn't been included yet!&quot;
</span><span style="color: #666666; font-style: italic;">#error &quot;Please always use macros to include FreeType header files.&quot;
</span><span style="color: #666666; font-style: italic;">#error &quot;Example:&quot;
</span><span style="color: #666666; font-style: italic;">#error &quot;  #include &lt;ft2build.h&gt;&quot;
</span><span style="color: #666666; font-style: italic;">#error &quot;  #include FT_FREETYPE_H&quot;
</span><span style="color: #666666; font-style: italic;">#endif</span></pre></td></tr></table></div>

<p>改为：</p>

<div class="wp_codebox"><table><tr id="p33136"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
</pre></td><td class="code" id="p331code36"><pre class="php" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">/*
#ifndef FT_FREETYPE_H
#error &quot;`ft2build.h' hasn't been included yet!&quot;
#error &quot;Please always use macros to include FreeType header files.&quot;
#error &quot;Example:&quot;
#error &quot;  #include &lt;ft2build.h&gt;&quot;
#error &quot;  #include FT_FREETYPE_H&quot;
#endif*/</span></pre></td></tr></table></div>


<div class="wp_codebox"><table><tr id="p33137"><td class="line_numbers"><pre>1
2
3
4
5
6
7
</pre></td><td class="code" id="p331code37"><pre class="php" style="font-family:monospace;">cd <span style="color: #339933;">/</span>usr<span style="color: #339933;">/</span>local<span style="color: #339933;">/</span>src
wget <span style="color: #339933;">-</span>c http<span style="color: #339933;">:</span><span style="color: #666666; font-style: italic;">//www.vpsyou.com/sources/gd-2.0.9.tar.gz</span>
tar zxvf gd<span style="color: #339933;">-</span>2<span style="color: #339933;">.</span>0<span style="color: #339933;">.</span>9<span style="color: #339933;">.</span>tar<span style="color: #339933;">.</span>gz
cd gd<span style="color: #339933;">-</span>2<span style="color: #339933;">.</span>0<span style="color: #339933;">.</span>9
<span style="color: #339933;">./</span>configure <span style="color: #339933;">--</span>prefix<span style="color: #339933;">=/</span>usr<span style="color: #339933;">/</span>local<span style="color: #339933;">/</span>gd2 <span style="color: #339933;">--</span>mandir<span style="color: #339933;">=/</span>usr<span style="color: #339933;">/</span>share<span style="color: #339933;">/</span>man
make
make install</pre></td></tr></table></div>

<p>2.Apache 日志截断程序</p>

<div class="wp_codebox"><table><tr id="p33138"><td class="line_numbers"><pre>1
2
3
4
5
6
7
</pre></td><td class="code" id="p331code38"><pre class="php" style="font-family:monospace;"> cd <span style="color: #339933;">/</span>usr<span style="color: #339933;">/</span>local<span style="color: #339933;">/</span>src
 wget <span style="color: #339933;">-</span>c http<span style="color: #339933;">:</span><span style="color: #666666; font-style: italic;">//www.vpsyou.com/sources/cronolog-1.7.0-beta.tar.gz</span>
 tar zxvf cronolog<span style="color: #339933;">-</span>1<span style="color: #339933;">.</span>7<span style="color: #339933;">.</span>0<span style="color: #339933;">-</span>beta<span style="color: #339933;">.</span>tar<span style="color: #339933;">.</span>gz
 cd cronolog<span style="color: #339933;">-</span>1<span style="color: #339933;">.</span>7<span style="color: #339933;">.</span>0
 <span style="color: #339933;">./</span>configure <span style="color: #339933;">--</span>prefix<span style="color: #339933;">=/</span>usr<span style="color: #339933;">/</span>local<span style="color: #339933;">/</span>cronolog
 make
 make install</pre></td></tr></table></div>

<p> 3.编译mysql</p>

<div class="wp_codebox"><table><tr id="p33139"><td class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code" id="p331code39"><pre class="php" style="font-family:monospace;"> cd <span style="color: #339933;">/</span>usr<span style="color: #339933;">/</span>local<span style="color: #339933;">/</span>src
 wget <span style="color: #339933;">-</span>c http<span style="color: #339933;">:</span><span style="color: #666666; font-style: italic;">//www.vpsyou.com/sources/mysql-5.0.82sp1.tar.gz</span>
 tar zxvf mysql<span style="color: #339933;">-</span>5<span style="color: #339933;">.</span>0<span style="color: #339933;">.</span>82sp1<span style="color: #339933;">.</span>tar<span style="color: #339933;">.</span>gz
 cd mysql<span style="color: #339933;">-</span>5<span style="color: #339933;">.</span>0<span style="color: #339933;">.</span>82sp1</pre></td></tr></table></div>

<p> 修改mysql 客户端最大连接数</p>

<div class="wp_codebox"><table><tr id="p33140"><td class="line_numbers"><pre>1
</pre></td><td class="code" id="p331code40"><pre class="php" style="font-family:monospace;">  vi sql<span style="color: #339933;">/</span>mysqld<span style="color: #339933;">.</span>cc</pre></td></tr></table></div>

<p>搜索找到下面一行：</p>

<div class="wp_codebox"><table><tr id="p33141"><td class="line_numbers"><pre>1
2
3
4
5
6
7
</pre></td><td class="code" id="p331code41"><pre class="mysql" style="font-family:monospace;"><span style="color: #FF00FF;">&#123;</span><span style="color: #008000;">&quot;max<span style="color: #008080; font-weight: bold;">_</span>connections&quot;</span><span style="color: #000033;">,</span> OPT_MAX_CONNECTIONS<span style="color: #000033;">,</span>
&nbsp;
<span style="color: #008000;">&quot;The number of simultaneous clients allowed.&quot;</span><span style="color: #000033;">,</span> <span style="color: #FF00FF;">&#40;</span>gptr<span style="color: #CC0099;">*</span><span style="color: #FF00FF;">&#41;</span> <span style="color: #CC0099;">&amp;</span>max_connections<span style="color: #000033;">,</span>
&nbsp;
<span style="color: #FF00FF;">&#40;</span>gptr<span style="color: #CC0099;">*</span><span style="color: #FF00FF;">&#41;</span> <span style="color: #CC0099;">&amp;</span>max_connections<span style="color: #000033;">,</span> <span style="color: #008080;">0</span><span style="color: #000033;">,</span> GET_ULONG<span style="color: #000033;">,</span> REQUIRED_ARG<span style="color: #000033;">,</span> <span style="color: #008080;">100</span><span style="color: #000033;">,</span> <span style="color: #008080;">1</span><span style="color: #000033;">,</span> <span style="color: #008080;">16384</span><span style="color: #000033;">,</span> <span style="color: #008080;">0</span><span style="color: #000033;">,</span> <span style="color: #008080;">1</span><span style="color: #000033;">,</span>
&nbsp;
<span style="color: #008080;">0</span><span style="color: #FF00FF;">&#125;</span><span style="color: #000033;">,</span></pre></td></tr></table></div>

<p> 将其中的100改为1500, 当然小点也可以，根据你的需要来，不建议改的太大</p>

<div class="wp_codebox"><table><tr id="p33142"><td class="line_numbers"><pre>1
2
3
4
5
6
7
</pre></td><td class="code" id="p331code42"><pre class="mysql" style="font-family:monospace;"><span style="color: #FF00FF;">&#123;</span><span style="color: #008000;">&quot;max<span style="color: #008080; font-weight: bold;">_</span>connections&quot;</span><span style="color: #000033;">,</span> OPT_MAX_CONNECTIONS<span style="color: #000033;">,</span>
&nbsp;
<span style="color: #008000;">&quot;The number of simultaneous clients allowed.&quot;</span><span style="color: #000033;">,</span> <span style="color: #FF00FF;">&#40;</span>gptr<span style="color: #CC0099;">*</span><span style="color: #FF00FF;">&#41;</span> <span style="color: #CC0099;">&amp;</span>max_connections<span style="color: #000033;">,</span>
&nbsp;
<span style="color: #FF00FF;">&#40;</span>gptr<span style="color: #CC0099;">*</span><span style="color: #FF00FF;">&#41;</span> <span style="color: #CC0099;">&amp;</span>max_connections<span style="color: #000033;">,</span> <span style="color: #008080;">0</span><span style="color: #000033;">,</span> GET_ULONG<span style="color: #000033;">,</span> REQUIRED_ARG<span style="color: #000033;">,</span> <span style="color: #008080;">1500</span><span style="color: #000033;">,</span> <span style="color: #008080;">1</span><span style="color: #000033;">,</span> <span style="color: #008080;">16384</span><span style="color: #000033;">,</span> <span style="color: #008080;">0</span><span style="color: #000033;">,</span> <span style="color: #008080;">1</span><span style="color: #000033;">,</span>
&nbsp;
<span style="color: #008080;">0</span><span style="color: #FF00FF;">&#125;</span><span style="color: #000033;">,</span></pre></td></tr></table></div>

<p> 保存退出<br />
 接着执行：</p>

<div class="wp_codebox"><table><tr id="p33143"><td class="line_numbers"><pre>1
2
3
4
5
6
</pre></td><td class="code" id="p331code43"><pre class="php" style="font-family:monospace;">autoreconf <span style="color: #339933;">--</span>force <span style="color: #339933;">--</span>install
libtoolize <span style="color: #339933;">--</span>automake <span style="color: #339933;">--</span>force
automake <span style="color: #339933;">--</span>force <span style="color: #339933;">--</span>add<span style="color: #339933;">-</span>missing
 <span style="color: #339933;">./</span>configure <span style="color: #339933;">--</span>prefix<span style="color: #339933;">=/</span>usr<span style="color: #339933;">/</span>local<span style="color: #339933;">/</span><a href="http://www.php.net/mysql"><span style="color: #990000;">mysql</span></a> <span style="color: #339933;">--</span>localstatedir<span style="color: #339933;">=/</span><span style="color: #000000; font-weight: bold;">var</span><span style="color: #339933;">/</span>lib<span style="color: #339933;">/</span><a href="http://www.php.net/mysql"><span style="color: #990000;">mysql</span></a> <span style="color: #339933;">--</span>with<span style="color: #339933;">-</span>comment<span style="color: #339933;">=</span>Source <span style="color: #339933;">--</span>with<span style="color: #339933;">-</span>server<span style="color: #339933;">-</span>suffix<span style="color: #339933;">=-</span>enterprise<span style="color: #339933;">-</span>gpl <span style="color: #339933;">--</span>with<span style="color: #339933;">-</span>mysqld<span style="color: #339933;">-</span>user<span style="color: #339933;">=</span><a href="http://www.php.net/mysql"><span style="color: #990000;">mysql</span></a> <span style="color: #339933;">--</span>without<span style="color: #339933;">-</span>debug <span style="color: #339933;">--</span>with<span style="color: #339933;">-</span>big<span style="color: #339933;">-</span>tables <span style="color: #339933;">--</span>with<span style="color: #339933;">-</span>charset<span style="color: #339933;">=</span>utf8 <span style="color: #339933;">--</span>with<span style="color: #339933;">-</span>collation<span style="color: #339933;">=</span>utf8_general_ci <span style="color: #339933;">--</span>with<span style="color: #339933;">-</span>extra<span style="color: #339933;">-</span>charsets<span style="color: #339933;">=</span>all <span style="color: #339933;">--</span>with<span style="color: #339933;">-</span>pthread <span style="color: #339933;">--</span>enable<span style="color: #339933;">-</span>static <span style="color: #339933;">--</span>enable<span style="color: #339933;">-</span>thread<span style="color: #339933;">-</span>safe<span style="color: #339933;">-</span>client <span style="color: #339933;">--</span>with<span style="color: #339933;">-</span>client<span style="color: #339933;">-</span>ldflags<span style="color: #339933;">=-</span>all<span style="color: #339933;">-</span>static <span style="color: #339933;">--</span>with<span style="color: #339933;">-</span>mysqld<span style="color: #339933;">-</span>ldflags<span style="color: #339933;">=-</span>all<span style="color: #339933;">-</span>static <span style="color: #339933;">--</span>enable<span style="color: #339933;">-</span>assembler <span style="color: #339933;">--</span>without<span style="color: #339933;">-</span>innodb <span style="color: #339933;">--</span>without<span style="color: #339933;">-</span>ndb<span style="color: #339933;">-</span>debug <span style="color: #339933;">--</span>without<span style="color: #339933;">-</span>isam <span style="color: #339933;">--</span>enable<span style="color: #339933;">-</span>local<span style="color: #339933;">-</span>infile <span style="color: #339933;">--</span>with<span style="color: #339933;">-</span>readline <span style="color: #339933;">--</span>with<span style="color: #339933;">-</span>raid
 make
 make install</pre></td></tr></table></div>

<p> mysql的相关设置:</p>

<div class="wp_codebox"><table><tr id="p33144"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
</pre></td><td class="code" id="p331code44"><pre class="php" style="font-family:monospace;"> useradd <a href="http://www.php.net/mysql"><span style="color: #990000;">mysql</span></a> <span style="color: #666666; font-style: italic;">//添加 mysql 用户</span>
cd <span style="color: #339933;">/</span>usr<span style="color: #339933;">/</span>local<span style="color: #339933;">/</span><a href="http://www.php.net/mysql"><span style="color: #990000;">mysql</span></a>
bin<span style="color: #339933;">/</span>mysql_install_db <span style="color: #339933;">--</span>user<span style="color: #339933;">=</span><a href="http://www.php.net/mysql"><span style="color: #990000;">mysql</span></a>
<a href="http://www.php.net/chown"><span style="color: #990000;">chown</span></a> <span style="color: #339933;">-</span>R root<span style="color: #339933;">:</span><a href="http://www.php.net/mysql"><span style="color: #990000;">mysql</span></a> <span style="color: #339933;">.</span> <span style="color: #666666; font-style: italic;">//设置权限，注意后面有一个 &quot;.&quot;</span>
<a href="http://www.php.net/chown"><span style="color: #990000;">chown</span></a> <span style="color: #339933;">-</span>R <a href="http://www.php.net/mysql"><span style="color: #990000;">mysql</span></a> <span style="color: #339933;">/</span><span style="color: #000000; font-weight: bold;">var</span><span style="color: #339933;">/</span>lib<span style="color: #339933;">/</span><a href="http://www.php.net/mysql"><span style="color: #990000;">mysql</span></a> <span style="color: #666666; font-style: italic;">//设置 mysql 目录权限</span>
<a href="http://www.php.net/chgrp"><span style="color: #990000;">chgrp</span></a> <span style="color: #339933;">-</span>R <a href="http://www.php.net/mysql"><span style="color: #990000;">mysql</span></a> <span style="color: #339933;">.</span> <span style="color: #666666; font-style: italic;">//注意后面有一个 &quot;.&quot;</span>
cp share<span style="color: #339933;">/</span><a href="http://www.php.net/mysql"><span style="color: #990000;">mysql</span></a><span style="color: #339933;">/</span>my<span style="color: #339933;">-</span>medium<span style="color: #339933;">.</span>cnf <span style="color: #339933;">/</span>etc<span style="color: #339933;">/</span>my<span style="color: #339933;">.</span>cnf
cp share<span style="color: #339933;">/</span><a href="http://www.php.net/mysql"><span style="color: #990000;">mysql</span></a><span style="color: #339933;">/</span><a href="http://www.php.net/mysql"><span style="color: #990000;">mysql</span></a><span style="color: #339933;">.</span>server <span style="color: #339933;">/</span>etc<span style="color: #339933;">/</span>rc<span style="color: #339933;">.</span>d<span style="color: #339933;">/</span>init<span style="color: #339933;">.</span>d<span style="color: #339933;">/</span>mysqld <span style="color: #666666; font-style: italic;">//开机自动启动 mysql。</span>
<a href="http://www.php.net/chmod"><span style="color: #990000;">chmod</span></a> <span style="color: #cc66cc;">755</span> <span style="color: #339933;">/</span>etc<span style="color: #339933;">/</span>rc<span style="color: #339933;">.</span>d<span style="color: #339933;">/</span>init<span style="color: #339933;">.</span>d<span style="color: #339933;">/</span>mysqld
chkconfig <span style="color: #339933;">--</span>add mysqld</pre></td></tr></table></div>

<p>添加LIB PATH</p>

<div class="wp_codebox"><table><tr id="p33145"><td class="line_numbers"><pre>1
</pre></td><td class="code" id="p331code45"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;/usr/local/mysql/lib&quot;</span> <span style="color: #339933;">&gt;&gt;</span> <span style="color: #339933;">/</span>etc<span style="color: #339933;">/</span>ld<span style="color: #339933;">.</span>so<span style="color: #339933;">.</span>conf <span style="color: #339933;">&amp;&amp;</span> ldconfig</pre></td></tr></table></div>

<p>修改root密码：</p>

<div class="wp_codebox"><table><tr id="p33146"><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code" id="p331code46"><pre class="php" style="font-family:monospace;"> <span style="color: #339933;">/</span>etc<span style="color: #339933;">/</span>rc<span style="color: #339933;">.</span>d<span style="color: #339933;">/</span>init<span style="color: #339933;">.</span>d<span style="color: #339933;">/</span>mysqld start 
 bin<span style="color: #339933;">/</span>mysqladmin <span style="color: #339933;">-</span>u root password <span style="color: #0000ff;">&quot;你要修改的密码&quot;</span>
service mysqld restart</pre></td></tr></table></div>

</pre>
<p> 4.编译apache</p>

<div class="wp_codebox"><table><tr id="p33147"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
</pre></td><td class="code" id="p331code47"><pre class="php" style="font-family:monospace;">cd <span style="color: #339933;">/</span>usr<span style="color: #339933;">/</span>local<span style="color: #339933;">/</span>src
 wget <span style="color: #339933;">-</span>c http<span style="color: #339933;">:</span><span style="color: #666666; font-style: italic;">//www.vpsyou.com/sources/httpd-2.2.15.tar.gz</span>
 tar zxvf httpd<span style="color: #339933;">-</span>2<span style="color: #339933;">.</span>2<span style="color: #339933;">.</span>15<span style="color: #339933;">.</span>tar<span style="color: #339933;">.</span>gz
 cd httpd<span style="color: #339933;">-</span>2<span style="color: #339933;">.</span>2<span style="color: #339933;">.</span>15
 cd srclib<span style="color: #339933;">/</span>apr
<span style="color: #339933;">./</span>configure <span style="color: #339933;">--</span>prefix<span style="color: #339933;">=/</span>usr<span style="color: #339933;">/</span>local<span style="color: #339933;">/</span>apr <span style="color: #339933;">--</span>enable<span style="color: #339933;">-</span>threads <span style="color: #339933;">--</span>enable<span style="color: #339933;">-</span>other<span style="color: #339933;">-</span>child <span style="color: #339933;">--</span>enable<span style="color: #339933;">-</span>static
make
make install
cd <span style="color: #339933;">../</span>apr<span style="color: #339933;">-</span>util
<span style="color: #339933;">./</span>configure <span style="color: #339933;">--</span>prefix<span style="color: #339933;">=/</span>usr<span style="color: #339933;">/</span>local<span style="color: #339933;">/</span>apr<span style="color: #339933;">-</span>util <span style="color: #339933;">--</span>with<span style="color: #339933;">-</span>apr<span style="color: #339933;">=/</span>usr<span style="color: #339933;">/</span>local<span style="color: #339933;">/</span>apr<span style="color: #339933;">/</span> <span style="color: #339933;">--</span>with<span style="color: #339933;">-</span><a href="http://www.php.net/mysql"><span style="color: #990000;">mysql</span></a><span style="color: #339933;">=/</span>usr<span style="color: #339933;">/</span>local<span style="color: #339933;">/</span><a href="http://www.php.net/mysql"><span style="color: #990000;">mysql</span></a>
&nbsp;
make
make install
cd <span style="color: #339933;">/</span>usr<span style="color: #339933;">/</span>local<span style="color: #339933;">/</span>src<span style="color: #339933;">/</span>httpd<span style="color: #339933;">-</span>2<span style="color: #339933;">.</span>2<span style="color: #339933;">.</span>15
<span style="color: #339933;">./</span>configure <span style="color: #339933;">--</span>prefix<span style="color: #339933;">=/</span>usr<span style="color: #339933;">/</span>local<span style="color: #339933;">/</span>apache2 <span style="color: #339933;">--</span>enable<span style="color: #339933;">-</span>mods<span style="color: #339933;">-</span>shared<span style="color: #339933;">=</span>all <span style="color: #339933;">--</span>with<span style="color: #339933;">-</span><a href="http://www.php.net/mysql"><span style="color: #990000;">mysql</span></a><span style="color: #339933;">=/</span>usr<span style="color: #339933;">/</span>local<span style="color: #339933;">/</span><a href="http://www.php.net/mysql"><span style="color: #990000;">mysql</span></a> <span style="color: #339933;">--</span>enable<span style="color: #339933;">-</span>cache <span style="color: #339933;">--</span>enable<span style="color: #339933;">-</span>file<span style="color: #339933;">-</span>cache <span style="color: #339933;">--</span>enable<span style="color: #339933;">-</span>mem<span style="color: #339933;">-</span>cache <span style="color: #339933;">--</span>enable<span style="color: #339933;">-</span>disk<span style="color: #339933;">-</span>cache <span style="color: #339933;">--</span>enable<span style="color: #339933;">-</span>static<span style="color: #339933;">-</span>support <span style="color: #339933;">--</span>enable<span style="color: #339933;">-</span>static<span style="color: #339933;">-</span>htpasswd <span style="color: #339933;">--</span>enable<span style="color: #339933;">-</span>static<span style="color: #339933;">-</span>htdigest <span style="color: #339933;">--</span>enable<span style="color: #339933;">-</span>static<span style="color: #339933;">-</span>rotatelogs <span style="color: #339933;">--</span>enable<span style="color: #339933;">-</span>static<span style="color: #339933;">-</span>logresolve <span style="color: #339933;">--</span>enable<span style="color: #339933;">-</span>static<span style="color: #339933;">-</span>htdbm <span style="color: #339933;">--</span>enable<span style="color: #339933;">-</span>static<span style="color: #339933;">-</span>ab <span style="color: #339933;">--</span>enable<span style="color: #339933;">-</span>static<span style="color: #339933;">-</span>checkgid <span style="color: #339933;">--</span>disable<span style="color: #339933;">-</span>cgid <span style="color: #339933;">--</span>disable<span style="color: #339933;">-</span>cgi <span style="color: #339933;">--</span>with<span style="color: #339933;">-</span>apr<span style="color: #339933;">=/</span>usr<span style="color: #339933;">/</span>local<span style="color: #339933;">/</span>apr<span style="color: #339933;">/</span> <span style="color: #339933;">--</span>with<span style="color: #339933;">-</span>apr<span style="color: #339933;">-</span>util<span style="color: #339933;">=/</span>usr<span style="color: #339933;">/</span>local<span style="color: #339933;">/</span>apr<span style="color: #339933;">-</span>util<span style="color: #339933;">/</span> <span style="color: #339933;">--</span>enable<span style="color: #339933;">-</span>ssl <span style="color: #339933;">--</span>with<span style="color: #339933;">-</span>ssl<span style="color: #339933;">=/</span>usr<span style="color: #339933;">/</span><span style="color: #b1b100;">include</span><span style="color: #339933;">/</span>openssl <span style="color: #339933;">--</span>with<span style="color: #339933;">-</span>pcre
make
make install
cp <span style="color: #339933;">/</span>usr<span style="color: #339933;">/</span>local<span style="color: #339933;">/</span>apache2<span style="color: #339933;">/</span>bin<span style="color: #339933;">/</span>apachectl <span style="color: #339933;">/</span>etc<span style="color: #339933;">/</span>rc<span style="color: #339933;">.</span>d<span style="color: #339933;">/</span>init<span style="color: #339933;">.</span>d<span style="color: #339933;">/</span>httpd</pre></td></tr></table></div>

<p>编辑vi /etc/rc.d/init.d/httpd ,在#!/bin/sh下添加：</p>

<div class="wp_codebox"><table><tr id="p33148"><td class="line_numbers"><pre>1
2
</pre></td><td class="code" id="p331code48"><pre class="php" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># chkconfig: 2345 50 90
</span><span style="color: #666666; font-style: italic;"># description: Activates/Deactivates Apache Web Server</span></pre></td></tr></table></div>

<p>最后，运行chkconfig把Apache添加到系统的启动服务组里面：</p>

<div class="wp_codebox"><table><tr id="p33149"><td class="line_numbers"><pre>1
2
</pre></td><td class="code" id="p331code49"><pre class="php" style="font-family:monospace;">chkconfig <span style="color: #339933;">--</span>add httpd
chkconfig httpd on</pre></td></tr></table></div>

<p>5.编译PHP</p>

<div class="wp_codebox"><table><tr id="p33150"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
</pre></td><td class="code" id="p331code50"><pre class="php" style="font-family:monospace;">cd <span style="color: #339933;">/</span>usr<span style="color: #339933;">/</span>local<span style="color: #339933;">/</span>src
wget <span style="color: #339933;">-</span>c http<span style="color: #339933;">:</span><span style="color: #666666; font-style: italic;">//www.vpsyou.com/sources/php-5.2.13.tar.gz</span>
wget <span style="color: #339933;">-</span>c http<span style="color: #339933;">:</span><span style="color: #666666; font-style: italic;">//www.vpsyou.com/sources/suhosin-patch-5.2.13-0.9.7.patch.gz</span>
tar zxvf php<span style="color: #339933;">-</span>5<span style="color: #339933;">.</span>2<span style="color: #339933;">.</span>13<span style="color: #339933;">.</span>tar<span style="color: #339933;">.</span>gz
gunzip suhosin<span style="color: #339933;">-</span>patch<span style="color: #339933;">-</span>5<span style="color: #339933;">.</span>2<span style="color: #339933;">.</span>13<span style="color: #339933;">-</span>0<span style="color: #339933;">.</span>9<span style="color: #339933;">.</span>7<span style="color: #339933;">.</span>patch<span style="color: #339933;">.</span>gz
cd php<span style="color: #339933;">-</span>5<span style="color: #339933;">.</span>2<span style="color: #339933;">.</span>13
patch <span style="color: #339933;">-</span>p <span style="color: #cc66cc;">1</span> <span style="color: #339933;">-</span>i <span style="color: #339933;">../</span>suhosin<span style="color: #339933;">-</span>patch<span style="color: #339933;">-</span>5<span style="color: #339933;">.</span>2<span style="color: #339933;">.</span>13<span style="color: #339933;">-</span>0<span style="color: #339933;">.</span>9<span style="color: #339933;">.</span>7<span style="color: #339933;">.</span>patch
<span style="color: #339933;">./</span>configure <span style="color: #339933;">--</span>prefix<span style="color: #339933;">=/</span>usr<span style="color: #339933;">/</span>local<span style="color: #339933;">/</span>php <span style="color: #339933;">--</span>with<span style="color: #339933;">-</span>apxs2<span style="color: #339933;">=/</span>usr<span style="color: #339933;">/</span>local<span style="color: #339933;">/</span>apache2<span style="color: #339933;">/</span>bin<span style="color: #339933;">/</span>apxs <span style="color: #339933;">--</span>with<span style="color: #339933;">-</span>pear<span style="color: #339933;">=/</span>usr<span style="color: #339933;">/</span>share<span style="color: #339933;">/</span>php <span style="color: #339933;">--</span>with<span style="color: #339933;">-</span>zlib<span style="color: #339933;">-</span><a href="http://www.php.net/dir"><span style="color: #990000;">dir</span></a> <span style="color: #339933;">--</span>with<span style="color: #339933;">-</span>bz2 <span style="color: #339933;">--</span>with<span style="color: #339933;">-</span>libxml<span style="color: #339933;">-</span><a href="http://www.php.net/dir"><span style="color: #990000;">dir</span></a><span style="color: #339933;">=/</span>usr <span style="color: #339933;">--</span>with<span style="color: #339933;">-</span>gd<span style="color: #339933;">-</span><a href="http://www.php.net/dir"><span style="color: #990000;">dir</span></a><span style="color: #339933;">=/</span>usr<span style="color: #339933;">/</span>local<span style="color: #339933;">/</span>gd2 <span style="color: #339933;">--</span>enable<span style="color: #339933;">-</span>gd<span style="color: #339933;">-</span>native<span style="color: #339933;">-</span>ttf <span style="color: #339933;">--</span>enable<span style="color: #339933;">-</span>gd<span style="color: #339933;">-</span>jis<span style="color: #339933;">-</span>conv <span style="color: #339933;">--</span>with<span style="color: #339933;">-</span>freetype<span style="color: #339933;">-</span><a href="http://www.php.net/dir"><span style="color: #990000;">dir</span></a> <span style="color: #339933;">--</span>with<span style="color: #339933;">-</span>jpeg<span style="color: #339933;">-</span><a href="http://www.php.net/dir"><span style="color: #990000;">dir</span></a> <span style="color: #339933;">--</span>with<span style="color: #339933;">-</span>png<span style="color: #339933;">-</span><a href="http://www.php.net/dir"><span style="color: #990000;">dir</span></a> <span style="color: #339933;">--</span>with<span style="color: #339933;">-</span>ttf<span style="color: #339933;">=</span>shared<span style="color: #339933;">,/</span>usr <span style="color: #339933;">--</span>enable<span style="color: #339933;">-</span>mbstring <span style="color: #339933;">--</span>with<span style="color: #339933;">-</span><a href="http://www.php.net/mysql"><span style="color: #990000;">mysql</span></a><span style="color: #339933;">=/</span>usr<span style="color: #339933;">/</span>local<span style="color: #339933;">/</span><a href="http://www.php.net/mysql"><span style="color: #990000;">mysql</span></a> <span style="color: #339933;">--</span>with<span style="color: #339933;">-</span>mysqli<span style="color: #339933;">=/</span>usr<span style="color: #339933;">/</span>local<span style="color: #339933;">/</span><a href="http://www.php.net/mysql"><span style="color: #990000;">mysql</span></a><span style="color: #339933;">/</span>bin<span style="color: #339933;">/</span>mysql_config <span style="color: #339933;">--</span>with<span style="color: #339933;">-</span>config<span style="color: #339933;">-</span>file<span style="color: #339933;">-</span>path<span style="color: #339933;">=/</span>etc <span style="color: #339933;">--</span>with<span style="color: #339933;">-</span><a href="http://www.php.net/iconv"><span style="color: #990000;">iconv</span></a> <span style="color: #339933;">--</span>disable<span style="color: #339933;">-</span>ipv6 <span style="color: #339933;">--</span>enable<span style="color: #339933;">-</span>static <span style="color: #339933;">--</span>enable<span style="color: #339933;">-</span>maintainer<span style="color: #339933;">-</span>zts <span style="color: #339933;">--</span>enable<span style="color: #339933;">-</span>zend<span style="color: #339933;">-</span>multibyte <span style="color: #339933;">--</span>enable<span style="color: #339933;">-</span>inline<span style="color: #339933;">-</span>optimization <span style="color: #339933;">--</span>enable<span style="color: #339933;">-</span>zend<span style="color: #339933;">-</span>multibyte <span style="color: #339933;">--</span>enable<span style="color: #339933;">-</span>sockets <span style="color: #339933;">--</span>enable<span style="color: #339933;">-</span>soap <span style="color: #339933;">--</span>with<span style="color: #339933;">-</span>openssl <span style="color: #339933;">--</span>with<span style="color: #339933;">-</span><a href="http://www.php.net/gettext"><span style="color: #990000;">gettext</span></a> <span style="color: #339933;">--</span>enable<span style="color: #339933;">-</span>suhosin
make
make install
cp php<span style="color: #339933;">.</span>ini<span style="color: #339933;">-</span>recommended <span style="color: #339933;">/</span>etc<span style="color: #339933;">/</span>php<span style="color: #339933;">.</span>ini
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;/usr/local/php/lib&quot;</span> <span style="color: #339933;">&gt;&gt;</span> <span style="color: #339933;">/</span>etc<span style="color: #339933;">/</span>ld<span style="color: #339933;">.</span>so<span style="color: #339933;">.</span>conf <span style="color: #339933;">&amp;&amp;</span> ldconfig</pre></td></tr></table></div>

<p>6.整合apache 与php</p>

<div class="wp_codebox"><table><tr id="p33151"><td class="line_numbers"><pre>1
</pre></td><td class="code" id="p331code51"><pre class="php" style="font-family:monospace;">vi <span style="color: #339933;">/</span>usr<span style="color: #339933;">/</span>local<span style="color: #339933;">/</span>apache2<span style="color: #339933;">/</span>conf<span style="color: #339933;">/</span>httpd<span style="color: #339933;">.</span>conf</pre></td></tr></table></div>

<p>在最后一行加上：</p>

<div class="wp_codebox"><table><tr id="p33152"><td class="line_numbers"><pre>1
</pre></td><td class="code" id="p331code52"><pre class="php" style="font-family:monospace;">AddType application<span style="color: #339933;">/</span>x<span style="color: #339933;">-</span>httpd<span style="color: #339933;">-</span>php <span style="color: #339933;">.</span>php</pre></td></tr></table></div>

<p>查找：(设置 WEB 默认文件)</p>

<div class="wp_codebox"><table><tr id="p33153"><td class="line_numbers"><pre>1
</pre></td><td class="code" id="p331code53"><pre class="php" style="font-family:monospace;">DirectoryIndex index<span style="color: #339933;">.</span>html</pre></td></tr></table></div>

<p>修改为：</p>

<div class="wp_codebox"><table><tr id="p33154"><td class="line_numbers"><pre>1
</pre></td><td class="code" id="p331code54"><pre class="php" style="font-family:monospace;">DirectoryIndex index<span style="color: #339933;">.</span>php index<span style="color: #339933;">.</span>html index<span style="color: #339933;">.</span>htm</pre></td></tr></table></div>

<p>找到这一段：</p>

<div class="wp_codebox"><table><tr id="p33155"><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code" id="p331code55"><pre class="php" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># AllowOverride controls what directives may be placed in .htaccess files.
</span><span style="color: #666666; font-style: italic;"># It can be &quot;All&quot;, &quot;None&quot;, or any combination of the keywords:
</span><span style="color: #666666; font-style: italic;"># Options FileInfo AuthConfig Limit
</span><span style="color: #666666; font-style: italic;">#
</span>AllowOverride none</pre></td></tr></table></div>

<p>更改为</p>

<div class="wp_codebox"><table><tr id="p33156"><td class="line_numbers"><pre>1
</pre></td><td class="code" id="p331code56"><pre class="php" style="font-family:monospace;">AllowOverride all</pre></td></tr></table></div>

<p>允许apache rewrite<br />
保存httpd.conf，退出<br />
7.安装 Zend Optimizer</p>

<div class="wp_codebox"><table><tr id="p33157"><td class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code" id="p331code57"><pre class="php" style="font-family:monospace;">cd <span style="color: #339933;">/</span>usr<span style="color: #339933;">/</span>local<span style="color: #339933;">/</span>src
wget <span style="color: #339933;">-</span>c http<span style="color: #339933;">:</span><span style="color: #666666; font-style: italic;">//www.vpsyou.com/sources/ZendOptimizer-3.3.0-linux-glibc21-i386.tar.gz</span>
tar zxvf ZendOptimizer<span style="color: #339933;">-</span>3<span style="color: #339933;">.</span>3<span style="color: #339933;">.</span>0<span style="color: #339933;">-</span>linux<span style="color: #339933;">-</span>glibc21<span style="color: #339933;">-</span>i386<span style="color: #339933;">.</span>tar<span style="color: #339933;">.</span>gz
<span style="color: #339933;">./</span>ZendOptimizer<span style="color: #339933;">-</span>3<span style="color: #339933;">.</span>3<span style="color: #339933;">.</span>0<span style="color: #339933;">-</span>linux<span style="color: #339933;">-</span>glibc21<span style="color: #339933;">-</span>i386<span style="color: #339933;">/</span>install<span style="color: #339933;">.</span>sh</pre></td></tr></table></div>

<p>按照它的提示一步步进行就行了。<br />
8.安装Eaccelerator</p>

<div class="wp_codebox"><table><tr id="p33158"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
</pre></td><td class="code" id="p331code58"><pre class="php" style="font-family:monospace;">cd <span style="color: #339933;">/</span>usr<span style="color: #339933;">/</span>local<span style="color: #339933;">/</span>src
wget <span style="color: #339933;">-</span>c http<span style="color: #339933;">:</span><span style="color: #666666; font-style: italic;">//www.vpsyou.com/sources/eaccelerator-0.9.6.tar.bz2</span>
tar <span style="color: #339933;">-</span>jxvf eaccelerator<span style="color: #339933;">-</span>0<span style="color: #339933;">.</span>9<span style="color: #339933;">.</span>6<span style="color: #339933;">.</span>tar<span style="color: #339933;">.</span>bz2
cd  eaccelerator<span style="color: #339933;">-</span>0<span style="color: #339933;">.</span>9<span style="color: #339933;">.</span>6
<span style="color: #339933;">/</span>usr<span style="color: #339933;">/</span>local<span style="color: #339933;">/</span>php<span style="color: #339933;">/</span>bin<span style="color: #339933;">/</span>phpize
<span style="color: #339933;">./</span>configure <span style="color: #339933;">--</span>enable<span style="color: #339933;">-</span>eaccelerator<span style="color: #339933;">=</span>shared <span style="color: #339933;">--</span>with<span style="color: #339933;">-</span>php<span style="color: #339933;">-</span>config<span style="color: #339933;">=/</span>usr<span style="color: #339933;">/</span>local<span style="color: #339933;">/</span>php<span style="color: #339933;">/</span>bin<span style="color: #339933;">/</span>php<span style="color: #339933;">-</span>config <span style="color: #339933;">--</span>with<span style="color: #339933;">-</span>eaccelerator<span style="color: #339933;">-</span>shared<span style="color: #339933;">-</span>memory
make
make install</pre></td></tr></table></div>

<p>编译安装后我们会看到屏幕提示的eaccelerator.so所在的目录，比如我得到的是/usr/local/php/lib/php/extensions/no-debug-zts-20060613/eaccelerator.so，记住这个路径，待会要用到。<br />
修改php.ini（安装完zend之后，php.ini存放于/usr/local/Zend/etc）</p>

<div class="wp_codebox"><table><tr id="p33159"><td class="line_numbers"><pre>1
</pre></td><td class="code" id="p331code59"><pre class="php" style="font-family:monospace;">vi <span style="color: #339933;">/</span>usr<span style="color: #339933;">/</span>local<span style="color: #339933;">/</span>Zend<span style="color: #339933;">/</span>etc<span style="color: #339933;">/</span>php<span style="color: #339933;">.</span>ini</pre></td></tr></table></div>

<p>查找：</p>

<div class="wp_codebox"><table><tr id="p33160"><td class="line_numbers"><pre>1
</pre></td><td class="code" id="p331code60"><pre class="php" style="font-family:monospace;">extension_dir <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;./&quot;</span></pre></td></tr></table></div>

<p>修改为：</p>

<div class="wp_codebox"><table><tr id="p33161"><td class="line_numbers"><pre>1
</pre></td><td class="code" id="p331code61"><pre class="php" style="font-family:monospace;">extension_dir <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;/usr/local/php/lib/php/extensions/no-debug-zts-20060613/&quot;</span></pre></td></tr></table></div>

<p>在文件最后，zend之前，注意，这部分内容务必放在zend之前，不然可能会出现不可预期的服务器问题。添加下列信息：</p>

<div class="wp_codebox"><table><tr id="p33162"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
</pre></td><td class="code" id="p331code62"><pre class="php" style="font-family:monospace;"><span style="color: #009900;">&#91;</span>eaccelerator<span style="color: #009900;">&#93;</span>
extension<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;eaccelerator.so&quot;</span>
eaccelerator<span style="color: #339933;">.</span>shm_size<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;16&quot;</span>
eaccelerator<span style="color: #339933;">.</span>cache_dir<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;/tmp/eaccelerator&quot;</span>
eaccelerator<span style="color: #339933;">.</span>enable<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;1&quot;</span>
eaccelerator<span style="color: #339933;">.</span>optimizer<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;1&quot;</span>
eaccelerator<span style="color: #339933;">.</span>check_mtime<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;1&quot;</span>
eaccelerator<span style="color: #339933;">.</span>debug<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;0&quot;</span>
eaccelerator<span style="color: #339933;">.</span>filter<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;&quot;</span>
eaccelerator<span style="color: #339933;">.</span>shm_max<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;0&quot;</span>
eaccelerator<span style="color: #339933;">.</span>shm_ttl<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;0&quot;</span>
eaccelerator<span style="color: #339933;">.</span>shm_prune_period<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;0&quot;</span>
eaccelerator<span style="color: #339933;">.</span>shm_only<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;0&quot;</span>
eaccelerator<span style="color: #339933;">.</span>compress<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;1&quot;</span>
eaccelerator<span style="color: #339933;">.</span>compress_level<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;9&quot;</span></pre></td></tr></table></div>

<p>然后：</p>

<div class="wp_codebox"><table><tr id="p33163"><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code" id="p331code63"><pre class="php" style="font-family:monospace;"><a href="http://www.php.net/mkdir"><span style="color: #990000;">mkdir</span></a> <span style="color: #339933;">/</span>tmp<span style="color: #339933;">/</span>eaccelerator
<a href="http://www.php.net/chmod"><span style="color: #990000;">chmod</span></a> <span style="color: #208080;">0777</span> <span style="color: #339933;">/</span>tmp<span style="color: #339933;">/</span>eaccelerator
service httpd restart</pre></td></tr></table></div>

<p>9.安装phpmyadmin</p>

<div class="wp_codebox"><table><tr id="p33164"><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code" id="p331code64"><pre class="php" style="font-family:monospace;">wget <span style="color: #339933;">-</span>c http<span style="color: #339933;">:</span><span style="color: #666666; font-style: italic;">//www.vpsyou.com/sources/phpmyadmin.tar.gz</span>
tar zxvf phpmyadmin<span style="color: #339933;">.</span>tar<span style="color: #339933;">.</span>gz
mv phpmyadmin <span style="color: #339933;">/</span>usr<span style="color: #339933;">/</span>local<span style="color: #339933;">/</span>apache2<span style="color: #339933;">/</span>htdocs<span style="color: #339933;">/</span></pre></td></tr></table></div>

<p>你可以用http://ip/phpmyadmin 访问</p>
]]></content:encoded>
			<wfw:commentRss>http://www.vpsyou.com/2010/05/06/centos-5-compile-install-apache-php-mysql.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Nginx 0.8.x PHP一键包</title>
		<link>http://www.vpsyou.com/2010/02/08/nginx-0-8-x-php-a-bond-package.html</link>
		<comments>http://www.vpsyou.com/2010/02/08/nginx-0-8-x-php-a-bond-package.html#comments</comments>
		<pubDate>Mon, 08 Feb 2010 09:53:08 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[帮助文档]]></category>
		<category><![CDATA[centos]]></category>
		<category><![CDATA[Nginx]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[一键包]]></category>

		<guid isPermaLink="false">http://www.vpsyou.com/?p=85</guid>
		<description><![CDATA[Nginx (“engine x”) 是一个高性能的 HTTP 和反向代理服务器，也是一个 IMAP/POP3/SMTP 代理服务器。 Nginx 是由 Igor Sysoev 为俄罗斯访问量第二的 Rambler.ru 站点开发的，它已经在该站点运行超过两年半了。Igor 将源代码以类BSD许可证的形式发布。 　　Nginx 超越 Apache 的高性能和稳定性，使得国内使用 Nginx 作为 Web 服务器的网站也越来越多，其中包括新浪博客、新浪播客、网易新闻等门户网站频道，六间房、56.com等视频分享网站，Discuz!官方论坛、水木社区等知名论坛，豆瓣、YUPOO相册、海内SNS、迅雷在线等新兴Web 2.0网站。 此安装包在本站的xen Centos 5.3 32bit vps上安装测试成功，建议安装在一个干净的vps上面！ 此安装包一键安装的软件包括： php-5.2.11 php-5.2.11-fpm nginx-0.8.21 mysql-5.1.39 ZendOptimizer-3.3.9 pure-ftpd-1.0.22 User_manager_for-PureFTPd_v2.1_CN ImageMagick PDO_MYSQL-1.0.2 eaccelerator-0.9.5.3 imagick-2.2.2 libevent-1.4.9 libiconv-1.13.1 libmcrypt-2.5.8 mcrypt-2.6.8 memcache-2.2.5 mhash-0.9.9.9 pcre-7.9 程序安装路径： MySQL : /usr/local/webserver/mysql PHP : [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.nginx.net/" target="_blank">Nginx</a> (“engine x”) 是一个高性能的 HTTP 和反向代理服务器，也是一个 IMAP/POP3/SMTP 代理服务器。 Nginx 是由 Igor Sysoev 为俄罗斯访问量第二的 Rambler.ru 站点开发的，它已经在该站点运行超过两年半了。Igor 将源代码以类BSD许可证的形式发布。<br />
<span id="more-85"></span><br />
　　Nginx 超越 Apache 的高性能和稳定性，使得国内使用 Nginx 作为 Web 服务器的网站也越来越多，其中包括<a href="http://blog.sina.com.cn/" target="_blank">新浪博客</a>、<a href="http://v.sina.com.cn/" target="_blank">新浪播客</a>、<a href="http://news.163.com/" target="_blank">网易新闻</a>等门户网站频道，<a href="http://www.6.cn/" target="_blank">六间房</a>、<a href="http://www.56.com/" target="_blank">56.com</a>等视频分享网站，<a href="http://www.discuz.net/" target="_blank">Discuz!官方论坛</a>、<a href="http://www.newsmth.net/" target="_blank">水木社区</a>等知名论坛，<a href="http://www.douban.com/" target="_blank">豆瓣</a>、<a href="http://www.yupoo.com/" target="_blank">YUPOO相册</a>、<a href="http://www.hainei.com/" target="_blank">海内SNS</a>、<a href="http://www.xunlei.com/" target="_blank">迅雷在线</a>等新兴Web 2.0网站。<br />
此安装包在本站的xen Centos 5.3 32bit vps上安装测试成功，建议安装在一个干净的vps上面！<br />
<strong>此安装包一键安装的软件包括：</strong><br />
<code>php-5.2.11<br />
php-5.2.11-fpm<br />
nginx-0.8.21<br />
mysql-5.1.39<br />
ZendOptimizer-3.3.9<br />
pure-ftpd-1.0.22<br />
User_manager_for-PureFTPd_v2.1_CN<br />
ImageMagick<br />
PDO_MYSQL-1.0.2<br />
eaccelerator-0.9.5.3<br />
imagick-2.2.2<br />
libevent-1.4.9<br />
libiconv-1.13.1<br />
libmcrypt-2.5.8<br />
mcrypt-2.6.8<br />
memcache-2.2.5<br />
mhash-0.9.9.9<br />
pcre-7.9</code><br />
<strong>程序安装路径：</strong><br />
<code>MySQL : /usr/local/webserver/mysql<br />
PHP : /usr/local/webserver/php<br />
Nginx : /usr/local/webserver/nginx<br />
PHPMyAdmin： /home/www/phpmyadmin<br />
Web： /home/www/default<br />
logs： /home/logs/<br />
pureftpd：/usr/local/pureftpd</code><br />
安装步骤：本人在CentOS 5.3 32bit vps上安装测试成功！<br />
1.下载附件解压缩后执行：[download id="1"]</p>

<div class="wp_codebox"><table><tr id="p8570"><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code" id="p85code70"><pre class="php" style="font-family:monospace;"> cd lnmp
<a href="http://www.php.net/chmod"><span style="color: #990000;">chmod</span></a> <span style="color: #339933;">+</span>x centos<span style="color: #339933;">.</span>sh
<a href="http://www.php.net/chmod"><span style="color: #990000;">chmod</span></a> <span style="color: #339933;">+</span>x pureftpd<span style="color: #339933;">.</span>sh</pre></td></tr></table></div>

<p>主要是赋予这两个文件可以执行的权限<br />
2.分别执行：</p>

<div class="wp_codebox"><table><tr id="p8571"><td class="line_numbers"><pre>1
2
</pre></td><td class="code" id="p85code71"><pre class="php" style="font-family:monospace;"><span style="color: #339933;">./</span>centos<span style="color: #339933;">.</span>sh
<span style="color: #339933;">./</span>pureftpd<span style="color: #339933;">.</span>sh</pre></td></tr></table></div>

<p>3.执行完centos.sh后如果没有报错那提示你安装成功，（请耐心等待，因为编译php，mysql时间花费较长）然后执行：</p>

<div class="wp_codebox"><table><tr id="p8572"><td class="line_numbers"><pre>1
</pre></td><td class="code" id="p85code72"><pre class="php" style="font-family:monospace;"> <span style="color: #339933;">/</span>usr<span style="color: #339933;">/</span>local<span style="color: #339933;">/</span>webserver<span style="color: #339933;">/</span><a href="http://www.php.net/mysql"><span style="color: #990000;">mysql</span></a><span style="color: #339933;">/</span>bin<span style="color: #339933;">/</span><a href="http://www.php.net/mysql"><span style="color: #990000;">mysql</span></a> <span style="color: #339933;">-</span>u root <span style="color: #339933;">-</span>p <span style="color: #339933;">-</span>S <span style="color: #339933;">/</span>tmp<span style="color: #339933;">/</span><a href="http://www.php.net/mysql"><span style="color: #990000;">mysql</span></a><span style="color: #339933;">.</span>sock</pre></td></tr></table></div>

<p>当出现Enter password：时请直接按回车键<br />
然后输入以下SQL语句，创建一个具有root权限的用户（admin）和密码（12345678）：</p>

<div class="wp_codebox"><table><tr id="p8573"><td class="line_numbers"><pre>1
2
</pre></td><td class="code" id="p85code73"><pre class="php" style="font-family:monospace;">GRANT ALL PRIVILEGES ON <span style="color: #339933;">*.*</span> TO <span style="color: #0000ff;">'admin'</span><span style="color: #339933;">@</span><span style="color: #0000ff;">'localhost'</span> IDENTIFIED BY <span style="color: #0000ff;">'12345678'</span><span style="color: #339933;">;</span>
GRANT ALL PRIVILEGES ON <span style="color: #339933;">*.*</span> TO <span style="color: #0000ff;">'admin'</span><span style="color: #339933;">@</span><span style="color: #0000ff;">'127.0.0.1'</span> IDENTIFIED BY <span style="color: #0000ff;">'12345678'</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p><strong>注意：密码（12345678）要和 /home/mysql/3306/mysql文件里的“mysql_password=”12345678&#8243;”一致,请自行修改！</strong><br />
4.执行：请按提示安装</p>

<div class="wp_codebox"><table><tr id="p8574"><td class="line_numbers"><pre>1
</pre></td><td class="code" id="p85code74"><pre class="php" style="font-family:monospace;">curl http<span style="color: #339933;">:</span><span style="color: #666666; font-style: italic;">//pear.php.net/go-pear | /usr/local/webserver/php/bin/php</span></pre></td></tr></table></div>

<p>5.一些配置文件的路径：<br />
<code>/home/mysql/3306/my.cnf<br />
/home/mysql/3306/mysql #(启动 start、停止stop、 重启restart)<br />
/usr/local/webserver/php/etc/php.ini<br />
/usr/local/webserver/php/etc/php-fpm.conf<br />
/usr/local/webserver/php/sbin/php-fpm #参数有 start|stop|quit|restart|reload|logrotate<br />
/usr/local/webserver/nginx/conf/nginx.conf<br />
/usr/local/webserver/nginx/conf/fcgi.conf<br />
/usr/local/webserver/nginx/sbin/nginx<br />
/usr/local/pureftpd/pureftpd-mysql.conf<br />
/usr/local/pureftpd/pure-ftpd.conf<br />
</code><br />
6.若修改php.ini了请执行/usr/local/webserver/php/sbin/php-fpm reload ，若修改了nginx.conf请执行kill -HUP `cat /usr/local/webserver/nginx/nginx.pid`，若检查nginx.conf配置文件是否正确请执行/usr/local/webserver/nginx/sbin/nginx -t，若正确会显示：<br />
<code>the configuration file /usr/local/webserver/nginx/conf/nginx.conf syntax is ok<br />
the configuration file /usr/local/webserver/nginx/conf/nginx.conf was tested successfully</code><br />
7.此安装包已经添加vps系统启动时自动启动php-fpm、nginx、mysql、pureftpd。如果发现ftp不能登录，请执行/pureftpd-start。<br />
8.执行完pureftpd.sh后请用http://youdomain.com/ftp/install.php安装ftp账号管理程序<br />
9.请用http://youdomain.com/phpinfo.php测试安装环境<br />
软件下载地址：<br />
<a href="http://www.vpsyou.com/lnmp/lnmp.zip">http://www.vpsyou.com/lnmp/lnmp.zip</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.vpsyou.com/2010/02/08/nginx-0-8-x-php-a-bond-package.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

