You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Michael Harrison <go...@alumni.princeton.edu> on 2003/03/24 00:46:07 UTC
servlet problems with web app outside Tomcat directory
Hello,
I've been struggling for several days with setting up a modest web
application outside the Tomcat installation directory. I have JSPs
compiling, executing, and returning the proper display data, but I
cannot get my servlets to work: I only get 404 errors.
I'm running Apache 2.0.44 and Tomcat 4.1.18 on Linux. I have mod_jk.so
included in httpd.conf to provide AJP connectors to Tomcat. I have a
/home/web directory set up to contain all of my sites' filesystems. One
of these--we'll call it appsite.com--is happily laid out in
/home/web/appsite.com. I take care of the virtual hosts in my Apache
httpd.conf file. I have laid out the following structure for the site:
/home/web/appsite.com/webapps/ROOT. This is where I have JSPs and static
files.
I set the DocumentRoot in httpd.conf to
"/home/web/appsite.com/webapps/ROOT/". I also added an include directive
to include mod_jk directives in a separate file. In the mod_jk
configuration file, I include these servlet-specific JkMount directives:
JkMount /servlet ajp13
JkMount /servlet/* ajp13
In server.xml, I have the following containers defined:
<Engine name="Tomcat-Apache-mod_jk" defaultHost="www.appsite.com"
debug="0">
..
<Host name="www.appsite.com" debug="1"
appBase="/home/web/www.appsite.com/webapps">
..
<Context path="" docBase="ROOT" debug="0"/>
The servlets are located in
"/home/web/appsite.com/webapps/ROOT/WEB-INF/classes/mypackage/". I'm
trying to call them through www.appsite.com/servlet/myprefix.ServletX,
and that's when I get the 404.
Is there something else I need to do to map servlet to the
webapps/ROOT/WEB-INF/classes directory of my site?
Thanks,
Michael