解决JBoss只能通过localhost访问不能通过IP的问题

解决JBoss只能通过localhost访问不能通过IP的问题

前序

现在EJB是真的有点落伍了么,网上找点资料都挺难的样子,而且都是很久的了。。好吧,最近对EJB有点兴趣学习一下,结果下载到服务器启动后,居然不能直接通过服务器IP访问,也是醉了,默认只能通过本地localhost进行访问。如果需要远程访问,就要修改配置文件了。

软件版本:wildfly-10.1.0.Final。是的,连jboss名都改了,这个好像真不咋样。

修改配置文件

编辑${JBOSS_HOME}/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>
</interfaces>

 

将其中的127.0.0.1改为服务器的ip地址即可,修改后的样子:

<interfaces>
         <interface name="management">
             <inet-address value="${jboss.bind.address.management:192.168.1.2}"/>
        </interface>
         <interface name="public">
             <inet-address value="${jboss.bind.address:192.168.1.2}"/>
         </interface>
</interfaces>