Skip to content

Instantly share code, notes, and snippets.

@deepak-kumar
Last active December 14, 2015 10:09
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save deepak-kumar/5069550 to your computer and use it in GitHub Desktop.
Save deepak-kumar/5069550 to your computer and use it in GitHub Desktop.
# Shell Script
# Installs specified nginx version with google SPDY patch
# Author: Deepak Kumar
# Twitter: @deepak_kumar
# March 2nd, 2013
# Nginx modules included here are as per my need. Feel free modify/add/remove. Cheers!
#!/bin/sh
NGINX_VERSION=1.3.13
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/spdy/patch.spdy.txt
patch -p1 < patch.spdy.txt
#patch -p0 < patch.spdy.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 && sudo make install
# Cleanup
cd $TMP_PATH
rm -r nginx-$NGINX_VERSION
rm nginx-$NGINX_VERSION.tar.gz
@deepak-kumar
Copy link
Author

In case there is a bug/issue with script. Please make changes or suggest I ll include them in the script. Thanks.

@pontusab
Copy link

pontusab commented Feb 5, 2014

Update SPDY:
wget http://nginx.org/patches/patch.spdy-v31.txt
patch -p1 < patch.spdy-v31.txt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment