I wish to increase maxThreads for the ajp connector to 500, i notice that it has a redirect port 8443, so should I increase the maxThreads of connector on port 8443 as well?

<!-- Define a SSL HTTP/1.1 Connector on port 8443
     This connector uses the JSSE configuration, when using APR, the
     connector should be using the OpenSSL style configuration
     described in the APR documentation -->
<Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true"
           maxThreads="150" scheme="https" secure="true"
           clientAuth="false" sslProtocol="TLS" />

<!-- Define an AJP 1.3 Connector on port 8009 -->
<Connector port="8009" protocol="AJP/1.3" redirectPort="8443" maxThreads="500"/>
  • That connector is commented out so changing maxThreads wouldnt have any impact. – DD. Jan 20 '15 at 16:29

In any httpd + Tomcat setups I have worked with, we get rid of any of the HTTP connectors, contain the AJP connector to loopback and let it run without encryption. The goal is to let Tomcat do the Java application work and let httpd handle all of the HTTP services.

The only way the redirectPort would get used in the case of the AJP connector is if there is a web application (web.xml) containing a security-contraint having a user-data-constraint having a transport-guarantee set to CONFIDENTIAL.

At least in our case, it is rare for our applications to have such a construct defined. We typically handle the secure communications via httpd or the load balancer. Most of our applications require SSL at all times anyway due to the data displayed.

Updated response:

Here is a real baseline Tomcat configuration with the slight tweak to increase the connector's maxThreads to 500. It is configured only to listen for AJP/1.3 traffic on loopback (as well as for the shutdown port).

<?xml version='1.0' encoding='utf-8'?>

<Server port="8005" shutdown="SHUTDOWN">
  <Listener className="org.apache.catalina.core.JasperListener" />
  <Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener" />
  <Listener className="org.apache.catalina.mbeans.ServerLifecycleListener" />
  <Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />
  <Service name="Catalina">
    <Connector port="8009" protocol="AJP/1.3" address="" enableLookups="false" maxThreads="500" />
    <Engine name="Catalina" defaultHost="localhost">
      <Host name="localhost"  appBase="webapps"
            unpackWARs="true" autoDeploy="true"
            xmlValidation="false" xmlNamespaceAware="false">

On the httpd side, we have a proxy_ajp.conf file which we use to specifically map URL paths back to the Tomcat. Example:

LoadModule proxy_ajp_module modules/mod_proxy_ajp.so

ProxyPass /fooAppA/ ajp://localhost:8009/fooAppA/
ProxyPass /fooAppB/ ajp://localhost:8009/fooAppB/

ProxyPassReverse /fooAppA/ ajp://localhost:8009/fooAppA/
ProxyPassReverse /fooAppB/ ajp://localhost:8009/fooAppB/

The httpd.conf can be configured to use (and optionally force) SSL. But that is completely optional.

  • how to let it run without encryption? – user12145 Feb 10 '11 at 0:07
  • Unless you have web apps forcing CONFIDENTIAL transactions. everything should run in the clear by default. Our default tomcat configuration has no SSL configuration whatsoever. – Corey S. Feb 10 '11 at 1:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.