zoukankan      html  css  js  c++  java
  • lnmp环境

    1、准备一台服务器

    192.168.52.35

    2、关闭防火墙

    systemctl stop firewalld

    setenforce 0

    3、上传nginx包并解压

    [root@localhost ~]# ls
    anaconda-ks.cfg  nginx-1.16.1  nginx-1.16.1.tar.gz  original-ks.cfg

    4、安装nginx依赖环境

    yum -y install gcc gcc-c++ pcre-devel  zlib-devel

    5、解压nginx,编译,安装

    cd /nginx-1.161      ./configure  && make &&  make install

    6、配置nginx文件

    vim /usr/local/nginx/conf/nginx.conf
    
    
        server {
            listen       80;
            server_name  localhost;
    
            #charset koi8-r;
    
            #access_log  logs/host.access.log  main;
    
            location / {
                root   html;
                index  index.php index.html index.htm;     #添加index.php
            }
    
    将这几行的注释去掉   CTRL+V  方向键下拉+D
           location ~ .php$ {
               root           html;
               fastcgi_pass   127.0.0.1:9000;
               fastcgi_index  index.php;
               fastcgi_param  SCRIPT_FILENAME          
                    $document_root$fastcgi_script_name;   #将这行改动$document_root
               include        fastcgi_params;
           }

    7、启动nginx

    /usr/local/nginx/sbin/nginx

    8、安装lnmp环境

    yum -y install mariadb mariadb--server php php-gd php-mysql php-fpm

    9、启动php-fpm

    systemctl start php-fpm

    10、编写PHP测试页面

    [root@localhost ~]# vim /usr/local/nginx/html/index.php
    [root@localhost ~]# cat /usr/local/nginx/html/index.php
    <?php
    phpinfo();
    ?>
    [root@localhost ~]# 

    11、重新挂载nginx

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

    12、lnmp环境搭建完成

  • 相关阅读:
    报错18:28:21: Debugging starts QLayout: Attempting to add QLayout ““ to MainWindow “MainWindow“, which
    春 景
    sysTime(系统毫秒)
    balabala视频格式转换器
    tasklist /FI命令结论
    QFileSystemWatcher
    Qfileinfo
    Qdir
    欢迎光临我的普吉岛芭东海滩公寓
    使用ArcGIS GP服务之一框架介绍
  • 原文地址:https://www.cnblogs.com/Zrecret/p/12068326.html
Copyright © 2011-2022 走看看