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.
If you are using mod_jk2 (and you probably should be), you can forward requests to Tomcat. See this for configuration details:
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.
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?
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.