Script to install Openresty
Last Update:2018-07-26
Source: Internet
Author: User
#!/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