Tomcat on Apache

Serving up a different web root (not the control panel)

The default web root redirects to the TurnKey control panel. 

You can change that by either:

  1. Configuring a virtual host at the Apache-level via Webmin
  2. Changing the mod_jk configuration by editing /etc/tomcat6/mod_jk.conf.


RedirectMatch ^/$ /cp


RedirectMatch ^/$ /index.html

Configuring mod_jk to serve applets

For example let's say you want to install Apache Axis:

For example, if axis is located in the webapps directory, you would add something like the following to the mod_jk configuration in /etc/tomcat6/mod_jk.conf:

JkMount /axis    ajp13_worker
JkMount /axis/*  ajp13_worker

When you browse to http://appliance_ip/axis it would be proxied back to tomcat via apache. If you would like to have axis served at the webroot (well, redirected from webroot), you can implement a redirect like:

RedirectMatch ^/$   /axis
JkMount /axis    ajp13_worker
JkMount /axis/*  ajp13_worker

Please note that you will have to remove the welcome redirectmatch.
For more information on mod_jk, take a look at the Apache Tomcat Connectors documentation