这是server.xml中的连接器:
<Connector port="8443" protocol="org.apache.coyote.http11.Http11AprProtocol"
maxThreads="150"
SSLEnabled="true"
scheme="https"
compression="off"
connectionTimeout="1190"
address="0.0.0.0"
>
<UpgradeProtocol className="org.apache.coyote.http2.Http2Protocol" />
<SSLHostConfig>
<Certificate certificateKeyFile="/etc/ssl/certs/private.key"
certificateFile="/etc/ssl/certs/public.pem"
/>
</SSLHostConfig>
</Connector>
这个连接器的目标是使用HTTP2和APR以及HTTPS来提高速度。
我们使用操作系统包tomcat-native安装了tomcat本地程序。
启动时的日志输出:
INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent Loaded APR based Apache Tomcat Native library [1.2.16] using APR version [1.6.3]. INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true]. INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent APR/OpenSSL configuration: useAprConnector [false], useOpenSSL [true]
除了useAprConnector [false]之外,一切看起来都很好。
那么APR实际上有用吗?
我在相关文档中找不到任何信息:
https://tomcat.apache.org/tomcat-8.0-doc/config/http.html#SSL_Support