码迷,mamicode.com
首页 > 其他好文 > 详细

Centos 6.4 简单实现LNMP架构

时间:2015-05-26 19:13:26      阅读:209      评论:0      收藏:0      [点我收藏+]

标签:lnmp

一、安装版本

nginx 1.6.3

pcre-devel 7.8-6

mysql 5.1.73

php 5.3.3


二、安装需要的包

[root@localhost ~]#yum -y install lrzsz

[root@localhost ~]#yum -y install gcc pcre-devel zlib zlib-devel


编译安装nginx

[root@localhost ~]#./configure --prefix=/usr/local/nginx

[root@localhost ~]#make && make install


启动nginx

[root@localhost ~]#/usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf



安装mysql

[root@localhost ~]#yum -y install mysql mysql-server mysql-devel 

[root@localhost ~]#/etc/init.d/mysqld start



安装php 

[root@localhost ~]#yum install php php-mysql php-common php-gd php-mbstring php-mcrypt php-devel php-xml 

[root@localhost ~]#yum install php-fpm

[root@localhost ~]#/etc/init.d/php-fpm start


配置nginx支持php

[root@localhost conf]# cat /usr/local/nginx/html/index.php 

<?php

phpinfo();

?>

[root@localhost conf]#vi /usr/local/nginx/conf/nginx.conf


        location ~ \.php$ {

            root           html;

            fastcgi_pass   127.0.0.1:9000;

            fastcgi_index  index.php;

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

            include        fastcgi_params;

        }


重启nginx

/usr/local/nginx/sbin/nginx -s reload


三、访问域名测试

http://www.webtest.com/index.php


技术分享

本文出自 “卡卡西” 博客,请务必保留此出处http://whnba.blog.51cto.com/1215711/1655292

Centos 6.4 简单实现LNMP架构

标签:lnmp

原文地址:http://whnba.blog.51cto.com/1215711/1655292

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!