操作系统:Ubuntu 12.04 LTS 64bit
nginx 版本: nginx 1.10.2
encrypted-session-nginx-module 版本:0.06
gcc 版本: 4.6.3
configure 脚本:
./configure --user=www-data --group=www-data --prefix=/data/services/nginx-1.10.2 \
--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_gzip_static_module \
--with-http_random_index_module \
--with-http_secure_link_module \
--with-http_stub_status_module \
--with-file-aio \
--with-stream \
--with-stream_ssl_module \
--with-pcre=../pcre-8.39 \
--with-openssl=../openssl-1.0.2j \
--with-zlib=../zlib-1.2.8 \
--add-dynamic-module=../nginx_module/ngx_devel_kit-0.3.0 \
--add-dynamic-module=../nginx_module/encrypted-session-nginx-module-0.06
nginx.conf 配置:
load_module modules/ndk_http_module.so;
load_module modules/ngx_http_encrypted_session_module.so;
启动时报错:
dlopen() "/data/services/nginx-1.10.2/modules/ngx_http_encrypted_session_module.so" failed (/data/services/nginx-1.10.2/modules/ngx_http_encrypted_session_module.so: undefined symbol: MD5)
看报错信息是找不到 MD5 这个函数,于是分别查了一个 openssl 静态库以及nginx 的符号表,
nm openssl-1.0.2j/.openssl/lib/libcrypto.a |grep MD5 ,输出如下:
0000000000000230 T MD5_Final
00000000000002e0 T MD5_Init
0000000000000220 T MD5_Transform
0000000000000000 T MD5_Update
0000000000000000 R MD5_version
0000000000000000 T MD5
nm nginx-1.10.2/objs/nginx|grep MD5 ,输出如下:
000000000051e050 T MD5_Final
000000000051e100 T MD5_Init
000000000051e040 T MD5_Transform
000000000051de20 T MD5_Update
0000000000680960 R MD5_version
MD5 是openssl的函数,openssl编译的静态库能找到这个函数,但是将 openssl 静态编译到nginx中这个函数就消失了吗?