![](/img/trans.png)
[英]I can't access Jenkins at http://localhost:8080 with Docker on MacOS
[英]I can reach from browser “http://localhost:8080/” but not “my_private_ip:8080/”
我在家庭作業局域網中,Macintosh(Mac OS X El Capitan 10.11.4)的專用IP為192.168.1.9,防火牆關閉。 當我嘗試從http://192.168.1.9:8080/ google訪問它時,我已經在“ http:// localhost:8080 / ”上運行了一個wildfly 10 web項目,直到我從本地主機訪問該項目為止一切正常。 chrome告訴我:
This site can’t be reached
192.168.1.9 refused to connect.
Search Google for 192 168 8080
ERR_CONNECTION_REFUSED
我需要從外部移動設備訪問它,但是如果我什至不能從計算機本身的IP從自己的計算機訪問它,則很難傳遞給移動設備...
奇怪的是,我還在端口80上監聽了MAMP Apache端口,實際上“ http:// localhost / ”和“ http://192.168.1.9/ ”都可以正常工作(向我展示了默認的MAMP“ www /index.php”)。
如果要從eclipse設置IP,則應遵循以下步驟(由於設置了-b選項,因此從eclipse更改文件standalone.xml中的IP無效,請參見下文...)
這些是在eclipse上進行配置的步驟:
Open Launch Configuration
Always update arguments related to the runtime
的“ Always update arguments related to the runtime
,然后使用your_private_ip更改-b
選項(如果刪除選項-b localhost
,則可以直接從standalone.xml
文件中對其進行配置,請參閱以下部分進行配置) 2.
解決方案,請選中“ Listen on all interfaces to allow remote web connections
”框Listen on all interfaces to allow remote web connections
standalone.xml
配置 另一種方法是在standalone.xml
的interfaces部分中配置。
更改:
<interfaces>
<interface name="management">
<inet-address value="127.0.0.1"/>
</interface>
<interface name="public">
<inet-address value="127.0.0.1"/>
</interface>
</interfaces>
至:
<interfaces>
<interface name="management">
<!-- Use the IPv4 wildcard address -->
<any-ipv4-address/>
</interface>
<interface name="public">
<!-- Use the IPv4 wildcard address -->
<any-ipv4-address/>
</interface>
</interfaces>
或只需將127.0.0.1替換為您的專用IP
另一種選擇是直接從命令行運行它。 默認情況下,jboss / wildfly綁定到本地主機,如果要更改此設置,可以執行:
standalone.sh -b 0.0.0.0
偵聽計算機的所有IP地址(如果是多宿主的)
或者,如果您想在IP上收聽:
standalone.sh -b your_private_ip
參考:
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.