• lnmp环境搭建


    Lnmp搭建配置:

    1、 因yum仓库中没有nginx源,因此需创建一个nginx源。Vim /etc/yum.respo/nginx.respo

     

    2、 yum update

    3、 yum list|grep nginx

    4、 yum install nginx

    5、 yum install mysql-server

    6、 mysql –uroot –p123456连接数据库

    7、 yum install php

    yum install php-fpm(nginx本身不支持php,安装php-fpm让nginx支持php)

    8、 vim /etc/nginx/conf.d/default.conf在第37行插入

     

    9、 查看nginx状态 service nginx status如是停止的,就启动nginx。如无法启动nginx,查看端口netstat –autp|grep 80是否又被占用,冲突导致无法启动nginx,如有显示Apache什么占用了80端口,就kill掉该进程。

    10、rpm –ql nginx 查看网站根目录地址

     

    Cd /usr/share/nginx/html

    Vim test.html

    11、检查防火墙是否开启 iptables –L如开启,就关掉防火墙。再检查下selinux状态,getenforce看是否是permisstive宽松的状态。如不是用setenforce 0改变状态为permisstive宽松状态。

     

    12、浏览器中测试访问php是否能成功搭建nginx

    13、准备测试数据库,service php-fpm restart,编写一个项目进行测试vim /usr/share/nginx/html/666db.php

    14、在浏览器中测试访问php是否能成功连接数据库

     

                                                                      

  • 相关阅读:
    axios,ajax,xhr 请求携带Cookie
    js中reduce的方法和去重
    H5图片预览
    网页唤起qq加群
    tab切换中嵌套swiper轮播
    CantOS的安装
    共享文件夹或文件
    Vue中,iframe中的子网页,调用父网页的方法
    禁止未使用的变量 ( `no-unused-vars`)
    vite + vue3 + ts搭建项目
  • 原文地址:https://www.cnblogs.com/aibudongshiting/p/8545770.html
Copyright © 2020-2023  润新知