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

编程入门 行业动态 更新时间:2024-10-25 09:28:00
本文介绍了如何更改 WildFly 中的默认端口 8080的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我刚刚开始使用 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,remoting4447等

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.

您也可以通过在启动时使用系统属性来做到这一点,检查 www.mastertheboss/jboss-server/jboss-configuration/configuring-port-offset-on-jboss-as-wildfly

You can also do this by using a system property at startup, check www.mastertheboss/jboss-server/jboss-configuration/configuring-port-offset-on-jboss-as-wildfly

更多推荐

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

本文发布于:2023-08-07 03:43:16,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1316777.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:端口   如何更改   WildFly

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!