2016-02-15 106 views
0

我在CentOS 7.试图RPM构建Apache 2.4.18与mod_http2然而,建筑,当我得到的失败:阿帕奇mod_http2前提失败

checking whether to enable mod_http2... checking dependencies 
checking for nghttp2... checking for user-provided nghttp2 base directory... /usr/lib64 
checking for pkg-config along :/usr/lib64/pkgconfig:/usr/share/pkgconfig... adding "-I/usr/lib64/include" to CPPFLAGS 
    setting MOD_CFLAGS to "-I/usr/lib64/include" 
    setting ab_CFLAGS to "-I/usr/lib64/include" 
    adding "-L/usr/lib64/lib" to LDFLAGS 
    setting MOD_LDFLAGS to "-L/usr/lib64/lib" 
checking for nghttp2 version >= 1.2.1... FAILED 
configure: WARNING: nghttp2 version is too old 
no 
checking whether to enable mod_http2... configure: error: mod_http2 has been requested but can not be built due to prerequisite failures 
error: Bad exit status from /var/tmp/rpm-tmp.aOryWX (%build) 


RPM build errors: 
    Bad exit status from /var/tmp/rpm-tmp.aOryWX (%build) 

但是,我nghttp2和libnghttp2版本都是1.7 1.1:

Installed Packages 
Name  : nghttp2 
Arch  : x86_64 
Version  : 1.7.1 
Release  : 1.el7.centos 
Size  : 1.3 M 
Repo  : installed 
From repo : local 
Summary  : Experimental HTTP/2 client, server and proxy 
URL   : https://nghttp2.org/ 
Licence  : MIT 
Description : This package contains the HTTP/2 client, server and proxy programs. 

Installed Packages 
Name  : libnghttp2 
Arch  : x86_64 
Version  : 1.7.1 
Release  : 1.el7.centos 
Size  : 139 k 
Repo  : installed 
From repo : local 
Summary  : A library implementing the HTTP/2 protocol 
URL   : https://nghttp2.org/ 
Licence  : MIT 
Description : libnghttp2 is a library implementing the Hypertext Transfer Protocol 
      : version 2 (HTTP/2) protocol in C. 

从我httpd.spec,我已经添加了以下配置选项:

%configure \ 
    --enable-layout=RPM \ 
    --libdir=%{_libdir} \ 
    --sysconfdir=%{_sysconfdir}/httpd/conf \ 
    --includedir=%{_includedir}/httpd \ 
    --libexecdir=%{_libdir}/httpd/modules \ 
    --datadir=%{contentdir} \ 
    --with-installbuilddir=%{_libdir}/httpd/build \ 
    --enable-mpms-shared=all \ 
    --with-apr=%{_prefix} --with-apr-util=%{_prefix} \ 
    --enable-suexec --with-suexec \ 
    --with-suexec-caller=%{suexec_caller} \ 
    --with-suexec-docroot=%{contentdir} \ 
    --with-suexec-logfile=%{_localstatedir}/log/httpd/suexec.log \ 
    --with-suexec-bin=%{_sbindir}/suexec \ 
    --with-suexec-uidmin=500 --with-suexec-gidmin=100 \ 
    --enable-pie \ 
    --with-pcre \ 
    --enable-mods-shared=all \ 
    --enable-ssl --with-ssl --enable-socache-dc --enable-bucketeer \ 
    --enable-case-filter --enable-case-filter-in \ 
    --enable-http --enable-http2 --with-nghttp2=%{_libdir} \ 
    --disable-imagemap 

而我libnghttp2被安装在/ usr/lib64下:

sudo find/-iname "*nghttp2*" 
[sudo] password for administrator: 
/home/administrator/rpmbuild/RPMS/x86_64/nghttp2-1.7.1-1.el7.centos.x86_64.rpm 
/home/administrator/rpmbuild/RPMS/x86_64/libnghttp2-1.7.1-1.el7.centos.x86_64.rpm 
/home/administrator/rpmbuild/RPMS/x86_64/libnghttp2-devel-1.7.1-1.el7.centos.x86_64.rpm 
/home/administrator/rpmbuild/RPMS/x86_64/nghttp2-debuginfo-1.7.1-1.el7.centos.x86_64.rpm 
/home/administrator/rpmbuild/SRPMS/nghttp2-1.7.1-1.el7.src.rpm 
/var/lib/yum/yumdb/l/56527c0ccd96b61605f75b8cb07ebee7b2901c17-libnghttp2-1.7.1-1.el7.centos-x86_64 
/var/lib/yum/yumdb/n/4630c64bc127ec7ed9b842ee49923baa493c05b5-nghttp2-1.7.1-1.el7.centos-x86_64 
/var/repos/centos/7/nghttp2-1.7.1-1.el7.centos.x86_64.rpm 
/var/repos/centos/7/nghttp2-debuginfo-1.7.1-1.el7.centos.x86_64.rpm 
/var/repos/centos/7/libnghttp2-1.7.1-1.el7.centos.x86_64.rpm 
/var/repos/centos/7/libnghttp2-devel-1.7.1-1.el7.centos.x86_64.rpm 
/usr/lib64/libnghttp2.so.14 
/usr/lib64/libnghttp2.so.14.4.1 
/usr/share/licenses/libnghttp2-1.7.1 
/usr/share/nghttp2 

唯一的文件中/usr/share/nghttp2fetch-ocsp-response

希望我已经提供了足够的信息,但如果需要更多信息,请询问。什么是问题,我该如何解决它?

+0

无法rpmbuild的帮助,因为不要自己使用它,但可以指向我的博客页面,其中显示了手动安装它的步骤,如果有帮助的话:https://www.tunetheweb.com/performance/http2/ –

回答

1

对我来说,配置脚本似乎只是一个坏消息。

我检查了EPEL的基本配置,它使用与您建议的略有不同的版本。

您应该安装libnghttp2-devel的包,以及用于构建(把它放在你的BuildRequires为好),而你需要运行时间libnghttp2(把它放在你的需要)。

建议(免责声明:我是作者):如果你想要一个简单而有效的和可重复的方式来建立,并从规范重建的RPM,看看这个项目:

https://github.com/alanfranz/docker-rpm-builder/

+0

几天前我偶然发现缺少libnghttp2-devel,忘记在这里更新,但感谢您回复我。我会看看链接的rpm生成器。 –