Last active
April 19, 2017 21:41
-
-
Save vidiecan/a342cd1ae74e4944e970 to your computer and use it in GitHub Desktop.
used kosarko/nginx_build.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
NGINX_VERSION=1.11.5 | |
HEADERS_MORE_VERSION=0.31 | |
OPENSSL=1.1.0e | |
AJP_VERSION=bf6cd93f2098b59260de8d494f0f4b1f11a84627 | |
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" | |
#sha1sum "$archive" | |
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/v$HEADERS_MORE_VERSION.tar.gz | |
download_archive nginx-ajp-module https://github.com/yaoweibin/nginx_ajp_module/archive/$AJP_VERSION.tar.gz | |
download_archive nginx-shib-module https://github.com/nginx-shib/nginx-http-shibboleth/archive/v2.0.0.tar.gz | |
download_archive openssl-$OPENSSL http://www.openssl.org/source/openssl-$OPENSSL.tar.gz | |
ln -s openssl-$OPENSSL openssl | |
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 \ | |
--with-http_stub_status_module \ | |
--with-openssl="$DIR/openssl" \ | |
--with-debug \ | |
--with-threads | |
make -j2 | |
popd |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment