m1ch4ls
2/20/2015 - 10:29 AM

Building Nginx for Lindat

Building Nginx for Lindat

#!/bin/bash

NGINX_VERSION=1.6.2

DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
pushd $DIR

function download_archive {
  local dirname=$1
  local url=$2
  local archive="$dirname.tar.gz"

  if [ ! -d "$dirname" ]; then
    wget -O "$dirname.tar.gz" "$url"
    tar -xzvf "$archive"
    mv `tar -ztf "$archive" | head -n 1` "$dirname"
    rm "$archive"
  fi
}

download_archive nginx_src http://nginx.org/download/nginx-$NGINX_VERSION.tar.gz

#Headers More module
download_archive nginx-headers-more-module https://github.com/openresty/headers-more-nginx-module/archive/v0.25.tar.gz
download_archive nginx-ajp-module https://github.com/yaoweibin/nginx_ajp_module/archive/12c852ce7b90ace587b34da7a2958d59e65f64b2.tar.gz
download_archive nginx-shib-module  https://github.com/nginx-shib/nginx-http-shibboleth/archive/v20150121.tar.gz

cd nginx_src
./configure --prefix=/opt/nginx \
   --add-module="$DIR/nginx-headers-more-module" \
   --add-module="$DIR/nginx-ajp-module" \
   --add-module="$DIR/nginx-shib-module" \
   --with-http_ssl_module
make

popd