Skip to content
This repository was archived by the owner on Oct 18, 2018. It is now read-only.

Using Nginx

Michal Sedlák edited this page Feb 26, 2015 · 1 revision

Building Nginx

Nginx doesn't support loading modules the way the Apache does - it doesn't support dynamic loading at all. So it's necessary to compile all modules to the core.

We have two crucial modules:

The good documentation is on Shibboleth module (including installation)

See this gist for compilation script.

#!/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

Installing Nginx

sudo make install

The nginx is installed in /opt/nginx. On Lindat server the nginx executable is symlinked to /usr/sbin/nginx and should be available globally in the $PATH.

The init script from Ubuntu distribution is slightly modified to take Nginx from /opt/nginx. See the gist.

You can use the init script as expected to start|stop|restart the Nginx.

/etc/init.d/nginx start|stop|restart

Clone this wiki locally