This was a little bit of a mission for a customer recently that required http2 support with curl but they weren’t fussed about it being separate from the already installed version of curl. This also helped because it turned out it needed a newer version of OpenSSL and the last thing I wanted to do was to replace the installed version of OpenSSL and break dependencies.
Firstly, install the dev tools you’re doing to need.
yum -y groupinstall "Development Tools" yum -y install libev libev-devel zlib zlib-devel openssl openssl-devel git
Next, we’re going to store a few things in /var/tmp and install the new version of openssl into /opt/openssl
mkdir /var/tmp cd /var/tmp wget https://www.openssl.org/source/openssl-1.0.2-latest.tar.gz tar -zxf openssl-1.0.2-latest.tar.gz cd openssl-1.0.2l mkdir /opt/openssl ./config --prefix=/opt/openssl make make test make install
Now on to nghttp2
git clone https://github.com/tatsuhiro-t/nghttp2.git cd nghttp2 autoreconf -i automake autoconf ./configure make make install echo '/usr/local/lib' > /etc/ld.so.conf.d/custom-libs.conf ldconfig ldconfig -p| grep libnghttp2
Then finally, we build curl with http2 and the newer openssl
cd /var/tmp git clone https://github.com/bagder/curl.git cd curl ./buildconf ./configure --with-ssl=/opt/openssl --with-nghttp2=/usr/local --disable-file --without-pic --disable-shared make
Finally, you should be able to run curl with
/var/tmp/curl/src/curl --version
This does not ‘install’ curl, it just builds it. My advice would be to have it install into /opt somewhere but you can change that on the ./configure line above.
Thanks bro you saved my life
Thanks bro, such a great help.
THanks!! It works perfect!