手机版
你好,游客 登录 注册
背景:
阅读新闻

Apache2.40+OpenSSL1.0.1i 编译错误

[日期:2014-10-12] 来源:Linux社区  作者:diguojin [字体:大 中 小]

Apache+OpenSSL

正式环境:
系统:Red Hat Enterprise Linux Server release 5.6 (Tikanga)
内核:2.6.18-238.31.1.el5
位数:64

测试环境:
系统:CentOS release 5.8 (Final)
内核:2.6.18-53.el5
位数: 32

相关软件版本及下载地址
1.apr: http://labs.mop.com/apache-mirror//apr/apr-1.4.6.tar.gz
 2.apr-util:http://labs.mop.com/apache-mirror//apr/apr-util-1.4.1.tar.gz
 3.pcre:http://cdnetworks-kr-2.dl.sourceforge.net/project/pcre/pcre/8.30/pcre-8.30.zip
 4.openssl:http://www.openssl.org/source/openssl-1.0.1c.tar.gz
 5.apache:http://labs.mop.com/apache-mirror/httpd/httpd-2.4.2.tar.gz
(apr,apr-util,pcre安装在此略过)

测试环境openssl及apache安装方法:

openssl 编译:
./config ; make; make install
 apache 编译:
./configure --prefix=/opt/xyz/apache2.4.2_resin4.0.29/apache2  --enable-mods-shared=ALL --enable-so  --with-apr=/usr/local/apr -with-apr-util=/usr/local/apr-util --with-pcre=/usr/local/pcre --enable-ssl --with-ssl=/usr/local/ssl

正式环境openssl及apache安装方法:
openssl编译:
 如果按照测试环境编译,提示如下错误(google出来的结果基本就是说bug之类的,在此顺道鄙视百度一下,连个类似的检索都没有。)
 /usr/bin/ld: /usr/local/ssl/lib/libssl.a(s3_srvr.o): relocation R_X86_64_32 against `a local symbol' can not be used when making a shared object; recompile with -fPIC

/usr/local/ssl/lib/libssl.a: could not read symbols: Bad value

collect2: ld returned 1 exit status

make[4]: *** [mod_ssl.la] Error 1

make[4]: Leaving directory `/opt/xyz/httpd-2.4.2/modules/ssl'

make[3]: *** [shared-build-recursive] Error 1

make[3]: Leaving directory `/opt/xyz/httpd-2.4.2/modules/ssl'

make[2]: *** [shared-build-recursive] Error 1

make[2]: Leaving directory `/opt/xyz/httpd-2.4.2/modules'

make[1]: *** [shared-build-recursive] Error 1

make[1]: Leaving directory `/opt/xyz/httpd-2.4.2'

make: *** [all-recursive] Error 1
这段错误说明ssl方面的错误,需要重新编译,并添加 -fPIC​。既然如此,就按照要求来呗,找到openssl的源文件,重新编译,./config -fPIC,make clean 无数遍,最后发现还是提示如上错误。

这下坑爹了,干脆一切删了重来。
64位下成功解决方法:
openssl编译:
./config --prefix=${destination_dir} -fPIC no-gost no-shared no-zlib
 make depend ; make install
 apache 编译方法照旧。

CentOS 5.9下编译安装LAMP(Apache 2.2.44+MySQL 5.6.10+PHP 5.4.12) http://www.linuxidc.com/Linux/2013-03/80333p3.htm

RedHat 5.4下Web服务器架构之源码构建LAMP环境及应用PHPWind http://www.linuxidc.com/Linux/2012-10/72484p2.htm

LAMP源码环境搭建WEB服务器Linux+Apache+MySQL+PHP http://www.linuxidc.com/Linux/2013-05/84882.htm

通过OpenSSL提供FTP+SSL/TLS认证功能,并实现安全数据传输 http://www.linuxidc.com/Linux/2013-05/84986.htm

OpenSSL 的详细介绍:请点这里
OpenSSL 的下载地址:请点这里

本文永久更新链接地址:http://www.linuxidc.com/Linux/2014-10/107919.htm

linux
相关资讯       openssl  Apache2.40 
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款