You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Scott Goldstein <sd...@MailAndNews.com> on 2001/05/08 04:10:03 UTC

Apache/Tomcat mod-jk configuration

I'm using Apache and Tomcat 3.2 and I'm trying to understand the mod-jk 
configuration file.

Suppose, that I want to access servlets through URL's of the form:

http://host/webappName/servletName

It seems that I can do this one of two ways:

1.  Have all requests of the form http://host/webappName/* go to Tomcat.

    The problem with this, is that I want Apache to serve my html pages

2.  For every servlet, put in a line in the mod-jk configuration file to pass 
the request to Tomcat.

    It would seem with this, I would not only have to specify it in the mod-jk 
configuration file, but also in the web.xml file.  It seems like there should 
be an easier way.


Am I stuck with putting all of my servlets in a "webAppName/servlets" 
directory if I want to avoid this problem?  Is this compatible with the spec 
for WAR files?

On that note, where can I even find the spec for WAR files?

Thank you very much for the help.

Scott Goldstein

------------------------------------------------------------
"Just a mirror for the sun...
 My smiling eyes are just a mirror for the sun."
------------------------------------------------------------


Re: Apache/Tomcat mod-jk configuration

Posted by "Noel E. Lecaros" <sp...@mozcom.com>.
Hi, Scott

You only need to specify JkMount directives in mod_jk.conf to tell Apache which
URL mappings it has to delegate processing to Tomcat.  The url mappings in
web.xml tell Tomcat which servlet/jsp will handle specific mappings.  

The /servlet qualifier I believe is a backward-compatibility feature to earlier
servlet containers where you had to specify /servlet/<servlet-name> to access
servlets.  You're not necessarily stuck with this qualifier - you can create
your own via the above-mentioned JkMount directives.  However, I find it very
convenient to be able to qualify my servlets differently from static content to
simplify deployment of servlets on Tomcat, and html pages and other files on
Apache.

Regards,
Noel Lecaros

Scott Goldstein wrote:
> 
> I'm using Apache and Tomcat 3.2 and I'm trying to understand the mod-jk
> configuration file.
> 
> Suppose, that I want to access servlets through URL's of the form:
> 
> http://host/webappName/servletName
> 
> It seems that I can do this one of two ways:
> 
> 1.  Have all requests of the form http://host/webappName/* go to Tomcat.
> 
>     The problem with this, is that I want Apache to serve my html pages
> 
> 2.  For every servlet, put in a line in the mod-jk configuration file to pass
> the request to Tomcat.
> 
>     It would seem with this, I would not only have to specify it in the mod-jk
> configuration file, but also in the web.xml file.  It seems like there should
> be an easier way.
> 
> Am I stuck with putting all of my servlets in a "webAppName/servlets"
> directory if I want to avoid this problem?  Is this compatible with the spec
> for WAR files?
> 
> On that note, where can I even find the spec for WAR files?
> 
> Thank you very much for the help.
> 
> Scott Goldstein
> 
> ------------------------------------------------------------
> "Just a mirror for the sun...
>  My smiling eyes are just a mirror for the sun."
> ------------------------------------------------------------

Tomcat+JNI+Embedded SQL won't work for me

Posted by "Simon A. Crase" <si...@majoris.com.au>.
Help!
I am trying to access some embedded SQL from Java Server pages - basically
jsp+Tomcat calling beans, which go through JNI to call embedded SQL
(Unify) - which in turn has been translated to C and compiled into a shared
object (Linux).

Everything works fine without jsp & Tomcat - I have tested the beans out
using Junit - www.junit.org.  Unfortunately the code does not work at all
with Tomcat 3.0.  I have established that the C code is running OK, and that
has been passed all the environment variables that the embedded SQL expects.
I think that the embedded SQL involves spawning another process - maybe JNI
isn't allowed to do this under Tomcat?


Any help apprciated.


Regards,


Simon Crase