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

Solution Verified - Updated -

Environment

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

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 host name 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 adrress?
  • 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.

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.

Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.