2
votes

I have the following AJP connector setup in Tomcat:

<Connector port="8009" protocol="AJP/1.3" redirectPort="8443" />

Apache then handles the TLS. However I would like to enable HTTP/2, so I tried this in the Apache .conf file:

Protocols h2 http/1.1

Firefox and my own speed tests indicate that the connection is still running under http/1.1 though.

If I ditch Apache and use Tomcat directly:

<Connector port="8443" protocol="org.apache.coyote.http11.Http11AprProtocol"
               maxThreads="150"
               SSLEnabled="true"
               compression="on" >
        <UpgradeProtocol className="org.apache.coyote.http2.Http2Protocol" />
        <SSLHostConfig>
            <Certificate certificateKeyFile="private.key"
                         certificateFile="public.pem"
                          />
        </SSLHostConfig>
    </Connector>

The speed increase is significant, and Firefox reports HTTP/2.

Is the AJP connector preventing Apache serving up HTTP/2, or is there something else missing from my configuration?

Happy to continue with just Tomcat, but I'd like to compare the two like for like.

Incidentally, this logline from APR makes me wonder how much work APR is actually doing in this configuration (useAprConnector [false]):

org.apache.catalina.core.AprLifecycleListener.lifecycleEvent APR/OpenSSL configuration: useAprConnector [false], useOpenSSL [true]
1

1 Answers

0
votes

first of all, compile apache httpd you must include this --enable-http2

like this

sudo ./configure --prefix=/usr/local/apache --enable-http2

In file httpd.conf you must add this line

Protocols h2 h2c http/1.1

apache httpd use http 2.0 via AJP port, the tomcat also http 2.0

This I Login on httpd 2.0 and via AJP port to communicate with tomcat