部署 操作系統: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】錯誤 ...
部署
操作系統: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
本文版權歸作者所有,歡迎轉載,請務必添加原文鏈接。