install_nginx.sh
#!/bin/bash
#postgre install
basepath=$(cd `dirname $0`; pwd)
echo "$basepath"
sleep 1
tar -zxvf openssl-1.0.2l.tar.gz
cd openssl-1.0.2l
./config
make && make install
#rewrite模块需要安装的包
cd $basepath
tar -zxvf pcre-8.41.tar.gz
cd pcre-8.41
./configure
make && make install
#gzip模块需要安装的包
cd $basepath
tar -zxvf zlib-1.2.11.tar.gz
cd zlib-1.2.11
./configure
make && make install
cd $basepath
tar -zxvf nginx-1.12.1.tar.gz
echo "end of tar, start set export"
mkdir nginxhome
cd nginx-1.12.1
./configure --prefix=$basepath/nginxhome --with-http_ssl_module --with-openssl=$basepath/openssl-1.0.2l/ --with-zlib=$basepath/zlib-1.2.11/ --with-pcre=$basepath/pcre-8.41/#pcre模块支持if,set命令及rewrite功能,zlib模块支持数据压缩功能
make && make install
cp -f $basepath/nginx.conf $basepath/nginxhome/conf/
cp $basepath/vcm.* $basepath/nginxhome/conf/
我的安装目录结构: