nginx 升级 openssl 编译版本出错
来源:4-19 基于Nginx的HTTPS服务_证书签名生成和Nginx的HTTPS服务场景演示1
Cynic_1218
2018-08-02
自己升级了openssl1.0.2 重新编译nginx openssl 版本出错
./configure --prefix=/etc/nginx --sbin-path=/usr/sbin/nginx --modules-path=/usr/lib64/nginx/modules --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --pid-path=/var/run/nginx.pid --lock-path=/var/run/nginx.lock --http-client-body-temp-path=/var/cache/nginx/client_temp --http-proxy-temp-path=/var/cache/nginx/proxy_temp --http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp --http-uwsgi-temp-path=/var/cache/nginx/uwsgi_temp --http-scgi-temp-path=/var/cache/nginx/scgi_temp --user=nginx --group=nginx --with-compat --with-file-aio --with-threads --with-http_addition_module --with-http_auth_request_module --with-http_dav_module --with-http_flv_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_mp4_module --with-http_random_index_module --with-http_realip_module --with-http_secure_link_module --with-http_slice_module --with-http_ssl_module --with-http_stub_status_module --with-http_sub_module --with-http_v2_module --with-mail --with-mail_ssl_module --with-stream --with-stream_realip_module --with-stream_ssl_module --with-stream_ssl_preread_module --with-cc-opt='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -fPIC' --with-ld-opt='-Wl,-z,relro -Wl,-z,now -pie' --with-openssl='/usr/local/openssl -fPIC'
错误信息
objs/src/event/ngx_event_openssl.o: In function `ngx_ssl_get_ciphers':
/root/nginx-1.12.0/src/event/ngx_event_openssl.c:3358: undefined reference to `SSL_CIPHER_find'
/root/nginx-1.12.0/src/event/ngx_event_openssl.c:3378: undefined reference to `SSL_CIPHER_find'
objs/src/event/ngx_event_openssl.o: In function `ngx_ssl_check_host':
/root/nginx-1.12.0/src/event/ngx_event_openssl.c:3169: undefined reference to `X509_check_host'
objs/src/http/ngx_http_request.o: In function `ngx_http_ssl_handshake_handler':
/root/nginx-1.12.0/src/http/ngx_http_request.c:784: undefined reference to `SSL_get0_alpn_selected'
objs/src/http/modules/ngx_http_ssl_module.o: In function `ngx_http_ssl_merge_srv_conf':
/root/nginx-1.12.0/src/http/modules/ngx_http_ssl_module.c:690: undefined reference to `SSL_CTX_set_alpn_select_cb'
collect2: ld returned 1 exit status
1回答
-
Jeson
2018-08-05
我觉是openssl编译的问题,我之前升级openssl是这么作的,你可以参考下:
//查看当前系统版本的openssl,如果没有达到 1.2 就需要升级
openssl version -a
//下载源码
wget https://www.openssl.org/source/openssl-1.0.2k.tar.gz
//编译安装、及修改配置
./config --prefix=/usr/local/openssl
make && make install
mv /usr/bin/openssl /usr/bin/openssl.OFF
mv /usr/include/openssl /usr/include/openssl.OFF
ln -s /usr/local/openssl/bin/openssl /usr/bin/openssl
ln -s /usr/local/openssl/include/openssl /usr/include/openssl
echo "/usr/local/openssl/lib" >>/etc/ld.so.conf
ldconfig -v
openssl version -a
注意:如果升级了openssl那么就必须要重新编译安装nginx ,要不nginx还会是老的版本。
//重新编译nginx
./configure --prefix=/opt/app/nginx --user=www --group=www --with-http_stub_status_module --with-pcre=/opt/download/pcre-8.38 --with-http_ssl_module --with-http_stub_status_module --with-http_sub_module --with-http_v2_module --with-openssl=/opt/download/openssl-1.0.2k/
make -j 4
make install
00
相似问题