7 Replies Latest reply on Feb 5, 2008 5:28 PM by mgk

    Deploying MyApp as default application on JBoss server

    mgk

      Hi,
      I've created a we application and it runs on JBoss 4.2.2.GA using the following url:

      http://localhost:8080/MyApp

      However, I would like to configure this so that when someone says:

      http://www.mgk.com

      this application should come up by default (That means, we should get rid of /MyApp and also the port number. I already have an IP address that maps to www.mgk.com.

      Could someone please help me in setting this? I'm running 'default' server.

      Thanks a bunch in advance.

      - MGK

        • 1. Re: Deploying MyApp as default application on JBoss server
          bossei

          I could use this solutioin also.

          • 2. Re: Deploying MyApp as default application on JBoss server
            peterj

            Two things.

            First, use the -b run option to bind the app server to your IP address. For example (assuming your IP address is 123.123.123.123):

            ./run.sh -b 123.123.123.123

            Note that only URLs for that IP address will work (that is, localhost will no longer work). If you want localhost to work also, use 0.0.0.0 as the IP address:

            ./run.sh -b 0.0.0.0

            Second, to change the context name (get rid of the MyApp in the URL), for your application add a jboss-web.xml file to the WEB-INF directory of your war file and set the following:

            <jboss-web>
             <context-root>/</context-root>
            </jboss-web>


            Or if you have an ear with an application.xml, you could set the context there.

            In addition, remove the existing root application, you can find it at server/xxx/deploy/jboss-web.deployer/ROOT.war. Either remove that whole directory, or change its context root to something other than "/".

            • 3. Re: Deploying MyApp as default application on JBoss server
              mgk

              Hi Peter,
              I cannot thank you enough for this. I've spent lot of time looking for documentation on this really.

              However, could you please let me know how to get rid of port 8080 as well?

              I still had to use 8080 in the url with the procedure you listed (both steps worked beautifully). I'm running JBoss on Windows Vista. Can I use port 80? If so, what all changes should be made to achieve this?

              Thank you once again !

              Regards,
              - MGK

              • 4. Re: Deploying MyApp as default application on JBoss server
                peterj

                Oops, missed the port 8080 part. You can change this in the file server/xxx/deploy/jboss-web.deploy/server.xml, change the Connector port from 8080 to 80. You should also do a search for 8080 in all of the *.xml files and change those to 80.

                • 5. Re: Deploying MyApp as default application on JBoss server
                  peterj

                  Um, what I said works only for Windows. For Unix/Linux it gets more complicated. See http://wiki.jboss.org/wiki/Wiki.jsp?page=JBossOnPort80

                  • 6. Re: Deploying MyApp as default application on JBoss server
                    peterj

                    Just noticed that you are running Windows Vista. You should re-read the EULA you agreed to when you installed Vista - it prohibits you from having more than 10 incoming connections. This means a maximum of 10 users can be (legally) connected to your web site at any one time.

                    • 7. Re: Deploying MyApp as default application on JBoss server
                      mgk

                      THANK YOU Peter once again for all your help. This resolved my issues.

                      I didn't know about that EULA until now. It is very strange. Probably, I'll switch to Linux.