Loading

Centos安装部署openssl

部署

操作系统:CentOS:7.4,perl版本:v5.16.3,opensearch版本:3.0.8

 

1.下载地址:https://www.openssl.org/source/

 

2.安装cmd.pm模块,不然编译的时候会引发【Can‘t locate IPC/Cmd.pm in @INC】错误。

[root@centos7 ~]# yum install -y perl-CPAN

# 进入CPAN的shell模式,首次进入需要配置shell,按照提示一直回车,要等久一点
[root@centos7 ~]# perl -MCPAN -e shell

# 在shell中安装缺少的模块,要等久一点
cpan[1]> install IPC/Cmd.pm

 

3.编译部署

./config --prefix=/usr/local/openssl
make
make install

 

4.这一步一定要有!!LD_LIBRARY_PATH环境变量主要用于指定查找共享库(动态链接库)时除了默认路径之外的其他路径。当执行函数动态链接.so时,如果此文件不在缺省目录下‘/lib' and ‘/usr/lib',那么就需要指定环境变量LD_LIBRARY_PATH

echo 'export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/local/openssl/lib64' >>  /etc/profile
source /etc/profile

 

不然报错:

[root@iz2ze6ktmxsmwai5zbqy4wz conf]# /usr/local/openssl/bin/openssl version
/usr/local/openssl/bin/openssl: error while loading shared libraries: libssl.so.3: cannot open shared object file: No such file or directory

 

5.替换

mv /usr/bin/openssl /usr/bin/openssl.bak
mv /usr/include/openssl /usr/include/openssl.bak

ln -s /usr/local/openssl/bin/openssl   /usr/bin/openssl
ln -s /usr/local/openssl/include/openssl   /usr/include/openssl

报错

1.若Python运行报错

ImportError: urllib3 v2.0 only supports OpenSSL 1.1.1+, currently the 'ssl' module is compiled with 'OpenSSL 1.0.2k-fips 26 Jan 2017'. See: ​​

 

降低版本

pip uninstall urllib3
pip install urllib3==1.26.6

posted @   日行一善g  阅读(929)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· 阿里巴巴 QwQ-32B真的超越了 DeepSeek R-1吗?
· 【译】Visual Studio 中新的强大生产力特性
· 10年+ .NET Coder 心语 ── 封装的思维:从隐藏、稳定开始理解其本质意义
· 【设计模式】告别冗长if-else语句:使用策略模式优化代码结构
点击右上角即可分享
微信分享提示