Enterprise-Onion-Toolkit/opt.d/build-nginx-on-debian.sh

43 wiersze
840 B
Bash
Czysty Zwykły widok Historia

2017-02-04 15:51:49 +00:00
#!/bin/sh -x
2017-02-04 16:28:16 +00:00
here=`dirname $0`
cd $here || exit 1
2017-02-04 17:12:16 +00:00
here=`pwd`
2017-02-04 15:51:49 +00:00
2017-02-04 16:43:07 +00:00
sudo aptitude install -y libpcre3-dev zlib1g-dev libssl-dev
2017-02-04 15:51:49 +00:00
url=http://nginx.org/download/nginx-1.10.3.tar.gz
file=`basename $url`
dir=`basename $file .tar.gz`
2017-02-04 16:28:16 +00:00
test -f $file || curl -o $file $url || exit 1
test -d $dir || tar zxf $file || exit 1
2017-02-04 15:51:49 +00:00
cd $dir || exit 1
MODS="
https://github.com/openresty/headers-more-nginx-module.git
https://github.com/yaoweibin/ngx_http_substitutions_filter_module.git
"
OPTS="
--with-http_sub_module
--with-http_ssl_module
"
MODADD=""
for modurl in $MODS ; do
moddir=`basename $modurl .git`
test -d $moddir || git clone $modurl
2017-02-04 16:28:16 +00:00
MODADD="$MODADD --add-module=$here/$dir/$moddir"
2017-02-04 15:51:49 +00:00
done
2017-02-04 16:28:16 +00:00
./configure --prefix=$here $OPTS $MODADD || exit 1
make || exit 1
make install || exit 1
2017-02-04 15:51:49 +00:00
2017-02-04 16:36:17 +00:00
cd $here || exit 1
ln -s sbin/nginx || exit 1
2017-02-04 16:28:16 +00:00
exit 0