• linux安装nginx 简单版


    1安装依赖包

    安装pcre
    yum install pcre*

    安装openssl
    yum install openssl*

    安装zlib
    yum install zlib
    yum install zlib-devel

    安装gcc
    yum -y install gcc automake autoconf libtool make
    yum install gcc gcc-c++

    2安装nginx

    下载

    wgt http://nginx.org/download/nginx-1.19.0.tar.gz

    解压缩。
    tar  -xvzf  nginx-1.19.0.tar.gz

    检查编译
    ./configure --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module --with-http_gzip_static_module --with-openssl=/opt/soft/openssl-1.1.1g

    (其中/opt/soft/openssl-1.1.1g是你本地安装的openssl路径,如果不加这些参数,则编译通过但 make时报错No rule to make target `/usr/local/ssl/include/openssl/ssl.h', needed by `objs/src/core/nginx.o'. Stop.)

    编译

    make

    安装

    make install

    make出现如下错误时

    [root@localhost nginx-1.19.1]# make
    make -f objs/Makefile
    make[1]: Entering directory `/opt/nginx-1.19.1'
    cd /usr/local/ssl
    && if [ -f Makefile ]; then make clean; fi
    && ./config --prefix=/usr/local/ssl/.openssl no-shared no-threads
    && make
    && make install_sw LIBDIR=lib
    /bin/sh: line 2: ./config: No such file or directory
    make[1]: *** [/usr/local/ssl/.openssl/include/openssl/ssl.h] Error 127
    make[1]: Leaving directory `/opt/nginx-1.19.1'
    make: *** [build] Error 2

    解决方案

    找到/opt/nginx/nginx-1.19.1/auto/lib/openssl/conf 中

    CORE_INCS="$CORE_INCS $OPENSSL/.openssl/include"
    CORE_DEPS="$CORE_DEPS $OPENSSL//.openssl/include/openssl/ssl.h"
    CORE_LIBS="$CORE_LIBS $OPENSSL/.openssl/lib/libssl.a"
    CORE_LIBS="$CORE_LIBS $OPENSSL/.openssl/lib/libcrypto.a"
    CORE_LIBS="$CORE_LIBS $NGX_LIBDL"
    CORE_LIBS="$CORE_LIBS $NGX_LIBPTHREAD"

    改为 (去掉多余/.openssl)
    CORE_INCS="$CORE_INCS $OPENSSL/include"
    CORE_DEPS="$CORE_DEPS $OPENSSL/include/openssl/ssl.h"
    CORE_LIBS="$CORE_LIBS $OPENSSL/lib/libssl.a"
    CORE_LIBS="$CORE_LIBS $OPENSSL/lib/libcrypto.a"
    CORE_LIBS="$CORE_LIBS $NGX_LIBDL"
    CORE_LIBS="$CORE_LIBS $NGX_LIBPTHREAD"

  • 相关阅读:
    Ubuntu mongodb 安装和配置
    最基本的SQL语法/语句
    Sphinx学习之sphinx的安装篇
    六关节机器人的雅可比矩阵及微分运算
    六关节机器人的逆运动学计算
    六关节机器人的正运动学计算
    六关节机器人末端的微分运动
    Python3 升级pip
    一般多项式曲线的最小二乘回归(Linear Regression)
    关于卡尔曼滤波(Kalman Filter)的很好讲解
  • 原文地址:https://www.cnblogs.com/rdchen/p/13408769.html
Copyright © 2020-2023  润新知