apacheHttpd: add support for HTTP/2

In NixOS you can enable HTTP/2 like this:

    services.httpd.extraModules = [ "http2" ];
    services.httpd.extraConfig = ''
      Protocols h2 http/1.1
    '';
This commit is contained in:
zimbatm 2016-03-11 23:03:14 +00:00
parent 2f398c365f
commit eac89788da
2 changed files with 6 additions and 1 deletions

View File

@ -1,6 +1,7 @@
{ stdenv, fetchurl, perl, zlib, apr, aprutil, pcre, libiconv { stdenv, fetchurl, perl, zlib, apr, aprutil, pcre, libiconv
, proxySupport ? true , proxySupport ? true
, sslSupport ? true, openssl , sslSupport ? true, openssl
, http2Support ? true, libnghttp2
, ldapSupport ? true, openldap , ldapSupport ? true, openldap
, libxml2Support ? true, libxml2 , libxml2Support ? true, libxml2
, luaSupport ? false, lua5 , luaSupport ? false, lua5
@ -12,6 +13,7 @@ in
assert sslSupport -> aprutil.sslSupport && openssl != null; assert sslSupport -> aprutil.sslSupport && openssl != null;
assert ldapSupport -> aprutil.ldapSupport && openldap != null; assert ldapSupport -> aprutil.ldapSupport && openldap != null;
assert http2Support -> libnghttp2 != null;
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
version = "2.4.18"; version = "2.4.18";
@ -25,6 +27,7 @@ stdenv.mkDerivation rec {
buildInputs = [perl] ++ buildInputs = [perl] ++
optional ldapSupport openldap ++ # there is no --with-ldap flag optional ldapSupport openldap ++ # there is no --with-ldap flag
optional libxml2Support libxml2 ++ optional libxml2Support libxml2 ++
optional http2Support libnghttp2 ++
optional stdenv.isDarwin libiconv; optional stdenv.isDarwin libiconv;
# Required for pthread_cancel. # Required for pthread_cancel.
@ -44,6 +47,7 @@ stdenv.mkDerivation rec {
--enable-cgi --enable-cgi
${optionalString proxySupport "--enable-proxy"} ${optionalString proxySupport "--enable-proxy"}
${optionalString sslSupport "--enable-ssl --with-ssl=${openssl}"} ${optionalString sslSupport "--enable-ssl --with-ssl=${openssl}"}
${optionalString http2Support "--enable-http2 --with-nghttp2=${libnghttp2}"}
${optionalString luaSupport "--enable-lua --with-lua=${lua5}"} ${optionalString luaSupport "--enable-lua --with-lua=${lua5}"}
${optionalString libxml2Support "--with-libxml2=${libxml2}/include/libxml2"} ${optionalString libxml2Support "--with-libxml2=${libxml2}/include/libxml2"}
''; '';

View File

@ -9461,7 +9461,8 @@ let
}; };
apacheHttpd_2_4 = lowPrio (callPackage ../servers/http/apache-httpd/2.4.nix { apacheHttpd_2_4 = lowPrio (callPackage ../servers/http/apache-httpd/2.4.nix {
sslSupport = true; # 1.0.2+ for ALPN support
openssl = openssl_1_0_2;
}); });
apacheHttpdPackagesFor = apacheHttpd: self: let callPackage = newScope self; in { apacheHttpdPackagesFor = apacheHttpd: self: let callPackage = newScope self; in {