如何在WildFly中更改默认端口8080 [英] How to change default port 8080 in WildFly
问题描述
我刚开始使用WildFly 8.2开发JAVA EE.我的第一个问题是如何将默认端口8080更改为其他端口?
I just started JAVA EE development with WildFly 8.2. My first problem is how to change the default port 8080 to something else?
我发现许多包含以下行的xml文件.
I found many xml files containing below line.
<socket-binding name="http" port="${jboss.http.port:8080}"/>
但是我想我不必全部更改?!
but I guess I don't have to change all of them?!
推荐答案
在standalone.xml文件中,查找以下元素:
In your standalone.xml file, look for this element:
<socket-binding-group name="standard-sockets" default-interface="public" port-offset="${jboss.socket.binding.port-offset:0}">
port-offset属性使您可以通过添加指定的数字来修改wildfly使用的所有端口.
The port-offset attribute lets you modify all the ports wildfly uses, by adding the number you specify.
例如,默认值是0
,这意味着http端口将是8080
,远程处理4447
,等等.
For example, the default value is 0
, which means that http port will be 8080
, remoting 4447
, etc.
如果您使用${jboss.socket.binding.port-offset:100}
,则http端口将是8180 (8080+100)
,远程处理4547 (4447+100)
,等等.
If you use ${jboss.socket.binding.port-offset:100}
, http port will be 8180 (8080+100)
, remoting 4547 (4447+100)
, etc.
因此,您无需更改偏移量.
So you need to change the offset, nothing else.
You can also do this by using a system property at startup, check http://www.mastertheboss.com/jboss-server/jboss-configuration/configuring-port-offset-on-jboss-as-wildfly
这篇关于如何在WildFly中更改默认端口8080的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!