安装环境
[root@192 ~]# uname -a
Linux 192.168.11.121 3.10.0-1160.62.1.el7.x86_64 #1 SMP Tue Apr 5 16:57:59 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
安装包下载
# 下载地址 --- 下载版本: 3.0.1 (openssl-3.0.1.tar.gz)
https://www.openssl.org/source/old/3.0/
解压
tar -zxvf openssl-3.0.1.tar.gz
cd openssl-3.0.1
配置
# --prefix指定安装路径
./config --prefix=/usr/local/openssl
这里有个问题,会报如下错误:
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.
解决方法:
1)安装perl-CPAN
yum install -y perl-CPAN
2)进入CPAN的shell模式
perl -MCPAN -e shell
3)安装缺少的模块
cpan[1]> install IPC/Cmd.pm
编译安装
make
make install
# 查看安装结果
[root@192 /usr/local/openssl]# ls
bin include lib64 share ssl