jQuery in Action, 3rd edition
The moose likes Tomcat and the fly likes Apache/Tomcat URL Mapping Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Apache/Tomcat URL Mapping" Watch "Apache/Tomcat URL Mapping" New topic

Apache/Tomcat URL Mapping

Troy Piper

Joined: May 11, 2004
Posts: 2
I'm using Tomcat 4.1.29 and while development has gone well, I'm having a problem deploying my app behind Apache 1.3.
It works if I run the app on tomcat directly or using mod_jk mapped to a webapp. It's only when I move the app to ROOT that I have problems. I've every config I can find or think of, so I'm missing something very simple I think (or hope .
The following urls work fine:
Further using mod_jk, the following urls also work as expected:
However when I move the <webapp> to ROOT the gallery url fails to work via mod_jk, in other words...
works - http://localhost:8180/index.jsp
works - http://localhost:8180/gallery/image?id=1
works - http://localhost/index.jsp
FAILS - http://localhost/gallery/image?id=1
More information that may help...
My current JkMount directives (located in Apache Virtual Host directives) are:
JkMount /*.jsp smhworker
JkMount /gallery/* smhworker
As mentioned, if I use a JkMount directive to map to a webapp it works.
JkMount /*.jsp smhworker
JkMount /<webapp>/* smhworker
I've also tried mapping "/*", "/gallery/image" and anything else I could think of without luck.
Nothing untoward is appearing in the logs that I can see, though when I try linking to the gallery I get an Apache error page. If I try a non-existent jsp url within the gallery directory I get a Tomcat error page, and the failure appears in the Tomcat log.
Grateful for any help you can give...
Troy Piper

Joined: May 11, 2004
Posts: 2
I managed to get it working, finally...here is what I _think_ fixed it in case it helps others.
In my virtual host directive (Apache) I added the following line:
JkOptions +ForwardDirectories
I also added a directory directive to Apache. I thing it was the +ForwardDirectories that actually did it though
Documentroot "<path to docbase>"
<Directory "<path to docbase>">
Options Indexes FollowSymLinks MultiViews
DirectoryIndex index.vm index.jsp index.html
[ May 11, 2004: Message edited by: Troy Piper ]
I agree. Here's the link: http://aspose.com/file-tools
subject: Apache/Tomcat URL Mapping
jQuery in Action, 3rd edition