共计 6368 个字符,预计需要花费 16 分钟才能阅读完成。
Apache2.40+OpenSSL1.0.1i 编译错误解决过程记录。
[root@linuxidc httpd-2.4.10]# uname -a
Linux linuxidc 2.6.32-431.el6.x86_64 #1 SMP Fri Nov 22 03:15:09 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
[root@linuxidc httpd-2.4.10]# uname -r
2.6.32-431.el6.x86_64
[root@linuxidc httpd-2.4.10]#
64 为 CentOS 6.5 版本, 编译 Apache2.40 时出错
Apache 编译选项:
./configure –prefix=/usr/local/httpd24 \
–sysconfdir=/etc/httpd24 \
–enable-so \
–enable-ssl \
–enable-cgi \
–enable-rewrite \
–with-zlib \
–with-pcre \
–with-apr=/usr/local/apr/ \
–with-apr-util=/usr/local/apr-util/ \
–enable-modules=most \
–enable-mpms-shared=all \
–with-mpm=event \
–with-ssl=/usr/local/openssl-1.0.1i
错误信息:
/usr/bin/ld: /usr/local/openssl-1.0.1i/lib/libcrypto.a(e_gost_err.o): relocation R_X86_64_32 against `.data’ can not be used when making a shared object; recompile with -fPIC
/usr/local/openssl-1.0.1i/lib/libcrypto.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
make[4]: *** [mod_ssl.la] Error 1
make[4]: Leaving directory `/usr/local/src/httpd-2.4.10/modules/ssl’
make[3]: *** [shared-build-recursive] Error 1
make[3]: Leaving directory `/usr/local/src/httpd-2.4.10/modules/ssl’
make[2]: *** [shared-build-recursive] Error 1
make[2]: Leaving directory `/usr/local/src/httpd-2.4.10/modules’
make[1]: *** [shared-build-recursive] Error 1
make[1]: Leaving directory `/usr/local/src/httpd-2.4.10′
make: *** [all-recursive] Error 1
让重新编译 OpenSSL 使用 -fPIC, 结果还是一样, 最后参考 http://www.linuxidc.com/Linux/2014-10/107919p2.htm
重新编译 OpenSSL 解决了:
./config –prefix=/usr/local/openssl-1.0.1i -fPIC no-gost
————————————– 分割线 ————————————–
Ubuntu 13.04 安装 LAMP\Vsftpd\Webmin\phpMyAdmin 服务及设置 http://www.linuxidc.com/Linux/2013-06/86250.htm
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
LAMP+Xcache 环境搭建 http://www.linuxidc.com/Linux/2014-05/101087.htm
Linux 下 Apache+OpenSSL 配置记录 http://www.linuxidc.com/Linux/2014-09/107390.htm
————————————– 分割线 ————————————–
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 的下载地址:请点这里
Apache2.40+OpenSSL1.0.1i 编译错误解决过程记录。
[root@linuxidc httpd-2.4.10]# uname -a
Linux linuxidc 2.6.32-431.el6.x86_64 #1 SMP Fri Nov 22 03:15:09 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
[root@linuxidc httpd-2.4.10]# uname -r
2.6.32-431.el6.x86_64
[root@linuxidc httpd-2.4.10]#
64 为 CentOS 6.5 版本, 编译 Apache2.40 时出错
Apache 编译选项:
./configure –prefix=/usr/local/httpd24 \
–sysconfdir=/etc/httpd24 \
–enable-so \
–enable-ssl \
–enable-cgi \
–enable-rewrite \
–with-zlib \
–with-pcre \
–with-apr=/usr/local/apr/ \
–with-apr-util=/usr/local/apr-util/ \
–enable-modules=most \
–enable-mpms-shared=all \
–with-mpm=event \
–with-ssl=/usr/local/openssl-1.0.1i
错误信息:
/usr/bin/ld: /usr/local/openssl-1.0.1i/lib/libcrypto.a(e_gost_err.o): relocation R_X86_64_32 against `.data’ can not be used when making a shared object; recompile with -fPIC
/usr/local/openssl-1.0.1i/lib/libcrypto.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
make[4]: *** [mod_ssl.la] Error 1
make[4]: Leaving directory `/usr/local/src/httpd-2.4.10/modules/ssl’
make[3]: *** [shared-build-recursive] Error 1
make[3]: Leaving directory `/usr/local/src/httpd-2.4.10/modules/ssl’
make[2]: *** [shared-build-recursive] Error 1
make[2]: Leaving directory `/usr/local/src/httpd-2.4.10/modules’
make[1]: *** [shared-build-recursive] Error 1
make[1]: Leaving directory `/usr/local/src/httpd-2.4.10′
make: *** [all-recursive] Error 1
让重新编译 OpenSSL 使用 -fPIC, 结果还是一样, 最后参考 http://www.linuxidc.com/Linux/2014-10/107919p2.htm
重新编译 OpenSSL 解决了:
./config –prefix=/usr/local/openssl-1.0.1i -fPIC no-gost
————————————– 分割线 ————————————–
Ubuntu 13.04 安装 LAMP\Vsftpd\Webmin\phpMyAdmin 服务及设置 http://www.linuxidc.com/Linux/2013-06/86250.htm
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
LAMP+Xcache 环境搭建 http://www.linuxidc.com/Linux/2014-05/101087.htm
Linux 下 Apache+OpenSSL 配置记录 http://www.linuxidc.com/Linux/2014-09/107390.htm
————————————– 分割线 ————————————–