[[Undertow_AJP_listeners]]
= AJP listeners

ifdef::env-github[]
:tip-caption: :bulb:
:note-caption: :information_source:
:important-caption: :heavy_exclamation_mark:
:caution-caption: :fire:
:warning-caption: :warning:
endif::[]

The AJP listeners are child resources of the subsystem undertow. They
are used with mod_jk, mod_proxy and mod_cluster of the Apache httpd
front-end. Each listener does reference a particular socket binding:

[source,options="nowrap"]
----
[standalone@localhost:9999 /] /subsystem=undertow/server=default-server:read-children-names(child-type=ajp-listener)
{
    "outcome" => "success",
    "result" => [
        "ajp-listener",
    ]
}

[standalone@localhost:9999 /] /subsystem=undertow/server=default-server/ajp-listener=*:read-resource(recursive=true)
{
    "outcome" => "success",
    "result" => {
        "enabled" => "true",
        "scheme" => "http",
        "socket-binding" => "ajp",
    }
}
----

Creating a new `ajp-listener` requires you to declare a new
`socket binding` first:

[source,options="nowrap"]
----
[standalone@localhost:9999 /] /socket-binding-group=standard-sockets/socket-binding=ajp:add(port=8009)
----

The newly created, unused socket binding can then be used to create a
new connector configuration:

[source,options="nowrap"]
----
[standalone@localhost:9999 /] /subsystem=undertow/server=default-server/ajp-listener=myListener:add(socket-binding=ajp, scheme=http, enabled=true)
----
