4 Replies Latest reply on Jun 4, 2003 3:14 AM by Jon Barnett

    war deployment with html files

    epdv Newbie

      Hello,

      I've got a web application (.war) with an index.html file (the subframes are JSPs). I'm using Apche httpd 2.0.43, and as the file is not in a directory, I cannot tell Apache, in which directory to look for the file. Is there any possibility to get the file without exploding the war?

      Kind regards

      Peter

        • 1. Re: war deployment with html files
          Lily Hendra Newbie

          Hi Peter.

          I have the same problem. Have you got that figured out?
          Here's what I found so far:
          - All the JSP's get expanded into $Jboss/tomcat/work directory
          - All the ear's and war's are expanded into $jboss/server/default/deploy/tmp/deploy/server/default/deploy. But They are not further expanded into the respective physical paths.
          I also need to point my apache's documentRoot so that it can serve static html pages.

          Any help would be very appreciated.

          decleor

          • 2. Re: war deployment with html files
            Jon Barnett Master

            If you are using mod_jk2 (and you probably should be), you can forward requests to Tomcat. See this for configuration details:
            http://jakarta.apache.org/builds/jakarta-tomcat-connectors/jk2/release/v2.0.0/doc/jk/aphowto.html

            This will mean that Tomcat will serve all files for its context. Otherwise you will need to expand the WAR. There are security issues with this approach, including inadvertent exposure of JSP code if you fail to filter files that Apache may deliver.

            You may also use mod_proxy as an alternative to mod_jk2, although this is less efficient.

            • 3. Re: war deployment with html files
              Lily Hendra Newbie

              Jon,

              Thanks for your reply.
              I saw your other posting in which you said that JBoss does not unpack the whole content of the war to tomcat/webapps directory.
              The problem is that I have virtualhost settings in my apache's httpd.conf, and I need to point the DocumentRoot to the directory which has all the static resources (images, htmls). And I definitely do not want to expand my WAR manually (for the reasons you mentioned).

              So now my question is: if i use mod_jk2 to forward requests to Tomcat, do I need to set the virtualhost in the httpd.conf, or will the one in jboss-web.xml suffice?

              Thanks.

              • 4. Re: war deployment with html files
                Jon Barnett Master

                You will need to define the virtual hosts in your Apache server. Apache is the controller doing the delegating so it decides what system will serve content and under what conditions.

                The virtual host setting in the Tomcat case is irrelevant as the request for content is "proxied" through the web server.

                I assume that you are using virtual host to determine the URL used to request content. In the case of a web application context for a virtual host, you can pass all requests through to Tomcat for that context if both your static and dynamic content for the web application is contained within the WAR.

                Please do read the JK2 Howto as the scope and support is beyond the capabilities of this forum to support. There are many combinations of redirections available, depending on your partitioning of content.