4 Replies Latest reply on Jul 31, 2008 2:41 PM by peterj

    JBoss binding only to localhost

    mbabauer

      I have been trying in vain to get JBoss to bind to something other than localhost. So far, the only documentation I have found mentions it in passing that 4.2GA and later has the behavior to only bind to localhost in an attempt to make people lock down the servers prior to making it publicly accessible.

      The problem is the docs I have found do not go into detail as to what you must change. I did find you can force-bind using the '-b' option on run.sh, but to me this is clumsy, and when I try it I get all sorts of errors from the JMS connectors when they try to connect.

      I just want to have JBoss listen to all interfaces, including localhost. Is this possible any longer? How do I do it?

        • 1. Re: JBoss binding only to localhost
          dimitris

          run -b 0.0.0.0

          • 2. Re: JBoss binding only to localhost
            mbabauer

             

            "dimitris@jboss.org" wrote:
            run -b 0.0.0.0


            Thanks! That did it!

            • 3. Re: JBoss binding only to localhost
              kyleyj

              I've also had the same issue and the suggestion works for me. However, I'm trying to understand what the option "-b 0.0.0.0" is doing. According to the Post-installation documentation(http://www.redhat.com/docs/en-US/JBoss_SOA_Platform/4.2.2/html/SOA_Getting_Started_Guide/SOA_Getting_Started_Guide-Post_Installation_Testing_and_Starting.html), in section 2.3 it seems that providing a service-binding.xml would allow for connections from other hosts than localhost.

              How does providing the -b 0.0.0.0 option affect the use of the service-binding.xml?

              Cheers,
              Kyley

              • 4. Re: JBoss binding only to localhost
                peterj

                The binding service brings all of the port definitions into a single file (without it, they ports are scattered all over the place). This makes it easier to define multiple sets of port configurations if you plan on running multiple instances of the app server on the same host - two instances cannot use the same ports because you get port conflicts.

                Alternately, if you have multiple IP addresses defined on you host (either with multiple network cards or youi have set up virtual IP addresses on a single card), you can run multiple app server instance by binding each ot its own IP address. Example:

                run -c config1 -b 192.168.0.100
                run -c config2 -b 192.168.0.101

                Thus, either option (binding to separate IP addresses, or using the binding service) can be used to run multiple instances.

                The -b 0.0.0.0 option binds the ports to all IP addresses defined on the host. Thus is you have multiple IP addresses, port 8080, for example, is bound to every address. This means that a browser can access web apps via any of those IP addresses (example, via both http://192.168.0.100:8080 and via http://192.168.0.100:8080, and it will be the exact same web app)

                Of course, you can combine the two mechanism. Thus you could use the binding service to define the ports and still use the -b option to bind to one or all IP addresses.