zoukankan      html  css  js  c++  java
  • Linux(CentOS_7.6)安装Nginx

    1.安装依赖

    1
    2

    yum -y install gcc zlib zlib-devel pcre-devel openssl openssl-devel

    2.下载Nginx并解压

    1
    2
    3
    4
    5
    6
    7
    cd /usr/local
    # 下载Nginx的压缩包
    wget http://nginx.org/download/nginx-1.16.0.tar.gz
    # 解压
    tar -xzf nginx-1.16.0.tar.gz
    # 重命名为nginx
    mv nginx-1.16.0 nginx

    3.安装Nginx

    1
    2
    3
    4
    5
    6
    # 进入nginx目录
    cd /usr/local/nginx
    # 这里要指定目录及配置文件
    ./configure
    大专栏  Linux(CentOS_7.6)安装Nginxpan class="line">make
    make install

    如果make install报错如下:

    1
    2
    3
    4
    5
    cp conf/koi-win '/usr/local/nginx/conf'
    cp: ‘conf/koi-win’ and ‘/usr/local/nginx/conf/koi-win’ are the same file
    make[1]: *** [install] Error 1
    make[1]: Leaving directory `/usr/local/nginx'
    make: *** [install] Error 2

    则使用./configure --prefix=/usr/local/nginx --conf-path=/usr/local/nginx/conf/nginx.conf

    4.启动Nginx

    1
    2
    3
    4
    # 进入Nginx目录
    cd /usr/local/nginx
    # 指定配置文件启动
    ./nginx -c /usr/local/nginx/conf/nginx.conf

    5.检查Nginx是否启动

    1
    ps -ef|grep nginx

    下图为启动成功示例:

    启动成功图示

  • 相关阅读:
    java中VO、PO、DTO 、DO、POJO、BO、TO
    java可变参数
    排序
    快速排序
    单元测试概述
    Spring 对事务管理的支持
    Spring的事务管理基础知识
    混合切面类型
    基于Schema配置切面
    Spring AOP @AspectJ进阶
  • 原文地址:https://www.cnblogs.com/lijianming180/p/12366570.html
Copyright © 2011-2022 走看看