#######################install nginx#########################
#install nginx
echo “gcc openssl make”
yum -y install gcc gcc-c++ automake autoconf libtool make openssl openssl-devel

unzip files
echo “Unzip…”
tar -zxvf pcre-8.37.tar.gz
tar -zxvf zlib-1.2.8.tar.gz
tar -zxvf nginx-1.9.7.tar.gz
#tar -zxvf varnish-4.0.3.tar.gz
#tar -Jxvf php-5.6.15.tar.xz

echo “done”

install zlib
echo “install zlib”
echo “||”
echo “||”
cd zlib-1.2.8
./configure
make && make install
cd ..

install pcre
echo “install pcre”
echo “||”
echo “||”
cd pcre-8.37
./configure
make && make install
cd ..
echo “done”

install nginx
echo “install nginx”
echo “||”
echo “||”
cd nginx-1.9.7
./configure —prefix=/usr/local/nginx —with-pcre=../pcre-8.37 —with-zlib=../zlib-1.2.8 —with-http_flv_module —with-http_stub_status_module —with-http_gzip_static_module —with-http_ssl_module
make && make install
echo ${pwd}
cd ..
echo “install done”

nginx service
echo “nginx service”
cp nginx.server /etc/init.d/nginx
chmod +x /etc/init.d/nginx
chkconfig —add ngint
chkconfig nginx on
chkconfig nginx —list

echo “nginx service done”

start nginx
echo “start nginx”
/usr/local/nginx/sbin/nginx
#############################END