![](/img/trans.png)
[英]Accessing EJBs deployed in WildFly from an application running in Jboss5
[英]JBoss Application Server: Accessing deployed web application from another machine
我已將Web應用程序部署到Jboss
獨立應用程序服務器V7.1.1上。
但由於某種原因,我無法從同一網絡中的其他計算機訪問該應用程序。 服務器正在端口18080上運行。
我已經在同一台機器上運行的tomcat服務器上部署了相同的應用程序,我可以在其他機器上遠程訪問它。 tomcat的端口號:8080
為了驗證端口號是否有問題,我只是將tomcat 18080和Jboss
之間的端口號交換為8080,我可以從tomcat訪問應用程序,但是Jboss
無法訪問。 因此端口號沒有問題。
我已經看了一下Jboss
服務器standalone.xml
文件,並嘗試將socketBinding
元素的interface屬性更改為public,仍然沒有用。
socket-binding name="http" interface="public" port="18080"
任何人都可以告訴我需要做出哪些更改才能訪問部署在Jboss上的這些Web應用程序進行遠程訪問?
或者,您也可以使用JBoss啟動腳本和它的-b修飾符定義公共接口IP綁定。 例如:
綁定到特定IP:
./standalone.sh -b xxx.xxx.xxx.xxx
要綁定到所有IP:
./standalone.sh -b 0.0.0.0
默認行為僅綁定到localhost(127.0.0.1)。
在standalone.xml中進行以下更改。
<interfaces>
<interface name="management">
<inet-address value="${jboss.bind.address.management:127.0.0.1}"/>
</interface>
<interface name="public">
<any-ipv4-address/>
</interface>
<interface name="unsecure">
<inet-address value="${jboss.bind.address.unsecure:127.0.0.1}"/>
</interface>
</interfaces>
我得到了問題的解決方案,我確實忽略了standalone.xml,所以匆匆發布了一個問題。 無論如何,這對其他人來說真的很有幫助。
要使jboss服務器資源遠程可用,首先我們需要將interface屬性添加到soket-binding元素,如下所示:
<socket-binding name="http" interface="public" port="18080"/>
<socket-binding name="https" interface="public" port="18443"/>
步驟2:使用inet-address修改接口以獲得正確的IP地址。 XXX.XXX.XXX.XXX如下面的代碼片段所示
<interfaces>
<interface name="management">
<inet-address value="${jboss.bind.address.management:xxx.xxx.xxx.xxx}"/>
</interface>
<interface name="public">
<inet-address value="${jboss.bind.address:xxx.xxx.xxx.xxx}"/>
</interface>
<interface name="unsecure">
<inet-address value="${jboss.bind.address.unsecure:xxx.xxx.xxx.xxx}"/>
</interface>
</interfaces>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.