您的位置:首页 > 运维架构

安装openresty的脚本

2016-06-03 14:58 531 查看
#!/bin/bash

main_dir=/usr/local

openresty_file=/usr/local/openresty-1.9.7.4.tar.gz 

openresty_name=/usr/local/openresty-1.9.7.4

pcre_file=/usr/local/pcre-8.38.zip

pcre_name=/usr/local/pcre-8.38

openssl_file=/usr/local/openssl-1.0.2g.tar.gz

openssl_name=/usr/local/openssl-1.0.2g

zlib_file=/usr/local/zlib-1.2.8.tar.gz

zlib_name=/usr/local/zlib-1.2.8

nginx-http-concat_file=/usr/local/nginx-http-concat-master.zip

nginx-http-concat_name=/usr/local/nginx-http-concat-master

#wget https://openresty.org/download/openresty-1.9.7.4.tar.gz
#wget http://nchc.dl.sourceforge.net/project/pcre/pcre/8.38/pcre-8.38.zip
#wget https://www.openssl.org/source/openssl-1.0.2g.tar.gz
#wget http://jaist.dl.sourceforge.net/project/libpng/zlib/1.2.8/zlib-1.2.8.tar.gz
#wget https://launchpadlibrarian.net/105858342/drizzle-7.1.36-stable.tar.gz
#wget https://codeload.github.com/alibaba/nginx-http-concat/zip/master
echo

#unzip openresty

echo openresty tar start-------------

cd ${main_dir}

tar -zxvf ${openresty_file}

echo openresty tar complete.............

echo

#install gcc gcc-c++

echo gcc gcc-c++ intall start-------------

yum install -y gcc gcc-c++

echo gcc gcc-c++ intall complete.............

echo

#install pcre

echo pcre install start-------------

cd ${main_dir}

unzip ${pcre_file}

cd ${pcre_name}

./configure --prefix=/usr/local/pcre  --enable-utf8

make & make install

echo pcre intall complete.............

echo

#install openssl 

echo openssl install start-------------

cd ${main_dir}

tar -zxvf ${openssl_file}

cd ${openssl_name}

./config --prefix=/usr/local/openssl

./config -t

make & make install

echo openssl intall complete.............

echo

#install zlib 

echo zlib install start-------------

cd ${main_dir}

tar -zxvf ${zlib_file}

cd ${zlib_name}

./configure  --prefix=/usr/local/zlib

make & make install

echo zlib intall complete.............

echo

#install nginx-http-concat 

echo nginx-http-concat install start-------------

cd ${main_dir}

unzip ${nginx-http-concat_file}

mv ${nginx-http-concat_name} ${openresty_name}/bundle/nginx-http-concat

echo nginx-http-concat intall complete.............

echo

#install openresty  

echo openresty  install start-------------

cd ${openresty_name}

./configure --prefix=/usr/local/openresty --with-pcre=${pcre_name} --with-openssl=${openssl_name} --with-zlib=${zlib_name} --with-luajit --with-http_iconv_module --with-ld-opt="-Wl,-rpath,/usr/local/lib"  --with-http_stub_status_module --with-http_ssl_module
--with-http_sub_module --add-module=./bundle/nginx-http-concat/

#./configure --prefix=/usr/local/openresty --with-pcre=/usr/local/pcre-8.38 --with-openssl=/usr/local/openssl-1.0.2g --with-zlib=/usr/local/zlib-1.2.8 --with-luajit --with-http_iconv_module --with-ld-opt="-Wl,-rpath,/usr/local/lib"  --with-http_stub_status_module
--with-http_ssl_module --with-http_sub_module --add-module=./bundle/nginx-http-concat/

gmake

gmake install

echo openresty  install complete.............

echo

#/usr/local/openresty/nginx/sbin/nginx -c /usr/local/openresty/nginx/conf/nginx.conf
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: