Skip to content

Instantly share code, notes, and snippets.

@bipinu
Last active August 29, 2015 14:15
Show Gist options
  • Save bipinu/1fdbe460bf2191f5eeb6 to your computer and use it in GitHub Desktop.
Save bipinu/1fdbe460bf2191f5eeb6 to your computer and use it in GitHub Desktop.
Linux: Compile mod_spdy (HTTP2) for Apache 2.4
# APACHE must be configured with PHP5-FPM, and not be using ModPHP
# I've another gist that configures it
# TODO: Combine both scripts and make a backup of original SSL conf file
sudo apt-get -y install git g++ apache2 libapr1-dev libaprutil1-dev patch binutils make devscripts
# Build spdy
# ---------------------------------------------------------
git clone https://github.com/eousphoros/mod-spdy.git /tmp/mod-spdy
cd /tmp/mod-spdy/src
# Default Apache version on Ubuntu
git checkout apache-2.4.7
./build_modssl_with_npn.sh
chmod +x ./build/gyp_chromium
make BUILDTYPE=Release
cp mod_ssl.so /usr/lib/apache2/modules/mod_ssl_npn.so
cp out/Release/libmod_spdy.so /usr/lib/apache2/modules/libmod_spdy.so
echo "LoadModule ssl_module /usr/lib/apache2/modules/mod_ssl_npn.so" > /etc/apache2/mods-available/ssl.load
echo "LoadModule spdy_module /usr/lib/apache2/modules/libmod_spdy.so" > /etc/apache2/mods-available/spdy.load
echo "SpdyEnabled on" > /etc/apache2/mods-available/spdy.conf
# Apache changes
# ---------------------------------------------------------
# Note: worker, for php-fpm; event segfaults with spdy.
a2dismod php5 mpm_event mpm_prefork
a2enmod mpm_worker spdy socache_shmcb actions
a2endmod ssl
/etc/init.d/php5-fpm restart
/etc/init.d/apache2 restart
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment