[root@diguojin httpd-2.4.10]# uname -a
Linux diguojin 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@diguojin httpd-2.4.10]# uname -r
2.6.32-431.el6.x86_64
[root@diguojin 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://qing.blog.sina.com.cn/1153369603/44bf0603330023r5.html

重新编译OpenSSL解决了:

./config --prefix=/usr/local/openssl-1.0.1i -fPIC no-gost