nginx1.11.*版本安装sticky模块出现MD5报错找不到问题解决方法

[rpm@k8smaster01 srcsoft]$ sh install-nginx.sh >11.txt 
You need to be root to perform this command.
ar: creating ../libcrypto.a
ar: creating ../libssl.a
WARNING: can't open config file: /data/soft/nginx-1.11.10/module/openssl-1.0.2j/.openssl/ssl/openssl.cnf
WARNING: can't open config file: /data/soft/nginx-1.11.10/module/openssl-1.0.2j/.openssl/ssl/openssl.cnf
WARNING: can't open config file: /data/soft/nginx-1.11.10/module/openssl-1.0.2j/.openssl/ssl/openssl.cnf
WARNING: can't open config file: /data/soft/nginx-1.11.10/module/openssl-1.0.2j/.openssl/ssl/openssl.cnf
/data/soft/nginx-1.11.10/module/nginx-sticky-module-1.2.6/ngx_http_sticky_misc.c: In function ‘ngx_http_sticky_misc_md5’:
/data/soft/nginx-1.11.10/module/nginx-sticky-module-1.2.6/ngx_http_sticky_misc.c:152:15: error: ‘MD5_DIGEST_LENGTH’ undeclared (first use in this function)
   u_char hash[MD5_DIGEST_LENGTH];
               ^
/data/soft/nginx-1.11.10/module/nginx-sticky-module-1.2.6/ngx_http_sticky_misc.c:152:15: note: each undeclared identifier is reported only once for each function it appears in
/data/soft/nginx-1.11.10/module/nginx-sticky-module-1.2.6/ngx_http_sticky_misc.c:152:10: error: unused variable ‘hash’ [-Werror=unused-variable]
   u_char hash[MD5_DIGEST_LENGTH];
          ^
/data/soft/nginx-1.11.10/module/nginx-sticky-module-1.2.6/ngx_http_sticky_misc.c: In function ‘ngx_http_sticky_misc_hmac_md5’:
/data/soft/nginx-1.11.10/module/nginx-sticky-module-1.2.6/ngx_http_sticky_misc.c:189:15: error: ‘MD5_DIGEST_LENGTH’ undeclared (first use in this function)
   u_char hash[MD5_DIGEST_LENGTH];
               ^
/data/soft/nginx-1.11.10/module/nginx-sticky-module-1.2.6/ngx_http_sticky_misc.c:190:12: error: ‘MD5_CBLOCK’ undeclared (first use in this function)
   u_char k[MD5_CBLOCK];

解决方式:
修改sticky模块文件夹中的ngx_http_sticky_misc.c文件

将这两个模块 <openssl/sha.h> and <openssl/md5.h>包含到文件ngx_http_sticky_misc.c
下面红色标注地方
#include <nginx.h>
#include <ngx_config.h>
#include <ngx_core.h>
#include <ngx_http.h>
#include <ngx_md5.h>
#include <ngx_sha1.h>
#include <openssl/sha.h>
#include <openssl/md5.h>

#include "ngx_http_sticky_misc.h"

之后再重新编译就不会出错了

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值