Enabling the Apache JServ Protocol Connector in Tomcat

Enabling the Apache JServ Protocol Connector in Tomcat

The Apache Tomcat version installed with FlexNet Code Insight 2020 R2 or 6.14.1 (and later) provides the Apache JServ Protocol (AJP) connector, which is disabled by default at installation. Although FlexNet Code Insight does not require this connector, you might need it to support a Tomcat load-balancing scenario for your Code Insight environment. The following sections describe how to manually enable and disable the APJ connector as needed.

Enabling the Apache AJP Connector

The following method enables the Apache AJP connector so that it starts with security enabled.

  1. Open the Tomcat server.xml file in a text editor:

    On Windows, open {CODEINSIGHT_ROOT_DIR}\tomcat\conf\server.xml.
    On Linux, open /etc/tomcat9/server.xml.

  2. Search for the string 8009 to locate the following line in the server.xml file:

    <Connector port="8009" redirectPort="8443" protocol="AJP/1.3"/>
  3. Update the line with these new attributes (highlighted):

    <Connector port="8009" protocol="AJP/1.3" secretRequired="true" redirectPort="8443" secret="<string>"/>

    The following explains the new attributes:

    secretRequired=“true”—When set to true, indicates that AJP connector will start only if the secret attribute is included and defined with a proper value (see below). The true value is strongly recommended to ensure that the connector is accessed only by workers in the load-balancing cluster that provide the secret value.

    secret= “<string>”—Any string value that is non-null and has a non-zero length. Workers in the load-balancing cluster must provide this same string when making requests; otherwise, their requests are rejected.

  4. Save the file.
  5. Restart the Apache Tomcat service. (For assistance, see “Starting and Stopping Tomcat” in the FlexNet Code Insight Installation and Configuration Guide.)

Disabling the Apache AJP Connector

The following procedure disables the Apache AJP connector.

  1. Open the Tomcat server.xml file in a text editor:

    On Windows, open {CODEINSIGHT_ROOT_DIR}\tomcat\conf\server.xml.
    On Linux, open /etc/tomcat9/server.xml.

  2. Search for the string 8009, and comment out the line about APJ protocol, as shown:

    <!-- <Connector port="8009" protocol="AJP/1.3" secretRequired="true" redirectPort="8443" secret="string"/> -->
  3. Save the file.
  4. Restart the Apache Tomcat service. For assistance, refer to either of the following:

    For Code Insight 7.x, “Starting and Stopping Tomcat” in the FlexNet Code Insight Installation and Configuration Guide.
    For Code Insight 6.x, "Administration: Starting and Stopping Servers" in the FlexNet Code Insight Installation and System Administration Guide.
Was this article helpful? Yes No
No ratings
Version history
Revision #:
8 of 8
Last update:
‎Jun 08, 2020 02:12 PM
Updated by:
 
Contributors