How to specify the bind address for a JBoss EAP server ?

Solution Verified - Updated -

Environment

  • Red Hat JBoss Enterprise Application Platform (EAP)
    • 4
    • 5
    • 6
    • 7

Issue

  • Application can be accessed via http://localhost:8080/ only, and a remote client cannot connect to the server.
  • Why is the resource showing up as localhost in JBoss Operations Network (JON)?
  • How do I get EAP to use the hostname instead of localhost?
  • Binding the JBoss with IP-Address is not working. How to expose the business-central URL with server name/IP instead of localhost?
  • To start JBoss with hostname instead of IP, how should I add the option -b and -bmanagement in domain.conf file in JBoss EAP 6.x?
  • How to access a published web service with server IP address?
  • How to configure remote access (on network) to management console 9990 in JBoss EAP 6?
  • Web Applicaiton hosting on JBoss in RHEL6system. I copied the war file at server location /home/test/server/standalone/deployments. Then I started the JBoss and console server logs are also fine. When I tried this command wget http://localhost:8080 in the Linux server, it show be default page index.html but I tried with URL http://<IP>:8080 from the browser outside the Linux server then it shows me nothing.
  • We installed JBoss EAP 7. From the logs we see that Admin console is listening on loopback address (127.0.0.1) instead of IP Address. Upon research I see that we have to modify the standalone.xml with hostname/IP address for the management interface. What is the workaround so that admin console is listening on IP address instead of loopback address.

Resolution

Set the bind address for JBoss EAP using one of the following methods:

For EAP 6/7:

Standalone mode:

  • Start server with -b (bind-address) option, eg.:

    ./standalone.sh -c myconfiguration -b <IP address or host name>
    

    To set the bind address for Management Console, use -bmanagement as well:

    ./standalone.sh -c myconfiguration -b <IP address or host name> -bmanagement <IP address or host name>
    
  • Start server with -Djboss.bind.address=<hostname or IP_address>, eg.:

    ./standalone.sh -c myconfiguration -Djboss.bind.address=<IP address or host name>
    

    To set the bind address for Management Console, use -Djboss.bind.address.management as well:

    ./standalone.sh -c myconfiguration -Djboss.bind.address=<IP address or host name> -Djboss.bind.address.management=<IP address or host name>
    

Domain mode:

  • Similar for domain mode. Use ./domain.sh startup file.

For EAP 5 and EAP 4:

  • Start server with -b (bind-address) option.

    ./run.sh -c myconfiguration -b <IP address or host name>
    
  • Start server with -Djboss.bind.address=<hostname or IP_address> option.

    ./run.sh -c myconfiguration -Djboss.bind.address=<IP address or host name>
    
  • Add the environment variable JBOSS_HOST,

    JBOSS_HOST= <IP address or host name>
    

    In Windows set this variable in run.bat. In a Unix or Linux environment set this in the profile's run.conf at $JBOSS_HOME/server/<profile>/run.conf.

  • If using a System V init script, this value can be set using the configuration variable JBOSS_IP found in /etc/jbossas/jbossas.conf.

Root Cause

If no bind address is provided in the JBoss EAP configuration or startup script, the JBoss EAP server will listen for connections on localhost or 127.0.0.1.

Diagnostic Steps

The boot.log contains a ServerInfo entry showing the current value being used for jboss.bind.address and bind.address.

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

3 Comments

I do not see references to 'JBOSS_IP' in the scripts packaged with jboss-eap-6.3. Are there alternate scripts available?

I have a bind address of 0.0.0.0, but only localhost works, anything else gets site is unavailable.

A bind address of 0.0.0.0 only indicates that the listener should use all available interfaces. This does not address any network firewall or routing issues that handle how or if network packets are allowed to the interface that the listener is using.

This solution is only about setting the bind address. If you are having issues with connectivity, it may be necessary for your to open a support case so that someone can look at your specific routes. The knowledgebase also has helpful solutions and articles on how to diagnose network listener and firewall issues. However, I did not see anything specific to the message site is unavailable this does seem similar to connection refused or host unreachable.