7 Replies Latest reply on Jun 19, 2006 12:53 PM by javidjamae

    Possible to use two port numbers on one Tomcat?

    gus888

      Hi all,

      We currently have a problem for merging two Tomcat servers to one, because the two have different port number 4040, 5050. Since we do not want to combine the two port right away(we need to notify customers), is it possible to use two port number on one tomcat server? e.g. http://tomcat.com:4040, http://tomcat.com:5050. pointing to the same server. Thank you very much in advance.

      GUS

        • 1. Re: Possible to use two port numbers on one Tomcat?
          afedoren

          network or sysadmin could do it, for example using port forwarding

          • 2. Re: Possible to use two port numbers on one Tomcat?
            cpaul_it

            In the server.xml config file, you can specify additional connectors so that Tomcat listens on more than one port. For our dev servers, we have both secure and non-secure connectors listen on different ports. Works great!

            • 3. Re: Possible to use two port numbers on one Tomcat?
              new4jboss

              Hello cpaul_it,

              That's exactly what I'm looking for!!! Can you share some config info ? Most importantly, can you give me some pointers about how to tell jboss that a certain webapp should be published in a certain connector ?

              Thank you very much

              • 4. Re: Possible to use two port numbers on one Tomcat?
                visolvejboss

                Hello,

                To make two ports point to the same server we need to edit the server.xml file in the

                path: /deploy/jbossweb-tomcat55.sar

                We have to add additionally one more connector with the required port number.

                Already server.xml file has,

                 <Connector port="5050" address="${jboss.bind.address}"
                 maxThreads="250" strategy="ms" maxHttpHeaderSize="8192"
                 emptySessionPath="true"
                 enableLookups="false" redirectPort="8443" acceptCount="100"
                 connectionTimeout="20000" disableUploadTimeout="true"/>
                

                Just need to add the following lines,
                 <Connector port="5051" address="${jboss.bind.address}"
                 maxThreads="250" strategy="ms" maxHttpHeaderSize="8192"
                 emptySessionPath="true"
                 enableLookups="false" redirectPort="8443" acceptCount="100"
                 connectionTimeout="20000" disableUploadTimeout="true"/>
                

                Now, the server has point to two ports 5050 and 5051.

                Regards,
                Visolve JBoss Team.

                • 5. Re: Possible to use two port numbers on one Tomcat?
                  new4jboss

                  Hello,

                  Thank you so much for the config info. Do you have any idea of how to setup two webapps to be published via these two different connectors ? That would make webapp A available thru connector X and webapp B available thru connector Y. My webapps are webservices but for now I just want to keep things simple, so that people can find it a litle less dificult to help me. I know people's time is a scarce resource but must really depend on outside help for this. I'm completely stuck and have a deadline approaching:(
                  Thank you very much.

                  • 6. Re: Possible to use two port numbers on one Tomcat?
                    new4jboss

                    I seem to have solved this but keep needing help.
                    check

                    http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3949816#3949816

                    • 7. Re: Possible to use two port numbers on one Tomcat?
                      javidjamae

                      Do you have to maintain the two different port numbers? Can you not just assign them different host names?

                      For example, set them up as app1.myhost.com and app2.myhost.com and then set up two virtual hosts in the server.xml file and point each app to a virtual host configuration in the jboss-web.xml file.