1.下载openssl1.1.1c
wget https://www.openssl.org/source/openssl-1.1.1c.tar.gz
最新版本可以在这个网站下载:
https://www.openssl.org/source/
2.更新zlib
yum install -y zlib
3.编译openssl
tar zxf openssl-1.1.0c.tar.gz
cd openssl-1.1.0c
【动态库】
32位编译:./config shared zlib --prefix=/usr/local/
64位编译:./config CC="gcc -m64" CXX="g++ -m64" shared zlib --prefix=/usr/local/
【静态库】
32位编译:./config static zlib --prefix=/usr/local/
64位编译:./config CC="gcc -m64" CXX="g++ -m64" static zlib --prefix=/usr/local/
make
make install
ln -s /usr/local/bin/openssl /usr/bin/openssl
ln -s /usr/local/include/openssl /usr/include/openssl
echo “/usr/local/lib64” >> /etc/ld.so.conf
ldconfig -v