Skip to content

Instantly share code, notes, and snippets.

@anthonycorbacho
Last active August 29, 2015 13:57
Show Gist options
  • Save anthonycorbacho/9499105 to your computer and use it in GitHub Desktop.
Save anthonycorbacho/9499105 to your computer and use it in GitHub Desktop.
Install nginx with spdy 3
# Shell Script
# Installs specified nginx version with google SPDY patch
# March 12, 2013
#!/bin/sh
NGINX_VERSION=1.5.9
TMP_PATH=/tmp
# Fetch and extract nginx source
cd $TMP_PATH
wget http://nginx.org/download/nginx-$NGINX_VERSION.tar.gz
tar xvfz nginx-$NGINX_VERSION.tar.gz
cd nginx-$NGINX_VERSION
# Fetch the SPDY patch and apply it
wget http://nginx.org/patches/patch.spdy-v31.txt
patch -p1 < patch.spdy-v31.txt
# Fetch openssl
wget http://www.openssl.org/source/openssl-1.0.1e.tar.gz
tar xvzf openssl-1.0.1e.tar.gz
# Configure nginx
./configure \
--sbin-path=/usr/local/sbin/nginx \
--prefix=/etc/nginx \
--conf-path=/etc/nginx/nginx.conf \
--error-log-path=/var/log/nginx/error.log \
--http-client-body-temp-path=/var/lib/nginx/body \
--http-fastcgi-temp-path=/var/lib/nginx/fastcgi \
--http-log-path=/var/log/nginx/access.log \
--http-proxy-temp-path=/var/lib/nginx/proxy \
--http-scgi-temp-path=/var/lib/nginx/scgi \
--http-uwsgi-temp-path=/var/lib/nginx/uwsgi \
--lock-path=/var/lock/nginx.lock \
--pid-path=/var/run/nginx.pid \
--with-debug \
--with-http_addition_module \
--with-http_dav_module \
--with-http_gzip_static_module \
--with-http_realip_module \
--with-http_stub_status_module \
--with-http_ssl_module \
--with-http_sub_module \
--with-http_xslt_module \
--with-http_spdy_module \
--with-ipv6 \
--with-sha1=/usr/include/openssl \
--with-md5=/usr/include/openssl \
--with-mail \
--with-mail_ssl_module \
--with-openssl='openssl-1.0.1e' # wget http://www.openssl.org/source/openssl-1.0.1e.tar.gz
# Build and install nginx
make && make install
# Cleanup
cd $TMP_PATH
rm -r nginx-$NGINX_VERSION
rm nginx-$NGINX_VERSION.tar.gz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment