我正在运行 Tomcat 8.0.49,并设置了 SSL 连接器。这是一个适用于我的其他 Tomcat 实例(版本为 7.x)的连接器。通过 Web 浏览器连接到实例挂起,这似乎是因为 SSL 连接器未正常启动。这似乎是因为它找不到 APR 库,我想我已经安装了。有什么想法吗?请看下文。
这是我在 catalina.out 中得到的:
02-Oct-2020 13:53:52.357 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.262.b10-0.el7_8.x86_64/jre/lib/amd64:/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib
即使我安装了以下 RPM(似乎我可能只需要 apr 和 apr-devel):
$ sudo rpm -qa apr openssl-devel apr-util apr-devel apr
openssl-devel-1.0.2k-19.el7.x86_64
apr-util-1.5.2-6.el7.x86_64
apr-1.4.8-5.el7.x86_64
apr-devel-1.4.8-5.el7.x86_64
这是我看到的四月份的情况:
$ sudo find / -name '*apr*'
..
/usr/bin/apr-1-config
..
/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.262.b10-0.el7_8.x86_64/jre/lib/amd64/libsaproc.so
/usr/lib64/apr-1
/usr/lib64/apr-1/build/apr_rules.mk
/usr/lib64/pkgconfig/apr-1.pc
/usr/lib64/libapr-1.so
/usr/lib64/libaprutil-1.so.0
/usr/lib64/libaprutil-1.so.0.5.2
/usr/lib64/libapr-1.la
/usr/lib64/libapr-1.so.0
/usr/lib64/libapr-1.so.0.4.8
/usr/lib64/apr-util-1
这是 server.xml 中的连接器:
<Connector SSLCertificateFile="path-of-mycertfile-here.crt" SSLCertificateKeyFile="path-of-my-keyfile-here.key" SSLCipherSuite="HIGH:MEDIUM:!RC4:!DES-CBC3-SHA:!EDH-RSA-DES-CBC3-SHA:ECDH-RSA-AES256-SHA:!ADH-DES-CBC3-SHA:!3DES:!aNULL:!eNULL" SSLEnabled="true" SSLProtocol="TLSv1.2" URIEncoding="UTF-8" clientAuth="false" maxThreads="150" port="9443" protocol="org.apache.coyote.http11.Http11AprProtocol" scheme="https" secure="true"/>
这是环境信息,同样来自 catalina.out:
02-Oct-2020 13:53:52.349 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server version: Apache Tomcat
02-Oct-2020 13:53:52.352 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server built: Jan 19 2018 20:21:23 UTC
02-Oct-2020 13:53:52.353 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server number: 8.0.x
02-Oct-2020 13:53:52.353 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Name: Linux
02-Oct-2020 13:53:52.353 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Version: 3.10.0-1127.13.1.el7.x86_64
02-Oct-2020 13:53:52.353 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Architecture: amd64
02-Oct-2020 13:53:52.353 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Java Home: /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.262.b10-0.el7_8.x86_64/jre
02-Oct-2020 13:53:52.354 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Version: 1.8.0_262-b10
02-Oct-2020 13:53:52.354 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Vendor: Oracle Corporation
02-Oct-2020 13:53:52.354 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_BASE: /opt/apache-tomcat-8.0.49
02-Oct-2020 13:53:52.354 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_HOME: /opt/apache-tomcat-8.0.49