Apacheを入れ直さずにhttp/2対応する

SSLはすでに対応済みが条件

 
# httpd -v
Server version: Apache/2.4.39

yum -y install jansson-devel
yum -y install libev-devel
yum -y install c-ares-devel

yum -y install centos-release-scl
yum -y install devtoolset-7
scl enable devtoolset-7 bash

cd /usr/local/src/
wget https://github.com/nghttp2/nghttp2/releases/download/v1.37.0/nghttp2-1.37.0.tar.gz

tar xvzf nghttp2-1.37.0.tar.gz
cd nghttp2-1.37.0/
env OPENSSL_CFLAGS="-I/usr/local/openssl-1.1.1b/include" OPENSSL_LIBS="-L/usr/local/openssl-1.1.1b/lib -lssl -lcrypto" ./configure -enable-app
make
make install

yum -y install cmake
cd /usr/local/src/
wget https://github.com/google/brotli/archive/v1.0.7.tar.gz

tar xvzf v1.0.7.tar.gz
cd brotli-1.0.7/
mkdir out && cd out
../configure-cmake
make
make test
make install


echo /usr/local/lib > /etc/ld.so.conf.d/usr-local-lib.conf
ldconfig

vi /etc/httpd/conf.modules.d/00-base.conf
こいつらを読み込む
  LoadModule mpm_prefork_module modules/mod_mpm_prefork.so
  LoadModule socache_shmcb_module modules/mod_socache_shmcb.so
  LoadModule brotli_module modules/mod_brotli.so
  LoadModule ssl_module modules/mod_ssl.so
  LoadModule http2_module modules/mod_http2.so

vi /etc/httpd/conf.d/ssl.conf
これを書き足す
   
      Protocols h2 http/1.1


vi /etc/httpd/conf.modules.d/00-mpm.conf
これは読まない
   #LoadModule mpm_prefork_module modules/mod_mpm_prefork.so
これを読む
   LoadModule mpm_event_module modules/mod_mpm_event.so



 

Categories:

Tags: