You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by br...@panix.com on 2000/12/01 04:55:08 UTC

Re: Running JSP's w/ Apache and Tomcat

If you use mod_jk (JSERV is obsolete) you don't need to touch server.xml.  
Just read the mod_jk docs and you should be fine.  The only tomcat file that 
needs modifications is conf/worker/properties.

http://jakarta.apache.org/tomcat/jakarta-tomcat/src/doc/mod_jk-howto.html

Good luck,

Bryan
 
| hi,
| 
| I would like to set up apache and tomcat so that apache handles all of my
| static html pages and all of the JSP pages are handled by tomcat....
| basically exactly how JServ/GNUJSP works.  What do I need to add to
| tomcat.conf/server.xml in order to get this scenario to work correctly?
| I've been playing with different context settings and have checked all
| available docs and faqs without any success.  With a default set up (simply
| installing Tomcat, putting my jars in /lib and including tomcat.conf in
| httpd.conf) when I try to access a jsp file that's in my
| /usr/local/apache/htdocs dir, I get an error saying it can't be found in
| webapps/ROOT.  Copying the file there seems to make it work, but then I have
| to maintain the same file in two places because as soon as I remove it from
| my apache document root, apache can no longer find the file and I don't even
| get the Tomcat error.
| 
| Anyone out there with a similar scenario?  It seems like this should be
| fairly basic, but the included documentation on Apache/Tomcat configs is
| sketchy at best.
| ___
| jb
| 


-- 

RE: Running JSP's w/ Apache and Tomcat

Posted by David Rees <dr...@ebetinc.com>.
What you want to do is to override the root context.  Put this in your
server.xml file:

<Context path=""
         docBase="/usr/local/apache/htdocs"
         debug="0"
         reloadable="true">
</Context>

Now, you'll also have to create a WEB-INF and it's corresponding
subdirectories (lib, classes, ets) under /usr/local/apache/htdocs, as well
as add a section to your Apache httpd.conf file to disallow access to that
directory like this:

<Location "/WEB-INF">
	AllowOverride None
      Order deny,allow
      deny from all
</Location>

Then you should be set to go!

Coming from JServ/GnuJSP, this took a while to figure out myself.

-Dave

> | I would like to set up apache and tomcat so that apache handles
> all of my
> | static html pages and all of the JSP pages are handled by tomcat....
> | basically exactly how JServ/GNUJSP works.  What do I need to add to
> | tomcat.conf/server.xml in order to get this scenario to work correctly?
> | I've been playing with different context settings and have checked all
> | available docs and faqs without any success.  With a default
> set up (simply
> | installing Tomcat, putting my jars in /lib and including tomcat.conf in
> | httpd.conf) when I try to access a jsp file that's in my
> | /usr/local/apache/htdocs dir, I get an error saying it can't be found in
> | webapps/ROOT.  Copying the file there seems to make it work,
> but then I have
> | to maintain the same file in two places because as soon as I
> remove it from
> | my apache document root, apache can no longer find the file and
> I don't even
> | get the Tomcat error.
> |
> | Anyone out there with a similar scenario?  It seems like this should be
> | fairly basic, but the included documentation on Apache/Tomcat configs is
> | sketchy at best.