Linux HOWTOs

About | Home | Search


HOWTO: nghttp2
Description: HTTP/2 C library
Click here for ChangeLog
NOTE: I use GNU tar >= 1.13.25 so it's -j for .tar.bz2 files,
it's safe to assume that make, gcc, binutils, fileutils/coreutils, gawk, sed, and grep are prerequisites for almost everything


# Nghttp2 1.35.1
# ==============
# Prerequisites:
# pkg-config
# CUnit >= 2.1 (for unit test programs)
#
# If building the application programs also:
# Python (if you want Python bindings)
# zlib >= 1.2.3
# OpenSSL >= 1.0.1 or LibreSSL >= 2.2.0
# libevent's libevent-openssl >= 2.0.8
# libev >= 4.11
# Jansson
# libxml2 >= 2.7.7
# Spdylay >= 1.3.2

# If you are going to generate HTML documentation (see below), install/update
# Sphinx:
su -c "pip install -U Sphinx"

# Get it
cd
test -f installed/nghttp2-1.35.1.tar.xz &&
 mv -f installed/nghttp2-1.35.1.tar.xz .
test ! -f nghttp2-1.35.1.tar.xz &&
 wget https://github.com/nghttp2/nghttp2/releases/download/v1.35.1/\
nghttp2-1.35.1.tar.xz

# Extract the source
mkdir -p -m 0700 ~/src
cd ~/src
find -maxdepth 1 -type d -name "nghttp2-*" -exec rm -r {} \;
tar xJvf ~/nghttp2-1.35.1.tar.xz
cd nghttp2-1.35.1
test $UID = 0 && chown -R root:root .

# If you will be configuring the library and application programs, read
# through ./README.rst for more about other requirements

# Configure the library only build - 64-bit
test $(uname -m) = 'x86_64' &&
./configure --enable-lib-only --libdir=/usr/local/lib64 \
--mandir=/usr/local/man --docdir=/usr/local/doc/nghttp2

# Configure the library only build - anything else
test $(uname -m) != 'x86_64' &&
./configure --enable-lib-only --mandir=/usr/local/man \
--docdir=/usr/local/doc/nghttp2

# Build it
make

# Become root to install it
su

# Install it
make install
ldconfig

# Become your non-root user again
exit

# Save the source for later
cd
mkdir -p -m 0700 installed
rm -f installed/nghttp2-*.tar.*
mv nghttp2-1.35.1.tar.xz installed/


# If you ever want to uninstall Nghttp2, this should do it:
cd
su
test -d src/nghttp2-* && ( cd src/nghttp2-* ; make uninstall )
test -d /usr/local/doc/nghttp2 && rm -r /usr/local/doc/nghttp2
test -d /usr/local/include/nghttp2 && rm -r /usr/local/include/nghttp2
( cd /usr/local/man/man1
  rm -f h2load.1 nghttp.1 nghttpd.1 nghttpx.1 )
test -d /usr/local/share/nghttp2 && rm -r /usr/local/share/nghttp2
rm -f /usr/local/lib64/libnghttp2.* /usr/local/lib64/pkgconfig/libnghttp2.pc
ldconfig
suexit
find ~/src -maxdepth 1 -type d -name "nghttp2-*" -exec rm -r {} \;
rm -f ~/installed/nghttp2-*.tar.*

Back to the list


Last updated: Tue, 07 Aug 2018 12:06:17 -0400
Jason Englander <jason at englanders dot us>