默认情况下只允许本地访问JBOSS,为了能让局域网其他同事访问或是公网能访问,可以简单做以下配置即可实现访问。
1.打开D:\jboss\standalone\configuration下standalone.xml文件
找到
<interfaces>
<interface name="management">
<inet-address value="${jboss.bind.address.management:127.0.0.1}"/>
</interface>
<interface name="public">
<inet-address value="${jboss.bind.address:127.0.0.1}"/>
</interface>
<!-- TODO - only show this if the jacorb subsystem is added -->
<interface name="unsecure">
<!--
~ Used for IIOP sockets in the standard configuration.
~ To secure JacORB you need to setup SSL
-->
<inet-address value="${jboss.bind.address.unsecure:127.0.0.1}"/>
</interface>
</interfaces>
在interfaces添加中添加
<interface name="any"> <any-ipv4-address/> </interface>
成为:
<interfaces>
<interface name="management">
<inet-address value="${jboss.bind.address.management:127.0.0.1}"/>
</interface>
<interface name="public">
<inet-address value="${jboss.bind.address:127.0.0.1}"/>
</interface>
<!-- TODO - only show this if the jacorb subsystem is added -->
<interface name="unsecure">
<!--
~ Used for IIOP sockets in the standard configuration.
~ To secure JacORB you need to setup SSL
-->
<inet-address value="${jboss.bind.address.unsecure:127.0.0.1}"/>
</interface>
<interface name="any">
<any-ipv4-address/>
</interface>
</interfaces>
第二步:找到
<socket-binding-group name="standard-sockets" default-interface="public" port-offset="${jboss.socket.binding.port-offset:0}">
修改default-interface=”public”中的public为any
如下代码所示:
<socket-binding-group name="standard-sockets" default-interface="any" port-offset="${jboss.socket.binding.port-offset:0}">
第三步:双击D:\jboss\bin下的standalone.bat文件,然后在浏览器中输入局域网IP:8080进行访问是否成功。
