3 Replies Latest reply on Oct 3, 2006 11:50 AM by rcjboss

    Would I use mod_jk to do this...?

    dsmiller

      Greetings,

      Can I use mod_jk to forward everything to JBoss?
      In other words, I'd like for my webapp to respond to http://www.domain.com/ instead of http://www.domain.com/webapp/.

      I'm using virtual hosts in Apache httpd and JBoss is hosting multiple webapps.

      Thank you.

        • 1. Re: Would I use mod_jk to do this...?
          rcjboss

          Yes, you can configure mod_jk to forward all the requests to JBoss.
          In order to achieve "www.domain.com" you would need to either
          1. Document root/context root of your war to be the default.
          or
          2. Deploy your war by renaming as root.war and renaming the JBoss' console war to something else. This would be located JBoss' Tomcat deployment.

          • 2. Re: Would I use mod_jk to do this...?
            dsmiller

             

            "rcjboss" wrote:
            Yes, you can configure mod_jk to forward all the requests to JBoss.
            In order to achieve "www.domain.com" you would need to either
            1. Document root/context root of your war to be the default.
            or
            2. Deploy your war by renaming as root.war and renaming the JBoss' console war to something else. This would be located JBoss' Tomcat deployment.


            Thank you rcjboss.

            I'm using your first suggestion but I'm not really sure that I know what you mean. I think you mean that I should change where DocumentRoot points. When I point it at the root dir of my webapp, Apache displays a default index.html file found in the original DocumentRoot instead of the index.jsp found in the root of my webapp.

            Setting documentRoot to the base dir of my webapp seems to be entirely outside of mod_jk. I'm not sure where to go next.

            Here's the virtual host tag from httpd.conf:
            <VirtualHost *:80>
             DocumentRoot /usr/local/jboss/server/default/deploy/webapp.war
             ServerName domain.com
             ServerAlias www.domain.com
            </VirtualHost>


            Note: The .war file has been extracted

            • 3. Re: Would I use mod_jk to do this...?
              rcjboss

              Hi,

              In the war file that you want to be default, add a file in "WEB-INF" folder as "jboss-web.xml" with the following:
              <jboss-web>
              <context-root>/</context-root>
              </jboss-web>

              JBoss should pick your app as the default and will show the default page of your war.