INEVITY's Blog

tech life

openresty编译

Aug. 4, 2016

依赖

下载包

-  wget https://www.openssl.org/source/openssl-1.0.2h.tar.gz
-  wget http://zlib.net/zlib-1.2.8.tar.gz
-  wget http://ftp.cs.stanford.edu/pub/exim/pcre/pcre-8.39.tar.gz
-  wget https://raw.githubusercontent.com/openresty/openresty/master/patches/openssl-1.0.2h-sess_set_get_cb_yield.patch
-  wget https://openresty.org/download/openresty-1.9.15.1.tar.gz
-  全部解压到同一目录

先编译openssl

cd openssl-1.0.2h/ patch -b -p1 < ../openssl-1.0.2h-sess_set_get_cb_yield.patch ./config --prefix=/usr/local/openresty-debug/openssl no-threads no-asm shared -d -DPURIFY make depend make -j2 sudo make install

编译openresty

cd ../openresty-1.9.15.1/ ./configure --prefix=/usr/local/openresty-debug --with-debug --with-cc-opt="-I/usr/local/openresty-debug/openssl/include -O0" --with-ld-opt="-L/usr/local/openresty-debug/openssl/lib -Wl,-rpath,/usr/local/openresty-debug/openssl/lib" --with-zlib="../zlib-1.2.8" --with-pcre="../pcre-8.39" --with-pcre-opt="-DSUPPORT_UTF" --with-pcre-jit --without-http_rds_json_module --without-http_rds_csv_module --without-lua_rds_parser --with-ipv6 --with-stream --with-stream_ssl_module --with-http_v2_module --without-mail_pop3_module --without-mail_imap_module --without-mail_smtp_module --with-http_stub_status_module --with-http_realip_module --with-http_addition_module --with-http_auth_request_module --with-http_secure_link_module --with-http_random_index_module --with-http_gzip_static_module --with-http_sub_module --with-http_dav_module --with-http_flv_module --with-http_mp4_module --with-http_gunzip_module --with-threads --with-file-aio --with-poll_module --with-luajit-xcflags='-DLUAJIT_ENABLE_LUA52COMPAT -O0' --with-dtrace-probes make sudo make install ldd /usr/local/openresty-debug/nginx/sbin/nginx ln -s到/esr/bin下。