<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title><![CDATA[向东博客 专注WEB应用 构架之美 --- 构架之美，在于尽态极妍 | 应用之美，在于药到病除]]></title> 
<link>http://www.jackxiang.com/index.php</link> 
<description><![CDATA[赢在IT，Playin' with IT,Focus on Killer Application,Marketing Meets Technology.]]></description> 
<language>zh-cn</language> 
<copyright><![CDATA[向东博客 专注WEB应用 构架之美 --- 构架之美，在于尽态极妍 | 应用之美，在于药到病除]]></copyright>
<item>
<link>http://www.jackxiang.com/post//</link>
<title><![CDATA[CentOS 5.4的nginx+php+mysql解决方案]]></title> 
<author>jack &lt;xdy108@126.com&gt;</author>
<category><![CDATA[WEB2.0]]></category>
<pubDate>Sat, 23 Jan 2010 04:02:27 +0000</pubDate> 
<guid>http://www.jackxiang.com/post//</guid> 
<description>
<![CDATA[ 
	来源：http://rashost.com/blog/centos5-vps-nginx-solution2<br/><br/>本文介绍在CentOS 5 VPS下的nginx+php+mysql的解决方案之二，本方案使用php-fpm作为fastcgi的进程管理器。<br/><br/>使用php-fpm就必须重新编译php，不能使用系统自带的php。我们的观点是尽量使用系统自带的，除非功能满足不了。本方案中MySQL是使用CentOS 5自带的，Nginx是我们自己编译的。<br/>安装Nginx<br/><br/>centos系统不带nginx，我们用的Nginx是自己编译的，Nginx版本是最新稳定版本0.7.61，到 http://rashost.com/download 下载nginx，然后开始安装：<br/><br/>rpm -ivh nginx-0.7*.rpm<br/>chkconfig --list nginx<br/>chkconfig nginx on<br/>/etc/init.d/nginx start<br/>rpm -ql nginx<br/><br/>上面的rpm -ql nginx命令是看看nginx的文件都安装在哪些目录下面了，可以看到nginx的缺省网页目录应该是/usr/share/nginx/html/<br/><br/>通过浏览器访问，应该能看到nginx的缺省网页了，说明nginx正常工作了！<br/>安装MySQL<br/><br/>我们使用CentOS自带的MySQL，安装命令：<br/><br/>yum install -y mysql-server<br/>chkconfig --list mysqld<br/>chkconfig mysqld on<br/>/etc/init.d/mysqld start<br/><br/>运行mysql -uroot命令，应该可以正常连接到MySQL<br/>安装php &amp; php-fpm<br/><br/>先安装php &amp; php-fpm所依赖的一些库文件：<br/><br/>yum install libmhash libmcrypt libtool-ltdl libpng libjpeg curl<br/><br/>然后到 http://rashost.com/download 下载我们自己编译的php-fpm，并安装：<br/><br/>cd /opt<br/>tar zxf php-fpm-5.2.10*.tar.gz<br/>/opt/php/sbin/php-fpm start<br/><br/>然后编辑/etc/rc.local，在其中加入/opt/sbin/php-fpm start<br/>整合<br/><br/>首先在/usr/share/nginx/html目录下创建文件test.php，其内容很简单，只要下面一行：<br/><br/>&lt;?phpinfo();?&gt;<br/><br/>假设所在VPS的地址是centos5.rashost.com，这时通过浏览器访问http://centos5.rashost.com/test.php是得不到正确的显示结果的。<br/><br/>修改nginx的配置文件/etc/nginx/nginx.conf，在文件内搜索fastcgi_pass，修改该部分内容为：<br/><br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;location ~ &#92;.php$ {<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;root&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; html;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;fastcgi_pass&nbsp;&nbsp; 127.0.0.1:9000;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;fastcgi_index&nbsp;&nbsp;index.php;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;fastcgi_param&nbsp;&nbsp;SCRIPT_FILENAME&nbsp;&nbsp;$document_root/$fastcgi_script_name;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;include&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;fastcgi_params;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br/><br/>然后重启nginx:<br/><br/>/etc/init.d/nginx/restart<br/><br/>然后在浏览器中访问test.php页面，就应该能正确显示了，reboot VPS测试一下，各个模块应该都能自带启动。大功告成
]]>
</description>
</item><item>
<link>http://www.jackxiang.com/post//#blogcomment</link>
<title><![CDATA[[评论] CentOS 5.4的nginx+php+mysql解决方案]]></title> 
<author> &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Thu, 01 Jan 1970 00:00:00 +0000</pubDate> 
<guid>http://www.jackxiang.com/post//#blogcomment</guid> 
<description>
<![CDATA[ 
	
]]>
</description>
</item>
</channel>
</rss>