View Single Post
  #1  
Old 1st January 2009, 13:38
xtine xtine is offline
Junior Member
 
Join Date: Jun 2008
Posts: 13
Thanks: 1
Thanked 1 Time in 1 Post
Default Tomcat Apache SSI

I currently have Tomcat and Apache working together via mod_jk. All requests are sent to Tomcat, and certain directory/file types are sent back to Apache to serve.

Quote:
# By default, all requests go to worker1
JkMount /* worker1

# Serve html, jpg, and gif using httpd
JkUnMount /images/*.jpg worker1
JkUnMount /images/*.gif worker1
JkUnMount /styles/*.css worker1
JkUnMount /scripts/*.js worker1
The above works just fine. The part I'm puzzled about is how to fit SSI into the picture. I just added SSI to both Tomcat and Apache by following these instructions:
http://httpd.apache.org/docs/1.3/howto/ssi.html
http://tomcat.apache.org/tomcat-6.0-doc/ssi-howto.html
http://tomcat.apache.org/tomcat-6.0-...g/context.html

What works:
* Tomcat is able to serve up a .shtml file fine. SSI works.
* Apache is able to serve up a .shtml file fine. SSI works.
* Apache is able to serve up a .html file that includes a SSI via the XbitHack (by making the .html file executable). SSI works.

What doesn't work: I'm unable to get a SSI (that's a .html file) within a dynamically created html file (created by Tomcat) to work. The include inside the dynamically generated html file looks something like this.
Quote:
<!--#include virtual="/somemodule.html?param1=9&param2=true" -->
Ideally, I would like Apache to send everything to Tomcat (as it is now), Tomcat to dynamically create the html file (as it is now), and for Tomcat to send the server side include back to Apache to process (don't know how to do). Is this do-able? If so how?

If this is not possible, then I'd like Tomcat to know how to process that include, which is a .html file. I'm only able to get Tomcat to process .shtml files for SSI. I've tried changing the following in $CATALINA_BASE/conf/context.xml to get it to include .html files instead (which probably isn't a good idea anyways?), but no luck.

Quote:
<servlet-mapping>
<servlet-name>ssi</servlet-name>
<url-pattern>*.shtml</url-pattern> <--- tried changing this to *.html
</servlet-mapping>
Any ideas?
Reply With Quote
Sponsored Links