3.2. Configuring JBoss Enterprise Application Platform to Work with mod_jk


3.2.1. Configuring the Web Subsystem

A web subsystem configuration requires individual configuration of the following:
  • The Basic Configuration
  • Connector Configuration
  • Virtual Server Configuration

3.2.1.1. Basic Configuration

The basic configuration steps listed are prerequisites to a web system configuration.

Procedure 3.3. Basic Configuration for a Web Subsystem

  1. Configure the Required Extension

    Add an entry to the configuration file to add the required extension, as follows:
    <extension module="org.jboss.as.web" />
    Copy to Clipboard Toggle word wrap
  2. Configure the Subsystem

    Configure the basic information for your subsystem. The following is a sample subsystem configuration:
    <subsystem xmlns="urn:jboss:domain:web:1.0" 
    	   default-virtual-server="default-host">
    	<connector name="http" 
    	           scheme="http" 
                       protocol="HTTP/1.1" 
    	           socket-binding="http"/>
    	<virtual-server name="default-host" 
    		        enable-welcome-root="true">
    		<alias name="localhost" />
    		<alias name="example.com" />
    	</virtual-server>
    </subsystem>
    Copy to Clipboard Toggle word wrap
For further information about the configuration elements and attributes used in the supplied example configuration, refer to the web subsystem page.

3.2.1.2. Configuring Connectors

Connectors are a child resource for the subsystem. The following is a list of valid connectors that can be configured using the new socket binding:
  • HTTP Connectors.
  • HTTPS Connectors.
  • AJP Connectors.
  • Native Connectors.
Each connector must reference an available socket binding. As a result, the steps to create a new socket binding for each connector type is listed before the configuration information for each of the valid connector types.
For details about connector attributes, refer to the connectors page.
3.2.1.2.1. Configuring HTTP Connectors
HTTP connectors are the default connector and the simplest to configure. They operating using port 8080.

Procedure 3.4. Configure HTTP Connectors

  1. Create a New Socket Binding

    Use the following configuration to create a new socket binding to use when creating a HTTP connector:
    [standalone@localhost:9999 /] /socket-binding-group=standard-sockets/socket-binding=custom:add(port=8181)
    Copy to Clipboard Toggle word wrap
  2. Configure the HTTP Connector

    The following is an example of a HTTP connector configuration:
    [standalone@localhost:9999 /] /subsystem=web/connector=test-connector:add(socket-binding=custom,scheme=http,protocol="HTTP/1.1",enabled=true)
    Copy to Clipboard Toggle word wrap
3.2.1.2.2. Configuring HTTPS Connectors
HTTPS connectors, unlike HTTP connectors, use Java Secure Socket Extension (JSSE) as a default.

Procedure 3.5. Configure HTTPS Connectors

  1. Create a New Socket Binding

    Use the following configuration to create a new socket binding to use when creating a HTTPS connector:
    [standalone@localhost:9999 /] /socket-binding-group=standard-sockets/socket-binding=https:add(port=8443)
    Copy to Clipboard Toggle word wrap
  2. Use the Socket Binding to Create a New HTTPS Connector

    Use the following configuration to create a new HTTPS connector with an unused socket binding:
    [standalone@localhost:9999 /] /subsystem=web/connector=test-connector:add(socket-binding=https, scheme=https, protocol="HTTP/1.1", enabled=false, secure = true)
    Copy to Clipboard Toggle word wrap
  3. Add the SSL Configuration

    Use the following configuration to add the SSL configuration for a HTTP connector:
    /subsystem=web/connector=test-connector/configuration=ssl:add
    Copy to Clipboard Toggle word wrap

    Note

    The specified configuration uses the default SSL configuration. For JSSE, use the key stored in the location ${user.home}/.keystore and the default password changeit. No default configuration is available for OpenSSL. As a result, the configuration=ssl element must be configured correctly for use with OpenSSL. For further information, refer to the SSL documentation.
  4. Enable the Connector

    Use the following configuration to enable the connector:
    /subsystem=web/connector=test-connector:write-attribute(name=enabled, value=true)
    Copy to Clipboard Toggle word wrap
  5. Activate the New Configuration

    Use the following command to reload the server and activate the new configuration:
    :reload
    Copy to Clipboard Toggle word wrap
3.2.1.2.3. Further Information About mod_jk
For further information about mod_jk, refer to the JBoss Enterprise Application Platform Administration and Configuration Guide's Apache mod_jk chapter.
3.2.1.2.4. Configuring AJP Connectors
The following procedure outlines the steps to creating and configuring a new AJP connector:

Procedure 3.6. Configure AJP Connectors

  1. Create a New Socket Binding

    Use the following configuration to create a new socket binding to use when creating an AJP connector:
    [standalone@localhost:9999 /] /socket-binding-group=standard-sockets/socket-binding=ajp:add(port=8009)
    Copy to Clipboard Toggle word wrap
  2. Use a Socket Binding to Create a New AJP Connector

    Use the following configuration to create a new AJP connector with an unused socket binding:
    [standalone@localhost:9999 /] /subsystem=web/connector=ajp:add(socket-binding=ajp, protocol="AJP/1.3", enabled=true, scheme="http")
    Copy to Clipboard Toggle word wrap
  3. Configure the AJP Connector

    The following is an example of an AJP connector configuration:
    [standalone@localhost:9999 /] /subsystem=web:read-children-names(child-type=connector)
    {
        "outcome" => "success",
        "result" => [
            "ajp",
            "http"
        ]
    }
    [standalone@localhost:9999 /] /subsystem=web/connector=ajp:read-resource(recursive=true)
    {
        "outcome" => "success",
        "result" => {
            "enable-lookups" => false,
            "enabled" => true,
            "max-post-size" => 2097152,
            "max-save-post-size" => 4096,
            "protocol" => "AJP/1.3",
            "redirect-port" => 8443,
            "scheme" => "http",
            "secure" => false,
            "socket-binding" => "ajp",
            "ssl" => undefined,
            "virtual-server" => undefined
        }
    }
    Copy to Clipboard Toggle word wrap
3.2.1.2.5. Configuring Native Connectors
Native connectors are high performance connectors based on Apache Tomcat Native.
The following procedure outlines the steps to creating and configuring a new native connector:

Procedure 3.7. Configure Native Connectors

  1. Configure the Native Connector

    The following is an example of a native connector configuration:
    [standalone@localhost:9999 /] /subsystem=web/connector=https:read-resource(recursive=true)
    {
        "outcome" => "success",
        "result" => {
            "protocol" => "HTTP/1.1",
            "scheme" => "https",
            "secure" => true,
            "socket-binding" => "https",
            "ssl" => {
                "certificate-file" => "/home/jfclere/CERTS/SERVER/newcert.pem",
                "certificate-key-file" => "/home/jfclere/CERTS/SERVER/newkey.pem",
                "password" => "xxxxxxx"
            },
            "virtual-server" => undefined
        }
    }
    Copy to Clipboard Toggle word wrap
  2. Configure the SSL Information

    In the provided example, configure the SSL information required.

3.2.1.3. Configuring Virtual Servers

Virtual servers declarations are child resources for the web subsystem. Virtual servers can be referred to using a defined alias and can also refer to a default web application.
Adding a Virtual Server Declaration

A virtual-server can be declared using the default :add() operation, as follows:

[standalone@localhost:9999 /] /subsystem=web/virtual-server=example.com:add
Copy to Clipboard Toggle word wrap
Removing a Virtual Server Declaration

A virtual-server can be declared using the default :remove() operation, as follows:

[standalone@localhost:9999 /] /subsystem=web/virtual-server=example.com:remove
Copy to Clipboard Toggle word wrap
Virtual-Server Sample Configuration

The following is a sample configuration for the virtual-server element:

[standalone@localhost:9999 /] /subsystem=web:read-children-names(child-type=virtual-server)
{
    "outcome" => "success",
    "result" => ["localhost"]
}
 
[standalone@localhost:9999 /] /subsystem=web/virtual-server=default-host:read-resource
{
    "outcome" => "success",
    "result" => {
        "access-log" => undefined,
        "alias" => ["example.com"],
        "default-web-module" => undefined,
        "enable-welcome-root" => true,
        "rewrite" => undefined
    }
}
Copy to Clipboard Toggle word wrap
For details about the virtual-server configuration attributes, refer to the virtual-server page.

3.2.1.4. Querying Connectors

Connectors can be queried to reveal specific statistical information.
Querying Example

The following is an example of a query that seeks the bytesSent and requestCount attributes:

[standalone@localhost:9999 /] /subsystem=web/connector=http:read-attribute(name=bytesSent, name=requestCount)
{
    "outcome" => "success",
    "result" => "3"
}
Copy to Clipboard Toggle word wrap
Change the values of name in the above configuration to one of the listed connector attributes to query connectors for specific information.
Connector Attributes

The following table is a list of the connector attributes that can be queried.

Expand
Table 3.1. Connector Attributes
ValueDescription
bytesSentThe number of bytes sent by the connector.
bytesreceivedThe number of bytes received by the connector (POST data).
processingTimeThe processing time used by the connector in milliseconds.
errorCountThe number of errors that occur when requests sent by the connector are being processed.
maxTimeThe maximum amount of time to process a request.
requestCountThe number of requests processed by the connector.
Back to top
Red Hat logoGithubredditYoutubeTwitter

Learn

Try, buy, & sell

Communities

About Red Hat Documentation

We help Red Hat users innovate and achieve their goals with our products and services with content they can trust. Explore our recent updates.

Making open source more inclusive

Red Hat is committed to replacing problematic language in our code, documentation, and web properties. For more details, see the Red Hat Blog.

About Red Hat

We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

Theme

© 2025 Red Hat