16.3.5. Configure JBoss EAP 6 to Accept Requests From an External HTTPD

Overview

JBoss EAP 6 does not need to know which proxy it is accepting requests from, only the port and protocol to look for. This is not true of mod_cluster, which is more tightly coupled to the configuration of JBoss EAP 6. But the following task works for mod_jk, mod_proxy, ISAPI, and NSAPI. Substitute the protocols and ports you need to configure with the ones in the examples.

To configure JBoss EAP 6 for mod_cluster, refer to Section 16.5.5, “Configure a mod_cluster Worker Node”.

Prerequisites

Procedure 16.3. Edit Configuration and add Socket Bindings

  1. Configure the jvmRoute and useJK system properties.

    By default, the jvmRoute is set to the same value as the server name. If you need to customize it, you can use a command like the following. Replace or remove the /profile=ha portion of the command, depending on which profile you use or whether you use a standalone server. Replace the string CUSTOM_ROUTE_NAME with your custom jvmRoute name.
    [user@localhost:9999 /] /profile=ha/subsystem=web:write-attribute(name="instance-id",value="CUSTOM_ROUTE_NAME")
    Enable the useJK value by setting it to true by using the following command:
    [user@localhost:9999 /] /system-property=UseJK/:add(value=true)
  2. List the connectors available in the web subsystem.

    Note

    This step is only necessary if you are not using the standalone-ha.xml configuration for a standalone server, or the ha or full-ha profiles for a server group in a managed domain. Those configurations already include all of the necessary connectors.
    In order for an external HTTPD to be able to connect to JBoss EAP 6's web server, the web subsystem needs a connector. Each protocol needs its own connector, which is tied to a socket group.
    To list the connectors currently available, issue the following command:
    [standalone@localhost:9999 /] /subsystem=web:read-children-names(child-type=connector)
    If there is no line indicating the connector your need (HTTP, HTTPS, AJP), you need to add the connector.
  3. Read the configuration of a connector.

    To see the details of how a connector is configured, you can read its configuration. The following command reads the configuration of the AJP connector. The other connectors have similar configuration output.
    [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
        }
    }		
    
    
  4. Add the necessary connectors to the web subsystem.

    To add a connector to the web subsystem, it needs to have a socket binding. The socket binding is added to the socket binding group used by your server or server group. The following steps assume that your server group is server-group-one and that your socket binding group is standard-sockets.
    1. Add a socket to the socket binding group.

      To add a socket to the socket binding group, issue the following command, replacing the protocol and port with the ones you need.
      [standalone@localhost:9999 /] /socket-binding-group=standard-sockets/socket-binding=ajp:add(port=8009)
    2. Add the socket binding to the web subsystem.

      Issue the following command to add a connector to the web subsystem, substituting the socket binding name and protocol with the ones you need.
      [standalone@localhost:9999 /] /subsystem=web/connector=ajp:add(socket-binding=ajp, protocol="AJP/1.3", enabled=true, scheme="http")