I am running Apache2.2 and Tomcat7.0 on Windows.

How do I setup JkMount to allow access to any deployed webapp on Tomcat in the form domain.com/tomcat/nameOfWebapp?

Here is my workers.properties:

# Define 1 real worker using ajp13
# Set properties for worker1 (ajp13)

Here is the relevant part of my httpd.conf:

LoadModule jk_module modules/mod_jk.so
<IfModule jk_module>

    JkWorkersFile D:/servers/tomcat7.0/conf/workers.properties
    JkLogFile D:/servers/tomcat7.0/logs/mod_jk.log
    JkLogStampFormat "[%b %d %Y - %H:%M:%S] "
    JkRequestLogFormat "%w %V %T"
    JkLogLevel info
    JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories

    Alias /tomcat "D:/servers/tomcat7.0/webapps/"

    <Directory "D:/servers/tomcat7.0/webapps/">
        AllowOverride None
        Allow from all

    <Location /*/WEB-INF/*>
        deny from all

    JkMount /tomcat/* worker1

If I just do something like JkMount /manager* worker1 I can get the manager webapp to work, but how can I get it to load any app that is deployed to Tomcat?

What I have now gives me this error:

The requested resource (/tomcat/manager/) is not available.

when trying to visit domain.com/tomcat/manager. The error is given by Tomcat so it's getting to it but for some reason it doesn't want to load it.



If you want everything to be available under, say, /tomcat/[webappname], then you can do it like this:

JkMount /tomcat/* worker1

Then, re-name all your web applications' WAR files to use nested-paths that all fall under /tomcat, like this:

CATALINA_BASE/webapps$ mv ROOT.war tomcat.war
CATALINA_BASE/webapps$ mv app1.war tomcat#app1.war
CATALINA_BASE/webapps$ mv app2.war tomcat#app3.war
CATALINA_BASE/webapps$ mv app3.war tomcat#app3.war

The effect will be that now, all webapps will have /tomcat/app1 (or whatever) as their context path. If you're written them correctly, this relocation should not be a problem at all, and you can allow httpd to continue to serve requests (even to .jsp if you want) to paths outside of /tomcat/.


Looks like I wanted to have this in my httpd.conf:

JkMount /*.jsp worker1
JkMount /*/tomcat/ worker1
  • Hmm, looks like that just gets me permission errors. – Talon876 May 23 '12 at 1:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.