系统环境如下:
$ uname -a
Linux cyhd2 4.15.0-59-generic #66-Ubuntu SMP Wed Aug 14 10:56:44 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
$ cat /etc/os-release
NAME="Ubuntu"
VERSION="18.04.3 LTS (Bionic Beaver)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 18.04.3 LTS"
VERSION_ID="18.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=bionic
UBUNTU_CODENAME=bionic
openresty的安装方式如下:
sudo apt-get install -y openresty
添加nginx-sticky-module模块的过程如下:
wget https://openresty.org/download/openresty-1.15.8.3.tar.gz
tar xf openresty-1.15.8.3.tar.gz
wget https://bitbucket.org/nginx-goodies/nginx-sticky-module-ng/get/08a395c66e42.zip
unzip 08a395c66e42.zip
mv nginx-goodies-nginx-sticky-module-ng-08a395c66e42/ ./openresty-1.15.8.3/bundle/nginx-sticky-module
cd openresty-1.15.8.3/bundle/nginx-1.15.8
sudo LUAJIT_LIB=/usr/local/openresty/luajit/lib LUAJIT_INC=/usr/local/openresty/luajit/include/luajit-2.1 ./configure --prefix=/usr/local/openresty/nginx --with-cc-opt='-O2 -DNGX_LUA_ABORT_AT_PANIC -I/usr/local/openresty/zlib/include -I/usr/local/openresty/pcre/include -I/usr/local/openresty/openssl/include' --with-ld-opt='-Wl,-rpath,/usr/local/openresty/luajit/lib -L/usr/local/openresty/zlib/lib -L/usr/local/openresty/pcre/lib -L/usr/local/openresty/openssl/lib -Wl,-rpath,/usr/local/openresty/zlib/lib:/usr/local/openresty/pcre/lib:/usr/local/openresty/openssl/lib' --with-threads --with-dtrace-probes --with-pcre-jit --with-stream --with-stream_ssl_module --with-stream_ssl_preread_module --with-http_v2_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-http_ssl_module --without-mail_pop3_module --without-mail_imap_module --without-mail_smtp_module --add-module=../ngx_devel_kit-0.3.1rc1 --add-module=../echo-nginx-module-0.61 --add-module=../xss-nginx-module-0.06 --add-module=../ngx_coolkit-0.2 --add-module=../set-misc-nginx-module-0.32 --add-module=../form-input-nginx-module-0.12 --add-module=../encrypted-session-nginx-module-0.08 --add-module=../srcache-nginx-module-0.31 --add-module=../ngx_lua-0.10.15 --add-module=../ngx_lua_upstream-0.07 --add-module=../headers-more-nginx-module-0.33 --add-module=../array-var-nginx-module-0.05 --add-module=../memc-nginx-module-0.19 --add-module=../redis2-nginx-module-0.15 --add-module=../redis-nginx-module-0.3.7 --add-module=../ngx_stream_lua-0.0.7 --add-module=../nginx-sticky-module
make报错如下:
...
objs/addon/nginx-sticky-module/ngx_http_sticky_module.o \
objs/addon/nginx-sticky-module/ngx_http_sticky_misc.o \
objs/ngx_modules.o \
objs/ngx_dtrace_provider.o \
-L/usr/local/openresty/luajit/lib -L/usr/local/openresty/luajit/lib -Wl,-rpath,/usr/local/openresty/luajit/lib -L/usr/local/openresty/zlib/lib -L/usr/local/openresty/pcre/lib -L/usr/local/openresty/openssl/lib -Wl,-rpath,/usr/local/openresty/zlib/lib:/usr/local/openresty/pcre/lib:/usr/local/openresty/openssl/lib -Wl,-E -Wl,-E -ldl -lpthread -lpthread -lcrypt -L/usr/local/openresty/luajit/lib -lluajit-5.1 -lm -ldl -L/usr/local/openresty/luajit/lib -lluajit-5.1 -lm -ldl -lpcre -lssl -lcrypto -ldl -lpthread -lz \
-Wl,-E
objs/src/event/ngx_event_openssl.o: In function ngx_ssl_early_data':
/home/cyhd2adm/tools/openresty-1.15.8.3/bundle/nginx-1.15.8/src/event/ngx_event_openssl.c:1215: undefined reference to
SSL_CTX_set_max_early_data'
objs/src/event/ngx_event_openssl.o: In function ngx_ssl_create_connection':
/home/cyhd2adm/tools/openresty-1.15.8.3/bundle/nginx-1.15.8/src/event/ngx_event_openssl.c:1279: undefined reference to
SSL_CTX_get_max_early_data'
objs/src/event/ngx_event_openssl.o: In function ngx_ssl_try_early_data':
/home/cyhd2adm/tools/openresty-1.15.8.3/bundle/nginx-1.15.8/src/event/ngx_event_openssl.c:1505: undefined reference to
SSL_read_early_data'
objs/src/event/ngx_event_openssl.o: In function ngx_ssl_recv_early':
/home/cyhd2adm/tools/openresty-1.15.8.3/bundle/nginx-1.15.8/src/event/ngx_event_openssl.c:1877: undefined reference to
SSL_read_early_data'
objs/src/event/ngx_event_openssl.o: In function ngx_ssl_write_early':
/home/cyhd2adm/tools/openresty-1.15.8.3/bundle/nginx-1.15.8/src/event/ngx_event_openssl.c:2348: undefined reference to
SSL_write_early_data'
collect2: error: ld returned 1 exit status
objs/Makefile:1164: recipe for target 'objs/nginx' failed
make[1]: *** [objs/nginx] Error 1
make[1]: Leaving directory '/home/cyhd2adm/tools/openresty-1.15.8.3/bundle/nginx-1.15.8'
Makefile:8: recipe for target 'build' failed
make: *** [build] Error 2