3 Replies Latest reply on Nov 14, 2010 11:48 AM by Wolf-Dieter Fink

    JBossAS 5.1 Ports and Addresses - KISS?

    Bert Laverman Newbie

      The Problem

      So I have a Linux server (Ubuntu 10 Server, 64bit) and want to setup JBoss. Shouldn't be too hard, right? Well actually, it is, the simple reason being that my server already runs a few virtual hosts with Apache httpd and some instances of Tomcat and other stuff, and everyone wants port 8080, 8009, etc.

      The Documentation

      So you head over to "Installation and Configuration", and lo and behold, JBoss also wants port 8080 and 8009, as well as several other popular numbers. Great. So this piece of documentation will tell me how, right? Well, no, it just assumes port 8080 (and all the others) will naturally fall to JBossAS. How to change this (in my situation false) assumption isn't even hinted at.

      The Search

      Hey, I'm not alone. Head over to the Wiki.

      The Wiki

      Ehhh... I seem to be able to solve the fact that JBoss only binds to "localhost" rather easily, using "-b <address>", but it doesn't say if that will allow me to bind to more than one address (say both "localhost" and my server's external IP address).

      Ports are a different matter all together. There is reference to port sets and specifying another port set, but a file "bindings.xml" doesn't exist in the installation. The closest match "find(1)" can give me is "bindings-jboss-beans.xml", but there are 5 (FIVE) of those. All under "server", in respectively "minimal", "standard", "web", "all", and "default".

       

      The Wiki doesn't really delve into how to set port values, just how to choose a port set. It also tells me I don't want that. I do actually. Apparently I can choose an offset. I just want to use port values above, say, 9000. But since all kinds of services seem to depend on knowing that value, shouldn't I know as well?

      Sir Hack-a-lot

      So I look through the files and find some reference to a built-in TomCat. That doesn't exist as such I find; it's now called JbossWeb or something. It does have a TomCat server.xml, and if I put 9090 and 9099 in there as I was used to do for TomCat instances, it does start up on those ports. Hey, it ignores the port sets?

      HELP

      So do I now have what I want or did I break the thing beyond repair? What about that plethora of other ports described in those 5 copies of bindings-jboss-beans.xml? And which of those 5 do I need?

       

      Bert

        • 2. Re: JBossAS 5.1 Ports and Addresses - KISS?
          Bert Laverman Newbie

          Yes, that was one of the links I found. BTW I also found out that "-b 0.0.0.0" will bind to all addresses. However; what about the different directory trees in my installation? Which of the copies of bindings-jboss-beans.xml should I edit. If just one; can I throw away the other directories?

           

          More importantly though: why isn't this in the "Installation and Configuration" part of the manual?

           

          Bert

          • 3. Re: JBossAS 5.1 Ports and Addresses - KISS?
            Wolf-Dieter Fink Master

            This is something general and is described in the AdminGuide.

             

            All directories server/XXXX/* are different configurations, during server start you select one with e.g. 'run.sh -b .... -c default' to use the server/default/* configuration. Which one is the standard if you not set '-c' depends on the version or distribution.

            I prefer to copy one of the standard configurations (default is a good, all will be good if you plan clustering) to my own and change only the copy, make it easy to track what I've changed.

             

            Three ways to change the bindings-jboss-beans.xml:

            1)

            Create a new section:

               <bean name="PortsDefaultBindings"  class="org.jboss.services.binding.impl.ServiceBindingSet">
                  <constructor>
                     <!--  The name of the set -->
                     <parameter>ports-default</parameter>
                     <!-- Default host name -->
                     <parameter>${jboss.bind.address}</parameter>
                     <!-- The port offset -->
                     <parameter>0</parameter>
                     <!-- Set of bindings to which the "offset by X" approach can't be applied -->
                     <parameter><null/></parameter>
                  </constructor>
               </bean>

               <bean name="AppPortsBindings"  class="org.jboss.services.binding.impl.ServiceBindingSet">

                  <constructor>

                     <parameter>ports-production</parameter>

                     <parameter>${jboss.bind.address}</parameter>

                     <parameter>10000</parameter>

                     <parameter><null/></parameter>

                  </constructor>

               </bean>

            Start the server with add '-Djboss.service.binding.set=AppPortBindings
            2)
            Change the section 'PortsDefaultBindings'
            set the offset from 0 to 10000
            3)
            Change all ports of the 'StandardBindings.
            Here you are free to use portnumbers you want, but it might be a bit confusing the admins ;-)

            1 of 1 people found this helpful