Edited at

How to install nghttp2, h2load on OracleLinux 6.7

More than 3 years have passed since last update.


How to install nghttp2, h2load on OracleLinux 6.7

http://qiita.com/tatsuhiro-t/items/6cbe5b095e24d7feb381

- :white_check_mark: install HTTP/2 server nghttp2

- :white_check_mark: install HTTP/2 benchmark tool h2load


Background


https://gist.github.com/sonots/2bdf6cd26c23ef44db71

centos6 だと epel の libev が古くてめんどくさくなったので centos7 でビルドした


So let me try...



Prerequisite


  • OracleLinux 6.7 installed (Red Hat Enterprise Linux Server 6.7)


/etc/issue

Oracle Linux Server release 6.7



Building from git

Building from git is easy, but please be sure that at least autoconf 2.68 is used:

$ autoreconf -i

$ automake

$ autoconf

$ ./configure

$ make

To compile the source code, gcc >= 4.8.3 or clang >= 3.4 is required.



Before compile ... required libraries

yum groupinstall "Development tools"

cd
git clone https://github.com/tatsuhiro-t/spdylay.git
git clone https://github.com/tatsuhiro-t/nghttp2.git

more spdylay/README.rst
more nghttp2/README.rst

:exclamation: gcc -v

gcc version 4.4.7 20120313 (Red Hat 4.4.7-16) (GCC)

We need to install newer gcc as well as Python 2.7 -

Installing Software Collection Library Utility from Oracle Public Yum

http://docs.oracle.com/cd/E37670_01/E59096/html/section_e3v_nbl_cr.html

# wget -O /etc/yum.repos.d/public-yum-ol6.repo http://public-yum.oracle.com/public-yum-ol6.repo


/etc/yum.repos.d/public-yum-ol6.repo

[ol6_software_collections]

name=Software Collection Library release 1.2 packages for Oracle Linux 6 (x86_64)
baseurl=http://public-yum.oracle.com/repo/OracleLinux/OL6/SoftwareCollections12/x86_64/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
gpgcheck=1
enabled=1

yum install scl-utils

yum install devtoolset-3 python27

scl enable devtoolset-3 python27 bash

wget ftp://ftp.gnu.org/pub/gnu/autoconf/autoconf-2.64.tar.gz
tar zxvf autoconf-2.64.tar.gz
cd autoconf-2.64
./configure
make
make install
autoconf --version

cd

wget ftp://xmlsoft.org/libxml2/libxml2-2.7.7-1.x86_64.rpm
wget ftp://xmlsoft.org/libxml2/libxml2-devel-2.7.7-1.x86_64.rpm
wget ftp://xmlsoft.org/libxml2/libxml2-python-2.7.7-1.x86_64.rpm
yum -Uvh libxml2-*

wget ftp://ftp.pbone.net/mirror/ftp5.gwdg.de/pub/opensuse/repositories/home:/rudi_m/RedHat_RHEL-6/x86_64/libev4-4.15-7.1.x86_64.rpm
wget ftp://ftp.pbone.net/mirror/ftp5.gwdg.de/pub/opensuse/repositories/home:/rudi_m/RedHat_RHEL-6/x86_64/libev-devel-4.15-7.1.x86_64.rpm
yum -Uvh libev*


Now make install

cd

cd spdylay

autoreconf -i
automake
autoconf
./configure
make
make install

cd ../nghttp2

export PKG_CONFIG_PATH=/lib/pkgconfig:/usr/lib/pkgconfig:/usr/lib64/pkgconfig:/usr/local/lib/pkgconfig
autoreconf -i
automake
autoconf
./configure --with-spdylay
make
make install

Done :smiley: :tada:


Requirements

The following package is required to build the libnghttp2 library:


  • pkg-config >= 0.20

To build and run the unit test programs, the following package is required:


  • cunit >= 2.1

To build the documentation, you need to install:

To build and run the application programs (nghttp, nghttpd,nghttpx and h2load) in the src directory, the following packages are required:


  • OpenSSL >= 1.0.1

  • libev >= 4.15

  • zlib >= 1.2.3

ALPN support requires OpenSSL >= 1.0.2 (released 22 January 2015).

LibreSSL >= 2.2.0 can be used instead of OpenSSL, but OpenSSL has more features than LibreSSL at the time of this writing.

To enable the SPDY protocol in the application program nghttpx and h2load, the following package is required:


  • spdylay >= 1.3.2

To enable -a option (getting linked assets from the downloaded resource) in nghttp, the following package is required:


  • libxml2 >= 2.7.7

The HPACK tools require the following package:


  • jansson >= 2.5

To build sources under the examples directory, libevent is required:


  • libevent-openssl >= 2.0.8

To mitigate heap fragmentation in long running server programs (nghttpd and nghttpx), jemalloc is recommended:


  • jemalloc

libnghttp2_asio C++ library requires the following packages:


  • libboost-dev >= 1.54.0

  • libboost-thread-dev >= 1.54.0

The Python bindings require the following packages:


  • cython >= 0.19

  • python >= 2.7

  • python-setuptools