2014-02-24 11:38:01
来 源
itjs.cn
LNMP
本文介绍CentOS5系统中使用yum快速安装NginxPHP53MySQL55LNMP环境,希望对于初学Nginx服务器相关的朋友有帮助,更多Nginx安装、配置、报错处理等资源请本站内搜索。。

1、导入外部软件库

centos-5 32位:

rpm -Uvh http://dl.iuscommunity.org/pub/ius/stable/Redhat/5/i386/epel-release-5-4.noarch.rpm

rpm -Uvh http://dl.iuscommunity.org/pub/ius/stable/Redhat/5/i386/ius-release-1.0-10.ius.el5.noarch.rpm

rpm -Uvh http://nginx.org/packages/centos/5/noarch/RPMS/nginx-release-centos-5-0.el5.ngx.noarch.rpm

centos-5 64位:

rpm -Uvh http://dl.iuscommunity.org/pub/ius/stable/Redhat/5/x86_64/epel-release-5-4.noarch.rpm

rpm -Uvh http://dl.iuscommunity.org/pub/ius/stable/Redhat/5/x86_64/ius-release-1.0-10.ius.el5.noarch.rpm

rpm -Uvh http://nginx.org/packages/centos/5/noarch/RPMS/nginx-release-centos-5-0.el5.ngx.noarch.rpm

2、yum安装lnmp

yum install mysql55-server mysql55 php53u-fpm php53u-mysql php53u-gd php53u-mbstring php53u-mcrypt nginx

3、配置lnmp

vi /etc/nginx/conf.d/default.conf

修改为:

location ~ .php$ {

root           html;

fastcgi_pass   127.0.0.1:9000;

fastcgi_index  index.php;

fastcgi_param  SCRIPT_FILENAME  /usr/share/nginx/html$fastcgi_script_name;

include        fastcgi_params;

}

4、启动lnmp

chkconfig php-fpm on

chkconfig nginx on

chkconfig mysqld on

service php-fpm start

service nginx start

service mysqld start

声明: 此文观点不代表本站立场;转载须要保留原文链接;版权疑问请联系我们。