Tuesday, July 11, 2006

Apache Tomcat Connector (JkMount) won't work for servlet base - without a slash

We have a tomcat app-server running some java servlet apps which we pass through from apache using the tomcat JK connector. It all worked fine - so long as you don't request the base servlet path. As an example:

# Mount worker1 to all urls starting with that base
JkMount /jsp-examples/* worker1

The above won't work for http://localhost/jsp-examples (note there's no trailing slash!). A simple solution - mount the path without the slash too:

# Mount worker1 to all urls starting with that base
JkMount /jsp-examples/* worker1
JkMount /jsp-examples worker1

No comments: