nginx安装报错:undefined reference to `X509_check_host'

nginx 升级 openssl 编译版本出错

自己升级了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

 

//查看当前系统版本的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

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值