If your WildFly server is unable to accept remote connections then keep reading this tutorial, we will help you to solve the issue.
For security reasons, WildFly application server uses for its public and management interfaces, as fallback the loopback address:
<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>
This means, is you simply start WildFly without any additional parameter:
$ ./standalone.sh
Then, the server will be available only on the local machine (127.0.0.1) where it has been started.
So, a simple (and recommended) solution is to provide valid values for jboss.bind.address.management and jboss.bind.address:
$ ./standalone.sh -Djboss.bind.address.management=0.0.0.0 -Djboss.bind.address=0.0.0.0
If you want to set it as fallback, in the configuration, you can simply go for:
<interfaces> <interface name="management"> <inet-address value="${jboss.bind.address.management:0.0.0.0}"/> </interface> <interface name="public"> <inet-address value="${jboss.bind.address:0.0.0.0}"/> </interface> </interfaces>
Or even, without any fallback address:
<interface name="management"> <any-address/> </interface> <interface name="public"> <any-address/> </interface>
Warning! Making this application server’s network ports public is a significant security risk. You are strongly advised to only allow access to those ports from trusted networks. If, for development purposes, you need to access from outside of a trusted network, please do not allow access to those ports via a public IP address. Instead, use a secure channel such as a VPN or an SSH tunnel.
If you still cannot reach the WildFly server, please check whether your server is listening at that port with the following command:
sudo netstat -tlnp tcp 0 0 0.0.0.0:8050 0.0.0.0:* LISTEN 4670/java
To confirm that this is WildFly, execute:
pgrep -f jboss 4670
As you can see, both PID should match.
Hopefully, this will help you to solve the issue “Wildfly not accepting remote connections”