I am in my homework LAN, the private IP of my Macintosh (Mac OS X El Capitan 10.11.4) is 192.168.1.9 and my Firewall is OFF. I have run a wildfly 10 web project on "http://localhost:8080/" until I access to that project from the localhost everything works fine, when I try to reach it from http://192.168.1.9:8080/ google chrome tell me:
This site can’t be reached
192.168.1.9 refused to connect.
Search Google for 192 168 8080
ERR_CONNECTION_REFUSED
I need to access it from an external mobile device but if I can not even access it from my own computer from the IP of the computer itself it's hard to thing to pass to the mobile device...
The strange thing is that I also have MAMP Apache port listening on port 80, and in fact both "http://localhost/" and "http://192.168.1.9/" works perfectly fine (showing me the defaul MAMP "www/index.php").
If you want to set the IP from eclipse you should follow these steps (changing the IP in the file standalone.xml doesn't work from eclipse because of the -b option which is set, see more below...)
This are the steps to configure it on eclipse:
Open Launch Configuration
Always update arguments related to the runtime
and then change your -b
option with your_private_ip (if you remove the option, -b localhost
you could configure it directly from the standalone.xml
file, see the section below for configuring it)
2.
solution, check the box Listen on all interfaces to allow remote web connections
standalone.xml
An alternative is configure in standalone.xml
the interfaces section.
Change:
<interfaces>
<interface name="management">
<inet-address value="127.0.0.1"/>
</interface>
<interface name="public">
<inet-address value="127.0.0.1"/>
</interface>
</interfaces>
to:
<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>
Or simply replace 127.0.0.1 with your private IP
Another alternative is running it directly from command line. By default jboss/wildfly binding to localhost, if you want change this, you can execute:
standalone.sh -b 0.0.0.0
listen on all IP addresses of the machine (if multihomed)
or if you want to listen on your ip:
standalone.sh -b your_private_ip
Ref: