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即重新编译安装即可。

GitHub 加速计划 / ope / openssl
25.13 K
9.99 K
下载
传输层安全性/安全套接层及其加密库
最近提交(Master分支:1 个月前 )
fd39d1c8 Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Shane Lontis <shane.lontis@oracle.com> (Merged from https://github.com/openssl/openssl/pull/25095) 3 个月前
ae87c488 Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Shane Lontis <shane.lontis@oracle.com> (Merged from https://github.com/openssl/openssl/pull/25095) 3 个月前
Logo

旨在为数千万中国开发者提供一个无缝且高效的云端环境,以支持学习、使用和贡献开源项目。

更多推荐