切换root用户
下载源文件:
https://www.openssl.org/source/old/1.1.1/index.html
./config shared --prefix=/usr/local/openssl --openssldir=/usr/local/openssl
make && make install
备份原来的openssl
mv /usr/bin/openssl /usr/bin/openssl.bak
创建软链接到系统位置
ln -s /usr/local/openssl/bin/openssl /usr/bin/openssl
将openssl 的lib 库添加到系统(‘/usr/local/openssl/lib64’ 单引号)
echo '/usr/local/openssl/lib64' > /etc/ld.so.conf.d/openssl.conf
加载lib库 (可加 -v 参数查看详细显示)
ldconfig
看看openssl版本
openssl version
报错:
openssl: error while loading shared libraries: libssl.so.1.1: cannot open shared object file: No such file or directory
修改:
vim /etc/ld.so.conf
添加:/usr/local/openssl/lib
执行生效
ldconfig
测试查看
openssl version