我正在尝试在 RedHat Enterprise 7.2 上安装 Tomcat 8.5。我在编译 Tomcat Native 1.2 时遇到了问题。RedHat 7 附带 OpenSSL 1.01,而 Tomcat Native 1.2 需要 OpenSSL 1.0.2,因此我不得不编译 OpenSSL 1.0.2。
因此,当我运行以下命令时:
"./configure --with-ssl=/usr/local/ssl --with-apr=/usr/bin/apr-1-config --with-java-home=/usr/java/default"
,当我尝试运行“make”时出现以下错误:
make[1]: Entering directory `/usr/local/tomcat/apache-tomcat-8.5.9/bin/tomcat-native-1.2.10-src/native'
/bin/sh /usr/lib64/apr-1/build/libtool --silent --mode=link gcc -pthread -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -DHAVE_CONFIG_H -DLINUX -D_REENTRANT -D_GNU_SOURCE -g -O2 -DHAVE_OPENSSL -DHAVE_POLLSET_WAKEUP -I/usr/local/tomcat/apache-tomcat-8.5.9/bin/tomcat-native-1.2.10-src/native/include -I/usr/java/default/include -I/usr/java/default/include/linux -I/usr/local/ssl/include -I/usr/include/apr-1 -version-info 2:10:2 -Wl,-z,relro -o libtcnative-1.la -rpath /usr/local/apr/lib src/address.lo src/bb.lo src/dir.lo src/error.lo src/file.lo src/info.lo src/jnilib.lo src/lock.lo src/misc.lo src/mmap.lo src/multicast.lo src/network.lo src/os.lo src/poll.lo src/pool.lo src/proc.lo src/shm.lo src/ssl.lo src/sslcontext.lo src/sslinfo.lo src/sslnetwork.lo src/sslutils.lo src/stdlib.lo src/thread.lo src/user.lo os/unix/system.lo os/unix/uxpipe.lo -L/usr/local/ssl/lib -Wl,-rpath,/usr/local/ssl/lib -lssl -lcrypto /usr/lib64/libapr-1.la -lpthread -ldl
/bin/ld: /usr/local/ssl/lib/libcrypto.a(ecp_nistz256.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/usr/local/ssl/lib/libcrypto.a: could not read symbols: Bad value
collect2: error: ld returned 1 exit status
make[1]: *** [libtcnative-1.la] Error 1
make[1]: Leaving directory `/usr/local/tomcat/apache-tomcat-8.5.9/bin/tomcat-native-1.2.10-src/native'
make: *** [all-recursive] Error 1
我尝试使用 -fPIC (./config -fPIC) 重新编译 OpenSSL 1.0.2,但仍然出现相同的错误。
有人有什么想法吗?
谢谢!