Dave Dave - 3 months ago 76
HTTP Question

How do I activate the AJP port on Wildfly 11?

I just installed Wildfly 11.0.0.Final on Amazon Linux with Java 8. How do I activate the AJP port in the $JBOSS_HOME/standalone/configuration/standalone.xml file ? I have the following configured for my socket bindings ...

<socket-binding-group name="standard-sockets" default-interface="public" port-offset="${jboss.socket.binding.port-offset:0}">
<socket-binding name="management-http" interface="management" port="${jboss.management.http.port:9990}"/>
<socket-binding name="management-https" interface="management" port="${jboss.management.https.port:9993}"/>
<socket-binding name="ajp" port="8009"/>
<!-- <socket-binding name="ajp" port="${jboss.ajp.port:8009}"/> -->
<socket-binding name="http" port="${jboss.http.port:8081}"/>
<socket-binding name="https" port="${jboss.https.port:8443}"/>
<socket-binding name="txn-recovery-environment" port="4712"/>
<socket-binding name="txn-status-manager" port="4713"/>
<outbound-socket-binding name="mail-smtp">
<remote-destination host="localhost" port="25"/>

However when I restart my server, although I'm able to connect to the http port, I can't connect to the AJP port ...

[myuser@mymachine ~]$ telnet localhost 8081
Connected to localhost.
Escape character is '^]'.
HTTP/1.1 400 Bad Request
Content-Length: 0
Connection: close

Connection closed by foreign host.
[myuser@mymachine ~]$ telnet localhost 8009
telnet: connect to address Connection refused

What else do I need to do to activate my AJP port on Wildfly 11?

Answer Source

You'll need to activate it. See AJP Listeners for a bit more detail but the short answer is that you need to enable it:

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

This uses jboss-cli.sh to enable it. In this case myListener is whatever name you want. This will add an entry in the undertow section of standalone.xml that enables the listener. You'll need to restart to have this take affect.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download