mod_h2を使って、ApacheをHTTP/2対応する

mod_h2はapache2.5 devに組み込まれました。
以下の手順では正しくビルドできなくなりました。ご注意下さい。
(09/04追記)


mod_h2はapache2.4.17に組み込まれました
そちらでのビルド手順を、後日記事を書こうと思います
(10/14追記)
http://www.apache.org/dist/httpd/CHANGES_2.4.17


Apache 2.4.17のmod_http2試す」ざっくりですが、動きました
http://d.hatena.ne.jp/ASnoKaze/20151016/1445011720 (2015/10/17追記)


nginxはこちら「nginx1.9.3 HTTP/2 パッチを試す


先日、mod_h2が公開されたので早速試してみました。

https://icing.github.io/mod_h2/

ビルド

今回はUbuntu 14.04でビルドします。また、--enable-sandboxを付与しています。


必要な物を入れる

sudo apt-get install git gcc g++ libpcre3-dev libcunit1-dev libev-dev libjansson-dev libjemalloc-dev cython make binutils autoconf automake autotools-dev libtool pkg-config zlib1g-dev libssl-dev libxml2-dev libevent-dev python3.4-dev libevent-openssl-2.0-5

sudo apt-get install curl git


ビルド

git clone https://github.com/icing/mod_h2
cd ./mod_h2

autoreconf -i
automake
autoconf
./configure --enable-sandbox
make

cp ./mod_h2/.libs/mod_h2* ./gen/install/modules/


# /etc/hostsに 「127.0.0.1       test.example.org        test」を追記する
# sudo bash -c "echo '127.0.0.1       test.example.org        test' >> /etc/hosts"
make test

接続する

make testをするとApacheが起動し、12346番ポートで接続できるようになります。


Firefox Nightlyでアクセスすると http2で接続できていることが確認できます