在Centos7下安装nghttp2

若是是Ubuntu18.04, 系统自己已经带了nghttp2了, 直接apt安装就能够. python

下载源代码 https://github.com/nghttp2/nghttp2c++

若是是在Ubuntu下编译nghttp2, 按官网上的说明安装这一堆依赖就能够了git

sudo apt install g++ make binutils autoconf automake autotools-dev libtool pkg-config \
  zlib1g-dev libcunit1-dev libssl-dev libxml2-dev libev-dev libevent-dev libjansson-dev \
  libc-ares-dev libjemalloc-dev libsystemd-dev \
  cython python3-dev python-setuptools

 

若是是Centos7, 须要本身摸索. 首先是各类依赖github

yum install libev-devel libevent-devel c-ares-devel jemalloc-devel jansson-devel python-devel zlib-devel

而后centos

./configure
make
make install

若是在make的过程当中遇到这样的错误bash

error: #error This file requires compiler and library support for the ISO C++ 2011 standard. This support is currently experimental, and must be enabled with the -std=c++11 or -std=gnu++11 compiler options.ui

说明系统的编译器版本过旧, 须要安装Red Hat Developer Toolset https://www.softwarecollections.org/en/scls/rhscl/devtoolset-7/c++11

sudo yum install centos-release-scl
# 这行不运行貌似也能够
sudo yum-config-manager --enable rhel-server-rhscl-7-rpms
# 安装
sudo yum install devtoolset-7
# 检查已安装的列表
sudo yum list devtoolset-7\*
# 这一步才会启用新安装的编译器, 以后运行./configure能看到 C++ compilern 增长了-std=c++14参数
scl enable devtoolset-7 bash

.而后再./configure 和 make 就能够经过了server

最后记得运行ldconfig更新动态连接库xml

sudo ldconfig

.

相关文章
相关标签/搜索