zoukankan      html  css  js  c++  java
  • 安装Nginx

    先安装gcc,gcc-c++编译库

    1 yum install -y gcc gcc-c++

    安装PCRE库

    1 cd /usr/local/
    2 wget http://jaist.dl.sourceforge.net/project/pcre/pcre/8.43/pcre-8.43.tar.gz //注意版本
    3 tar -zxvf pcre-8.43.tar.gz
    4 cd pcre-8.43
    5 ./configure
    6 make && make install

    安装SSL库

    1 cd /usr/local/
    2 wget https://www.openssl.org/source/openssl-1.0.2u.tar.gz//注意版本
    3 tar -zxvf openssl-1.0.2u.tar.gz
    4 cd openssl-1.0.2u
    5 ./config
    6 make && make install

    安装zlib

    1 cd /usr/local/
    2 wget http://zlib.net/zlib-1.2.11.tar.gz
    3 tar -zxvf zlib-1.2.11.tar.gz
    4 cd zlib-1.2.11
    5 ./configure
    6 make && make install

    安装Nginx

    1 cd /usr/local/
    2 wget https://nginx.org/download/nginx-1.17.7.tar.gz//注意版本
    3 tar -zxvf nginx-1.17.7.tar.gz
    4 cd nginx-1.17.7
    5 ./configure --user=nobody --group=nobody --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_gzip_static_module --with-http_realip_module --with-http_sub_module --with-http_ssl_module // --with-http_ssl_module:这个不加后面在nginx.conf配置ssl:on后,启动会报nginx: [emerg] unknown directive "ssl" in /opt/nginx/conf/nginx.conf 异常
    6 make && make install

    如果碰到以下异常:

    ./configure: error: SSL modules require the OpenSSL library.
    You can either do not enable the modules, or install the OpenSSL library
    into the system, or build the OpenSSL library statically from the source
    with nginx by using --with-openssl=<path> option.

    解决办法:

    1 yum -y install openssl openssl-devel

    调试及配置

    启动Nginx

    1 /usr/local/nginx/sbin/nginx

    停止Nginx

    1 /usr/local/nginx/sbin/nginx -s stop

    重启Nginx

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

    安装完成,访问IP地址

  • 相关阅读:
    模拟出栈
    全排列 next_permutation 用法
    区间覆盖
    BFS GPLT L2-016 愿天下有情人都是失散多年的兄妹
    GPLT L2-014 列车调度
    图的联通分量个数统计(判断图是否联通)
    堆排序 GPLT L2-012 关于堆的判断
    牛客挑战赛 30 A 小G数数
    由树的中后序遍历求树的前层序遍历
    【HDOJ4699】Editor(对顶栈,模拟)
  • 原文地址:https://www.cnblogs.com/lihuadeblog/p/12107407.html
Copyright © 2011-2022 走看看