Skip to content

Instantly share code, notes, and snippets.

@levicook
Created September 19, 2011 16:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save levicook/1226880 to your computer and use it in GitHub Desktop.
Save levicook/1226880 to your computer and use it in GitHub Desktop.
#!/bin/bash --login
set -e # Exit if anything fails
pushd `dirname $0`/..
STACK=`pwd`
if ! [ -d "${STACK}/nginx/nginx-1.0.6" ]; then
pushd nginx && tar xzf 'nginx-1.0.6.tar.gz' && popd
fi
if ! [ -d "${STACK}/nginx/nginx_upload_module-2.2.0" ]; then
pushd nginx && tar xzf "nginx_upload_module-2.2.0.tar.gz" && popd
fi
if ! [ -d "${STACK}/nginx/masterzen-nginx-upload-progress-module-8b55a34" ]; then
pushd nginx && tar xzf "masterzen-nginx-upload-progress-module-v0.8.2-0-g8b55a34.tar.gz" && popd
fi
test -f /opt/nginx/logs/nginx.pid && sudo /opt/nginx/sbin/nginx -s stop
test -f /opt/nginx && sudo rm -r /opt/nginx
sudo mkdir -p /opt/nginx
sudo chown -R ${USER} /opt/nginx
./bin/passenger-install-nginx-module --auto \
--prefix=/opt/nginx \
--nginx-source-dir=${STACK}/nginx/nginx-1.0.6 \
--extra-configure-flags="--with-http_ssl_module --with-http_gzip_static_module --add-module=${STACK}/nginx/nginx_upload_module-2.2.0 --add-module=${STACK}/nginx/masterzen-nginx-upload-progress-module-8b55a34"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment