# 1.安装OpenSSL
yum install bzip2-devel
yum install libffi-devel -y
yum install -y zlib zlib-dev openssl-devel sqlite-devel bzip2-devel libffi libffi-devel gcc gcc-c++
# cd到一个下载目录,这里为/opt,openssl压缩包会被下载到/opt目录下,可任意设置已存在的文件夹
cd /opt
wget
tar -zxvf openssl-1.1.1.tar.gz
cd openssl-1.1.1
# 编译安装,安装路径为/usr/local/openssl
./config --prefix=/usr/local/openssl shared zlib
make && make install
# 添加环境变量
echo "export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/openssl/lib" >> /etc/profile
# 刷新环境变量
source /etc/profile
# 添加软连接
ln -s /usr/local/openssl/lib/libssl.so.1.1 /usr/lib64/libssl.so.1.1
ln -s /usr/local/openssl/lib/libcrypto.so.1.1 /usr/lib64/libcrypto.so.1.1