一般情况下
在JBoss7.1.1.Final版本中配置standalone/configuration/standalone.xml
<interfaces>里面name为public的<interface>配置成<inet-address value=”${jboss.bind.address:0.0.0.0}”/>就可以了
<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:0.0.0.0}"/> </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> <socket-binding-group name="standard-sockets" default-interface="public" port-offset="${jboss.socket.binding.port-offset:0}"> <socket-binding name="management-native" interface="management" port="${jboss.management.native.port:9999}"/> <socket-binding name="management-http" interface="management" port="${jboss.management.http.port:9990}"/> <socket-binding name="management-https" interface="management" port="${jboss.management.https.port:9443}"/> <socket-binding name="ajp" port="8009"/> <socket-binding name="http" port="8082"/> <socket-binding name="https" port="8443"/> <socket-binding name="osgi-http" interface="management" port="8090"/> <socket-binding name="remoting" port="4447"/> <socket-binding name="txn-recovery-environment" port="4712"/> <socket-binding name="txn-status-manager" port="4713"/> <outbound-socket-binding name="mail-smtp"> <remote-destination host="localhost" port="25"/> </outbound-socket-binding> </socket-binding-group>
执行./bin/standalone.sh启动JBoss服务,通过这样子配置后一般来说都外网内网都可以访问了,但是天翼云有4个端口(80、8080、443、8443)需要备案才能使用,导致外网无法访问。所以下次遇到这种问题的时候可以先尝试使用8082或其它端口。
本文永久更新链接地址:http://www.linuxidc.com/Linux/2017-06/145068.htm