You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Graeme Miller <Gr...@AdvantageGroup.co.nz> on 2001/07/23 00:34:43 UTC

Apache, mod jserv, shtml and Tomcat jsp

OK everyone I am kinda stuck on an Apache/Tomcat cooperation issue at the
moment.

SUMMARY VERSION
In Apache virtual.conf how do I get mod_jserv passing all request for jsp
pages to tomcat whilst ALSO have Apache successfully run server side
included html (ie *.shtml files) that include jsp pages?
 
DETAILED VERSION
I need to get the following setup working :-
- Tomcat as the jsp engine serving all jsp pages
- Apache as the shared webserver serving everything else including shtml
files (ie. html with server side includes)
- Mod JServ using apj12 as the protocol for apache to talk to tomcat

Unfortunately all the jsp pages are in the same document root as all the
html images etc and all links are already set up so I can't just strip out
the jsps, put them into a separate directory and set up a context for that
directory.  I really need a solution that allows them to stay in place and
have tomcat pick up jsps, while Apache picks up the rest.

Currently I managed to achieve the following :-
1) Got apache to pass all files that end in *.jsp through to Tomcat by using
a transparent rewrite rule (don't know how to do this using mod_jserv) using
the following line

RewriteRule ^/(.*jsp)$ http://myserver:8987/$1 [P]

2) Got server side includes that include static files only to work using the
following lines

Options Includes
AddHandler server-parsed .html

However the above will not work if the server side include is a reference to
a jsp page.  The uncompiled jsp text will be inlined in the shtml file
instead of doing what I want which is to have the jsp page be executed by
tomcat and the results being inlined by the server side include

Does anybody know the answer or have any ideas?

Regards,

Graeme.

Re: Apache, mod jserv, shtml and Tomcat jsp

Posted by Dmitri Colebatch <di...@bigpond.net.au>.
Hi,

> - Tomcat as the jsp engine serving all jsp pages
sounds like you've already got that, albeit not in the typical manner

> - Apache as the shared webserver serving everything else including shtml
> files (ie. html with server side includes)
and I assume this is working as long as you dont need to include the
output from jsps?

> - Mod JServ using apj12 as the protocol for apache to talk to tomcat
have you been through the howto in the tomcat documentation?  

I can see what you're saying, and it all makes sense, and I also think
that it would probably be handled by getting mod_jk up and running.  Have
a read of the tomcat docs in the distribution that you have (what version
of tomcat and apache do you have btw?  I'm assuming 3.x and 1.3.x).  I
dont know a lot about the way apache handles shtmls but assume that it
will process a jsp if it is mounted using a JkMount.

so in short, see how you go with the howto in the docs and let us know (o:

cheesr
dim


> Unfortunately all the jsp pages are in the same document root as all the
> html images etc and all links are already set up so I can't just strip out
> the jsps, put them into a separate directory and set up a context for that
> directory.  I really need a solution that allows them to stay in place and
> have tomcat pick up jsps, while Apache picks up the rest.
> 
> Currently I managed to achieve the following :-
> 1) Got apache to pass all files that end in *.jsp through to Tomcat by using
> a transparent rewrite rule (don't know how to do this using mod_jserv) using
> the following line
> 
> RewriteRule ^/(.*jsp)$ http://myserver:8987/$1 [P]
> 
> 2) Got server side includes that include static files only to work using the
> following lines
> 
> Options Includes
> AddHandler server-parsed .html
> 
> However the above will not work if the server side include is a reference to
> a jsp page.  The uncompiled jsp text will be inlined in the shtml file
> instead of doing what I want which is to have the jsp page be executed by
> tomcat and the results being inlined by the server side include
> 
> Does anybody know the answer or have any ideas?
> 
> Regards,
> 
> Graeme.
>