且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在WildFly中更改默认端口8080

更新时间:2023-01-17 22:16:45

在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