标签:openssl apache 编译 error stack undeclared
操作系统:centos6.4 X86_64
apache版本:httpd-2.2.6
openssl版本:openssl-1.0.1e
源码编译apache时报如下错误:
ssl_engine_init.c: In function ‘ssl_init_ctx_protocol‘: ssl_engine_init.c:390: warning: assignment discards qualifiers from pointer target type ssl_engine_init.c:396: warning: assignment discards qualifiers from pointer target type ssl_engine_init.c: In function ‘ssl_init_ctx_verify‘: ssl_engine_init.c:546: error: ‘STACK‘ undeclared (first use in this function) ssl_engine_init.c:546: error: (Each undeclared identifier is reported only once ssl_engine_init.c:546: error: for each function it appears in.) ssl_engine_init.c:546: error: expected expression before ‘)‘ token ssl_engine_init.c: In function ‘ssl_init_FindCAList‘: ssl_engine_init.c:1126: warning: pointer type mismatch in conditional expression make[4]: *** [ssl_engine_init.slo] 错误 1 make[4]: Leaving directory `/software/httpd-2.2.6/modules/ssl‘ make[3]: *** [shared-build-recursive] 错误 1 make[3]: Leaving directory `/software/httpd-2.2.6/modules/ssl‘ make[2]: *** [shared-build-recursive] 错误 1 make[2]: Leaving directory `/software/httpd-2.2.6/modules‘ make[1]: *** [shared-build-recursive] 错误 1 make[1]: Leaving directory `/software/httpd-2.2.6‘ make: *** [all-recursive] 错误 1
原因分析:apache2.x 和openssl1.0.x不兼容导致的
解决方法:安装openssl0.9.8e
安装步骤:
# tar zxvf openssl-0.9.8e.tar.gz # cd openssl-0.9.8e # ./config shared zlib # make # make test # make install # mv /usr/bin/openssl /usr/bin/openssl.OFF # mv /usr/include/openssl /usr/include/openssl.OFF # rm -rf /usr/lib/libssl.so # ln -s /usr/local/ssl/bin/openssl /usr/bin/openssl # ln -s /usr/local/ssl/include/openssl /usr/include/openssl # ln -sv /usr/local/ssl/lib/libssl.so.0.9.8 /usr/lib/libssl.so
配置库文件搜索路径
# echo "/usr/local/ssl/lib" >> /etc/ld.so.conf # ldconfig -v
检测安装结果
# openssl version
OpenSSL 0.9.8e 23 Feb 2007
安装成功!
重新编译apache,编译时参数加上 --enable-ssl --with-ssl=/usr/local/ssl
问题解决。
本文出自 “兵临城下” 博客,请务必保留此出处http://308107405.blog.51cto.com/6396647/1537541
apache源码编译时报错ssl_engine_init.c:546: error: 'STACK' undeclared (first use in this function)
标签:openssl apache 编译 error stack undeclared
原文地址:http://308107405.blog.51cto.com/6396647/1537541