wood burning stoves 2.0*
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


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Apache/Tomcat URL Mapping" Watch "Apache/Tomcat URL Mapping" New topic
Author

Apache/Tomcat URL Mapping

Troy Piper
Greenhorn

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:
http://localhost:8180/<webapp>/index.jsp
http://localhost:8180/<webapp>/gallery/image?id=1
Further using mod_jk, the following urls also work as expected:
http://localhost/<webapp>/index.jsp
http://localhost/<webapp>/gallery/image?id=1
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...
Thanks,
Troy
Troy Piper
Greenhorn

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
</Directory>
[ May 11, 2004: Message edited by: Troy Piper ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Apache/Tomcat URL Mapping
 
Similar Threads
Apache 2.0.53 + Tomcat 5.5.7 integration on Windows using mod_jk
How to create a multiple tomcat instances in windows?
Servlet 404 and JkMount configuration - encountered some problem (Apache/Tomcat)
Please help integrating Apache2.0.61 with Tomcat-5.5.15
NameVirtualHost