CentOS-5 yum安装nginx php53 mysql55 lnmp环境

有运维或运维开发方面的需求,可以联系博主QQ 452336092或Email:admin#centos.bz(收费)

文章目录
[隐藏]

对于lnmp的使用,www.centos.bz已经提供有lnmp安装包,但如果想快速配置环境,则推荐yum安装了。

1、导入外部软件库

centos-5 32位:

  1. rpm -Uvh http://dl.iuscommunity.org/pub/ius/stable/Redhat/5/i386/epel-release-5-4.noarch.rpm
  2. rpm -Uvh http://dl.iuscommunity.org/pub/ius/stable/Redhat/5/i386/ius-release-1.0-10.ius.el5.noarch.rpm
  3. rpm -Uvh http://nginx.org/packages/centos/5/noarch/RPMS/nginx-release-centos-5-0.el5.ngx.noarch.rpm

centos-5 64位:

  1. rpm -Uvh http://dl.iuscommunity.org/pub/ius/stable/Redhat/5/x86_64/epel-release-5-4.noarch.rpm
  2. rpm -Uvh http://dl.iuscommunity.org/pub/ius/stable/Redhat/5/x86_64/ius-release-1.0-10.ius.el5.noarch.rpm
  3. rpm -Uvh http://nginx.org/packages/centos/5/noarch/RPMS/nginx-release-centos-5-0.el5.ngx.noarch.rpm

2、yum安装lnmp

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

3、配置lnmp

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

修改为:

  1. location ~ \.php$ {
  2.         root           html;
  3.         fastcgi_pass   127.0.0.1:9000;
  4.         fastcgi_index  index.php;
  5.         fastcgi_param  SCRIPT_FILENAME  /usr/share/nginx/html$fastcgi_script_name;
  6.         include        fastcgi_params;
  7.     }

4、启动lnmp

  1. chkconfig php-fpm on
  2. chkconfig nginx on
  3. chkconfig mysqld on
  4. service php-fpm start
  5. service nginx start
  6. service mysqld start

转载请保留原文链接:Linux运维日志 » CentOS-5 yum安装nginx php53 mysql55 lnmp环境

打赏

如果此文对你有所帮助,请随意打赏鼓励作者^_^