升级openssl后nginx无法编译安装问题之解决方法

  Linux下升级openssl到新版本(如CentOS 7中openssl升级到openssl 1.1.1d)后,其实原nginx并没有真正调用新的openssl 1.1.1d。怎么办呢?需对nginx重新编译,但在编译安装过程中有人就无法编译nginx了,遇到如下问题:

[root@centos7 nginx-1.16.1]# make
make -f objs/Makefile
make[1]: 进入目录“/usr/local/src/nginx-1.16.1”
cd /usr/local/openssl
&& if [ -f Makefile ]; then make clean; fi
&& ./config --prefix=/usr/local/openssl/.openssl no-shared no-threads
&& make
&& make install_sw LIBDIR=lib
/bin/sh:行2: ./config: 没有那个文件或目录
make[1]: *** [/usr/local/openssl/.openssl/include/openssl/ssl.h] 错误 127
make[1]: 离开目录“/usr/local/src/nginx-1.16.1”
make: *** [build] 错误 2

怎么办呢?解决办法如下:

进入/usr/local/src/nginx-1.16.1/auto/lib/openssl中
#vim conf


39 CORE_INCS="$CORE_INCS O P E N S S L / . o p e n s s l / i n c l u d e " 40 C O R E D E P S = " OPENSSL/.openssl/include" 40 CORE_DEPS=" OPENSSL/.openssl/include"40COREDEPS="CORE_DEPS O P E N S S L / . o p e n s s l / i n c l u d e / o p e n s s l / s s l . h " 41 C O R E L I B S = " OPENSSL/.openssl/include/openssl/ssl.h" 41 CORE_LIBS=" OPENSSL/.openssl/include/openssl/ssl.h"41CORELIBS="CORE_LIBS O P E N S S L / . o p e n s s l / l i b / l i b s s l . a " 42 C O R E L I B S = " OPENSSL/.openssl/lib/libssl.a" 42 CORE_LIBS=" OPENSSL/.openssl/lib/libssl.a"42CORELIBS="CORE_LIBS O P E N S S L / . o p e n s s l / l i b / l i b c r y p t o . a " … 将 上 述 改 为 : . . . 39 C O R E I N C S = " OPENSSL/.openssl/lib/libcrypto.a" … 将上述改为: ... 39 CORE_INCS=" OPENSSL/.openssl/lib/libcrypto.a"...39COREINCS="CORE_INCS O P E N S S L / i n c l u d e " 40 C O R E D E P S = " OPENSSL/include" 40 CORE_DEPS=" OPENSSL/include"40COREDEPS="CORE_DEPS O P E N S S L / i n c l u d e / o p e n s s l / s s l . h " 41 C O R E L I B S = " OPENSSL/include/openssl/ssl.h" 41 CORE_LIBS=" OPENSSL/include/openssl/ssl.h"41CORELIBS="CORE_LIBS O P E N S S L / l i b / l i b s s l . a " 42 C O R E L I B S = " OPENSSL/lib/libssl.a" 42 CORE_LIBS=" OPENSSL/lib/libssl.a"42CORELIBS="CORE_LIBS $OPENSSL/lib/libcrypto.a"

也即去掉.openssl/就行。
改后:
#make clean
再依次执行./configure … ;make ;make install即重新编译安装即可。

  • 5
    点赞
  • 9
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值