Enterprise Java

Bind WildFly to a different IP address, or all addresses on multihomed

InterfaceĀ is a logical name, in WildFly parlance, for a network interface/IP address/host name to which sockets can be bound.Ā There are two interfaces:Ā ā€œpublicā€Ā and ā€œmanagementā€.

The ā€œpublicā€ interface binding is used for allĀ application related network communication (i.e. Web, Messaging, etc). The ā€œmanagementā€ interface is used for all components and services that are required by the management layer (i.e. the HTTP Management Endpoint).

By default, ā€œpublicā€ interfaceĀ isĀ configured to listen on the loopback address of 127.0.0.1. So if you start WildFly as:

./bin/standalone.sh

ThenĀ WildFly default page can be accessed as http://127.0.0.1:8080. Usually, /etc/hosts provide a mapping of 127.0.0.1 to localhost, and so the same page is accessible at http://localhost:8080. 8080 is the portĀ where all applications are accessed.

On a multihomed machine, you may like toĀ start WildFly and bind ā€œpublicā€ interface to a specific IP address. This can be easily done as:

./bin/standalone.sh -b=192.168.1.1

Now the applications can be accessed at http://192.168.1.1:8080.

For compatibility, -b 192.168.1.1 is also supported but -b=192.168.1.1 is recommended.

Or, if you want to bind to allĀ available IP addresses, then you can do:

./bin/standalone.sh -b=0.0.0.0

Similarly, by default,Ā WildFly can be managed using Admin Console at http://127.0.0.1:9990.Ā 9990 is the management port.

WildFly ā€œmanagementā€ interface can be bound to a specific IP address as:

./bin/standalone.sh -bmanagement=192.168.1.1

Now AdminĀ Console can be accessed at http://192.168.1.1:9990.

Or, bind ā€œmanagementā€ interface to all available IP addresses as:

./bin/standalone.sh -bmanagement=0.0.0.0

You can also bind to two specific addresses as explained here.

Of course, you can bind WildFly ā€œpublicā€ and ā€œmanagementā€ interface together as:

./bin/standalone.sh -b=0.0.0.0 -bmanagement=0.0.0.0

Learn more about it Interface and Port Configuration in WildFly. And more about these switches in Controlling the Bind Address with -b.

Arun Gupta

Arun is a technology enthusiast, avid runner, author of a best-selling book, globe trotter, a community guy, Java Champion, JavaOne Rockstar, JUG Leader, Minecraft Modder, Devoxx4Kids-er, and a Red Hatter.
Subscribe
Notify of
guest

This site uses Akismet to reduce spam. Learn how your comment data is processed.

0 Comments
Oldest
Newest Most Voted
Back to top button