<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title><![CDATA[向东博客 专注WEB应用 构架之美 --- 构架之美，在于尽态极妍 | 应用之美，在于药到病除]]></title> 
<link>https://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>https://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, 19 Dec 2009 09:11:09 +0000</pubDate> 
<guid>https://jackxiang.com/post//</guid> 
<description>
<![CDATA[ 
	在CentOS5 下的nginx+php+mysql的解决方案有多个，本文介绍其中的解决方案之一。<br/><br/>本文基于64位的CentOS 5 ，如果是32位的，请在相应部分做修改。<br/><br/>本解决方案使用瑞豪开源自己编译的最新稳定版本的Nginx，fastcgi进程管理使用spawn-fcgi，还有CentOS 5自带的5.0.45版本的MySQL和5.1.6版本的php。<br/><br/>优缺点<br/>本方案的优点是使用CentOS5自带的php和mysql，扩展性好，php的各种扩展yum库里面都有，都可以直接使用；另外，由于使用系统自带的php和mysql，安全性要好一些，如果有什么漏洞都可以直接升级为centos官方的最新版本。由于使用spawn-fcgi，所以无须重新编译php。<br/><br/>本方案的缺点有：<br/>php和mysql都是centos自带的版本，不是最新版本，万一用到php最新版本的某些特性则就不行了。<br/><br/>安装Nginx<br/>到 http://rashost.com/download 下载nginx-0.7.61-1.x86_64.rpm<br/><br/>#rpm -ivh nginx-0.7.61-1.x86_64.rpm<br/>service nginx start<br/>ntsysv nginx on<br/>rpm -ql nginx<br/><br/>上面的rpm -ql nginx命令是看看nginx的文件都安装在哪些目录下面了，可以看到nginx的缺省网页目录应该是/usr/share/nginx/html/<br/><br/>通过浏览器访问，应该能看到nginx的缺省网页了，说明nginx正常工作了！<br/><br/>安装MySQL<br/><br/>#yum -y install mysql-server<br/>##ntsysv <br/>选中mysql<br/>#service mysql start<br/>或者 /etc/init.d/mysqld start<br/><br/>改密码<br/>/usr/bin/mysqladmin -u root password '123456'<br/><br/>安装PHP<br/>yum install -y php-cgi php-mysql<br/><br/>安装spawn-fcgi<br/>到http://rashost.com/download 下载 spawn-fcgi-1.6.2-1.32.x86_64.rpm<br/><br/>rpm -ivh spawn-fcgi-1.6.2-1.32.x86_64.rpm<br/><br/><br/>然后在/etc/rc.local里面加入spawn-fcgi的启动命令：<br/><br/>#spawn-fcgi -C 10 -a 127.0.0.1 -p 9000 -u nginx -d /tmp -f php-cgi<br/><br/>其中的-C 10参数是指启动的php fastcgi的进程数目，这个数值可以根据网站的访问量和内存大小修改。<br/><br/>然后先手工启动一下php:<br/><br/>spawn-fcgi -C 10 -a 127.0.0.1 -p 9000 -u nginx -d /tmp -f php-cgi<br/><br/>整合<br/>首先在/usr/share/nginx/html目录下创建文件test.php，其内容很简单，只要下面一行：<br/><br/><?phpinfo();?><br/><br/>通过浏览器访问http://192.168.1.5/test.php是得不到正确的显示结果的。<br/><br/>修改nginx的配置文件/etc/nginx/nginx.conf，在文件内搜索fastcgi_pass，修改该部分内容为：<br/><br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;location ~ &#92;.php$ &#123;<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;&#125;<br/><br/>然后重启nginx:<br/><br/>/etc/init.d/nginx/restart<br/><br/>然后在浏览器中访问test.php页面，就应该能正确显示了，reboot 测试一下，各个模块应该都能自带启动。<br/><br/>来源:http://rashost.com/blog/centos5-vps-nginx-solution1<br/>
]]>
</description>
</item><item>
<link>https://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>https://jackxiang.com/post//#blogcomment</guid> 
<description>
<![CDATA[ 
	
]]>
</description>
</item>
</channel>
</rss>