美文网首页
centos 6.5 使用yum 快速搭建lnmp 环境

centos 6.5 使用yum 快速搭建lnmp 环境

作者: 板砖铺路 | 来源:发表于2017-07-10 10:01 被阅读0次

    内部使用环境,就懒得用 源码搭建了

         闲扯淡...    直接搞代码

    安装 nginx 需要搞一个能使用的源地址,默认的,aliyun 的地址都不能直接用来安装nginx 只能上网搞一个,索性留下了一个能用的

    [root@XY-0-119-linux yum.repos.d]# cat atomic.repo

    # Name: Atomic Rocket Turtle RPM Repository for CentOS / Red Hat Enterprise Linux 6 -

    [atomic]

    name = CentOS / Red Hat Enterprise Linux $releasever - atomic

    mirrorlist = http://updates.atomicorp.com/channels/mirrorlist/atomic/centos-$releasever-$basearch

    enabled = 1

    protect = 0

    gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY.art.txt

    file:///etc/pki/rpm-gpg/RPM-GPG-KEY.atomicorp.txt

    # Almost Stable, release candidates for [atomic]

    [atomic-testing]

    name = CentOS / Red Hat Enterprise Linux $releasever - atomic - (Testing)

    mirrorlist = http://updates.atomicorp.com/channels/mirrorlist/atomic-testing/centos-$releasever-$basearch

    enabled = 0

    protect = 0

    gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY.art.txt

    file:///etc/pki/rpm-gpg/RPM-GPG-KEY.atomicorp.txt

    gpgcheck = 1

    或者一条命令 搞定

    wget -q -O - http://www.atomicorp.com/installers/atomic | sh

    还有一个只能安装nginx的 索性也下,来者不拒

    # nginx.repo

    [nginx]

    name=nginx repo

    baseurl=http://nginx.org/packages/centos/6/$basearch/

    gpgcheck=0

    enabled=1

    搞定这个东西就可以疯狂式安装了

    yum  -y install nginx 

    #安装完成之后 启动nginx

    /etc/init.d/nginx  restart

    可以愉快的使用 curl  http://localhost   

    看到Welcome nginx 的字眼   就说明安装nginx 成功了

    接下来安装 mysql 数据库

    yum -y install mysql  mysql-server  mysql-devel

    安装完成mysql之后就可以直接启动mysql数据库

    完成之后可以查看端口是否启动

    root@XY-0-45-root> netstat -atnpu | grep  3306

    tcp        0      0 0.0.0.0:3306                0.0.0.0:*                  LISTEN      2085/mysqld

    mysql到此结束。安装完成

    接下来安装的比较多 php   (世界上最好的语言...嘎嘎)

    yum -y install php-cli php-soap php-mysql php-mssql php-pear php-gd php-tidy php-xmlrpc php-devel php  php-pdo php-mcrypt php-snmp php-xml php-bcmath php-pecl php-common php-ldap php-imap php-odbc php-mbstring php-mhash

    耐心的等待完成

    启动php程序

    /etc/init.d/php-fpm  start

    起来了之后 查看一下端口 9000

    没有问题之后 修改nginx配置文件 

    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;

    }

    OK 

    开始测试php 

    在/usr/share/nginx/html 目录下面建立一个 index.php文件

    <?php

    phpinfo();

    ?>

    从此告别搭建仪式....... 开启新的篇章

    相关文章

      网友评论

          本文标题:centos 6.5 使用yum 快速搭建lnmp 环境

          本文链接:https://www.haomeiwen.com/subject/gnsvwttx.html