Linux 安装OpenSSL及解决遇到的问题

下载openssl安装包

wget https://www.openssl.org/source/openssl-3.0.1.tar.gz

执行后如果拉不下来,出现证书过期
在这里插入图片描述
需要加上 --no-check-certificate 不做检查

wget https://www.openssl.org/source/openssl-3.0.1.tar.gz  --no-check-certificate

在这里插入图片描述

解压

tar -zxvf openssl-3.0.1.tar.gz

配置相应检查

./config --prefix=/opt/common/openssl-3.0.1

安装过程中会出现Can’t locate IPC/Cmd.pm in 错误

Can't locate IPC/Cmd.pm in @INC (@INC contains: /root/Downloads/openssl-3.0.1/util/perl /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 . /root/Downloads/openssl-3.0.1/external/perl/Text-Template-1.56/lib) at /root/Downloads/openssl-3.0.1/util/perl/OpenSSL/config.pm line 18.
BEGIN failed--compilation aborted at /root/Downloads/openssl-3.0.1/util/perl/OpenSSL/config.pm line 18.
Compilation failed in require at /root/Downloads/openssl-3.0.1/Configure line 23.
BEGIN failed--compilation aborted at /root/Downloads/openssl-3.0.1/Configure line 23.

错误解决方案为参考报错解决方案
Linux安装openssl出现Can‘t locate IPC/Cmd.pm in 找不到perl

解决完这个问题之后重新配置就可以了

./config --prefix=/opt/common/openssl-3.0.1/openssl

编译安装

make
make install

测试

去到配置的指定目录下

cd /opt/common/openssl-3.0.1/openssl
./openssl -version

如果出现下面的错误 不需要管
在这里插入图片描述

创建软链接

ln -s /opt/common/openssl-3.0.1/openssl /usr/bin/openssl

然后继续测试

./openssl -version

出现了这个错

error while loading shared libraries: libssl.so.1.1: cannot open shared object file: No such file or directory

使用ldd查看缺少那些库

ldd /opt/common/openssl-3.0.1/openssl

在这里插入图片描述
原因是动态路径找不到,加入动态库的路径

echo  /opt/common/openssl-3.0.1/openssl/lib64 >> /etc/ld.so.conf	
ldconfig /etc/ld.so.conf  #刷新动态路径

N次测试

./openssl -version

安装成功
在这里插入图片描述
装的挺麻烦的,浪费好几个小时,真是不容易。

  • 1
    点赞
  • 15
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

无奈的码农

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值