#!/bin/sh
LANG=
export LANG
LANGUAGE=
export LANGUAGE
cd `dirname $0`
if [ -x /bin/pwd ]; then
hhdir=`/bin/pwd`
else
hhdir=`pwd`;
fi
srcdir=$hhdir
####################
cd $srcdir
tar zxvf nginx-1.10.2.tar.gz
tar zxvf openssl-1.0.1g.tar.gz
tar zxvf zlib-1.2.8.tar.gz
tar zxvf pcre-8.39.tar.gz
tar zxvf nginx-upstream-jvm-route-0.1.tar.gz
####################
NGINX_INSTALL=$srcdir/nginx-1.10.2
OPENSSL_INSTALL=$srcdir/openssl-1.0.1g
ZLIB_INSTALL=$srcdir/zlib-1.2.8
PCRE_INSTALL=$srcdir/pcre-8.39
JVM_ROUTE=$srcdir/nginx_upstream_jvm_route
####################
cd $OPENSSL_INSTALL
./config
echo "+--------------------------------------+"
echo "| start install openssl |"
echo "+----------------按回车键--------------+"
read
make && make install
echo "======================================="
echo " openssl install is complete "
echo "======================================="
echo "+----------------按回车键--------------+"
read
cd $ZLIB_INSTALL
./configure
echo "+--------------------------------------+"
echo "| start install zlib |"
echo "+--------------------------------------+"
echo "+----------------按回车键--------------+"
read
make && make install
echo "========================================"
echo " zlib install is complete "
echo "========================================"
echo "+----------------按回车键--------------+"
read
cd $PCRE_INSTALL
./configure
echo "+--------------------------------------+"
echo "| start install pcre |"
echo "+--------------------------------------+"
echo "+----------------按回车键--------------+"
read
make && make install
echo "========================================"
echo " pcre install is complete "
echo "========================================"
echo "+----------------按回车键--------------+"
read
###################
cd $NGINX_INSTALL
./configure --prefix=/usr/local/nginx --with-pcre=$PCRE_INSTALL \
--with-zlib=$ZLIB_INSTALL \
--with-http_ssl_module \
--with-openssl=$OPENSSL_INSTALL \
--with-http_stub_status_module \
--with-http_sub_module
--add-module=$JVM_ROUTE
echo "+--------------------------------------+"
echo "| start install nginx |"
echo "+--------------------------------------+"
echo "+----------------按回车键--------------+"
read
make && make install
echo "========================================"
echo " nginx install is complete "
echo "========================================"