openresty 静态编译,openresty编译
openresty 静态编译
#!/bin/bash
set -e
wget https://github.com/openresty/openresty/releases/download/v1.11.2.2/openresty-1.11.2.2.tar.gz
tar -xzf openresty-1.11.2.2.tar.gz
cd openresty-1.11.2.2
wget http://luajit.org/download/LuaJIT-2.1.0-beta2.tar.gz
tar -xzf LuaJIT-2.1.0-beta2.tar.gz
cd LuaJIT-2.1.0-beta2
make -j8
make install PREFIX=`pwd`
LUAROOT=`pwd`
rm -rf lib/*.so*
cd ..
PCRE_V=8.39
rm -rf pcre-*
echo -n "downloading pcre-$PCRE_V... "
wget -O pcre-$PCRE_V.tar.bz2 "http://downloads.sourceforge.net/project/pcre/pcre/$PCRE_V/pcre-$PCRE_V.tar.bz2?r=https%3A%2F%2Fsourceforge.net%2Fprojects%2Fpcre%2Ffiles%2Fpcre%2F8.39%2F&ts=1472645099&use_mirror=nchc"
echo "ok"
tar -xjf pcre-$PCRE_V.tar.bz2
ZLIB_V=1.2.11
rm -rf zlib-*
echo -n "downloading zlib-$ZLIB_V... "
wget -O zlib-$ZLIB_V.tar.gz http://zlib.net/zlib-$ZLIB_V.tar.gz
echo "ok"
tar -xzf zlib-$ZLIB_V.tar.gz
rm -rf openssl-*
rm -rf OpenSSL_1_0_1t*
echo -n "downloading OpenSSL_1_0_1t.. "
wget https://github.com/openssl/openssl/archive/OpenSSL_1_0_1t.tar.gz
echo "ok"
tar -xzf OpenSSL_1_0_1t.tar.gz
./configure -j8 \
--with-luajit=$LUAROOT \
--with-http_ssl_module \
--with-http_realip_module \
--with-http_addition_module \
--with-http_sub_module \
--with-http_dav_module \
--with-http_flv_module \
--with-http_mp4_module \
--with-http_gunzip_module \
--with-http_gzip_static_module \
--with-http_random_index_module \
--with-http_secure_link_module \
--with-http_stub_status_module \
--with-http_auth_request_module \
--with-pcre=./pcre-$PCRE_V \
--with-zlib=./zlib-$ZLIB_V \
--with-openssl=./openssl-OpenSSL_1_0_1t
make -j8
cp build/nginx-1.11.2/objs/nginx ./openresty
评论暂时关闭