如何在Wildfly 11上激活AJP端口?

时间:2017-11-29 14:03:58

标签: http configuration jboss wildfly ajp

我刚刚在带有Java 8的Amazon Linux上安装了Wildfly 11.0.0.Final。如何激活$ JBOSS_HOME / standalone / configuration / standalone.xml文件中的AJP端口?我为socket绑定配置了以下内容......

<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"/>
    </outbound-socket-binding>
</socket-binding-group>

然而,当我重新启动服务器时,虽然我能够连接到http端口,但我无法连接到AJP端口......

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

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

在Wildfly 11上激活我的AJP端口还需要做些什么?

1 个答案:

答案 0 :(得分:1)

你需要激活它。有关详细信息,请参阅AJP Listeners,但简短的回答是您需要启用它:

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

这使用jboss-cli.sh启用它。在这种情况下,myListener是您想要的任何名称。这将在standalone.xml的undertow部分中添加一个启用侦听器的条目。您需要重新启动才能生效。