{"id":1003,"date":"2009-11-29T19:16:00","date_gmt":"2009-11-29T11:16:00","guid":{"rendered":"\/?p=1003"},"modified":"2009-11-29T19:16:00","modified_gmt":"2009-11-29T19:16:00","slug":"1003","status":"publish","type":"post","link":"https:\/\/blog.vimge.com\/archives\/linux\/1003.html","title":{"rendered":"CentOS 5.2\u7684Nginx+PHP+MySQL\u73af\u5883\u642d\u5efa"},"content":{"rendered":"
PS\uff1a\u5982\u679cnginx\u5b89\u88c5\u5b8c\u6bd5\u540e\u770b\u4e0d\u5230\u6d4b\u8bd5\u9875\u9762\uff0c\u8bd5\u4e00\u4e0bservice iptables stop.<\/p>\n
\u672c\u6587\u57fa\u4e8e64\u4f4d\u7684CentOS 5 VPS\uff0c\u5982\u679c\u662f32\u4f4d\u7684VPS\uff0c\u8bf7\u5728\u76f8\u5e94\u90e8\u5206\u505a\u4fee\u6539\u3002<\/p>\n
\u672c\u89e3\u51b3\u65b9\u6848\u4f7f\u7528\u745e\u8c6a\u5f00\u6e90\u81ea\u5df1\u7f16\u8bd1\u7684\u6700\u65b0\u7a33\u5b9a\u7248\u672c\u7684Nginx\uff0cfastcgi\u8fdb\u7a0b\u7ba1\u7406\u4f7f\u7528spawn-fcgi\uff0c\u8fd8\u6709CentOS 5\u81ea\u5e26\u76845.0.45\u7248\u672c\u7684MySQL\u548c5.1.6\u7248\u672c\u7684php\u3002
\u4f18\u7f3a\u70b9<\/p>\n
\u672c\u65b9\u6848\u7684\u4f18\u70b9\u662f\u4f7f\u7528CentOS5\u81ea\u5e26\u7684php\u548cmysql\uff0c\u6269\u5c55\u6027\u597d\uff0cphp\u7684\u5404\u79cd\u6269\u5c55yum\u5e93\u91cc\u9762\u90fd\u6709\uff0c\u90fd\u53ef\u4ee5\u76f4\u63a5\u4f7f\u7528\uff1b\u53e6\u5916\uff0c\u7531\u4e8e\u4f7f\u7528\u7cfb\u7edf\u81ea\u5e26\u7684php\u548cmysql\uff0c\u5b89\u5168\u6027\u8981\u597d\u4e00\u4e9b\uff0c\u5982\u679c\u6709\u4ec0\u4e48\u6f0f\u6d1e\u90fd\u53ef\u4ee5\u76f4\u63a5\u5347\u7ea7\u4e3acentos\u5b98\u65b9\u7684\u6700\u65b0\u7248\u672c\u3002\u7531\u4e8e\u4f7f\u7528spawn-fcgi\uff0c\u6240\u4ee5\u65e0\u987b\u91cd\u65b0\u7f16\u8bd1php\u3002<\/p>\n
\u672c\u65b9\u6848\u7684\u7f3a\u70b9\u6709\uff1a<\/strong> \u5b89\u88c5Nginx<\/strong><\/p>\n \u5230 http:\/\/rashost.com\/download<\/a> \u4e0b\u8f7dnginx-0.7.61-1.x86_64.rpm<\/p>\n \u5b89\u88c5\u547d\u4ee4\uff1a<\/strong><\/p>\n rpm -ivh nginx-0.7.61-1.x86_64.rpm \u4e0a\u9762\u7684rpm -ql nginx\u547d\u4ee4\u662f\u770b\u770bnginx\u7684\u6587\u4ef6\u90fd\u5b89\u88c5\u5728\u54ea\u4e9b\u76ee\u5f55\u4e0b\u9762\u4e86\uff0c\u53ef\u4ee5\u770b\u5230nginx\u7684\u7f3a\u7701\u7f51\u9875\u76ee\u5f55\u5e94\u8be5\u662f\/usr\/share\/nginx\/html\/<\/p>\n \u901a\u8fc7\u6d4f\u89c8\u5668\u8bbf\u95ee\uff0c\u5e94\u8be5\u80fd\u770b\u5230nginx\u7684\u7f3a\u7701\u7f51\u9875\u4e86\uff0c\u8bf4\u660enginx\u6b63\u5e38\u5de5\u4f5c\u4e86\uff01<\/p>\n \u5b89\u88c5MySQL<\/strong><\/p>\n yum install -y mysql-server \u8fd0\u884cmysql -uroot\u547d\u4ee4\uff0c\u5e94\u8be5\u53ef\u4ee5\u6b63\u5e38\u8fde\u63a5\u5230MySQL<\/p>\n
php\u548cmysql\u90fd\u662fcentos\u81ea\u5e26\u7684\u7248\u672c\uff0c\u4e0d\u662f\u6700\u65b0\u7248\u672c\uff0c\u4e07\u4e00\u7528\u5230php\u6700\u65b0\u7248\u672c\u7684\u67d0\u4e9b\u7279\u6027\u5219\u5c31\u4e0d\u884c\u4e86\u3002
spawn-fcgi\u7684\u6027\u80fd\u4e0d\u5982php-fpm\uff0c\u5982\u679c\u60f3\u7528php-fpm\uff0c\u8bf7\u53c2\u8003 http:\/\/rashost.com\/blog\/centos5-vps-nginx-solution2<\/a><\/p>\n
chkconfig –list nginx
chkconfig nginx on
\/etc\/init.d\/nginx start
rpm -ql nginx<\/p>\n
chkconfig –list mysqld
chkconfig mysqld on
\/etc\/init.d\/mysqld start<\/p>\n