Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

We have a slightly complex Apache 2.2 setup in front of a Tomcat 6.0 instance. The main Tomcat webapp is deployed in:


But we also have static content that we update semi-regularly. We didn't want to force a new build and deploy of the webapp, so that's stored separately in folders like:


To handle this from Apache, we use mod_rewrite and rules look something like the following:

RewriteCond %{REQUEST_FILENAME} -f
RewriteRule ^/css/(.*)$ - [L]

RewriteRule ^/css/(.*)$ ROOT/$1 [L]

RewriteCond %{REQUEST_FILENAME} -f
RewriteRule ^(.*)\.(jpg|png|html|js)$ - [L]

RewriteRule ^(.*)\.(jpg|png|html|js)$ - [L]

RewriteRule ^/(.*)$ http://localhost:8080/$1 [P,L]
ProxyPassReverse / http://localhost:8080/

I now think I might want to start using mod_jk and I have two questions:

  1. Is it even worth using mod_jk? I don't need load balancing.
  2. Is it even possible to handle the cases I outlined where the static content is referenced as "", but we don't know if it's located in the Tomcat webapp or in one of the static folders.
share|improve this question
Why do you think you might want to use mod_jk? Is what worth using mod_jk? – beans Mar 3 '11 at 2:56
up vote 1 down vote accepted

Why are you thinking of using mod_jk?

If it's to use ajp communication, to speed up transfer to tomcat why not look at mod_proxy_ajp?

You'd just change the tomcat rewriute rule to:-

RewriteRule ^/(.*)$ ajp://localhost:8080/$1 [P,L]
share|improve this answer
Good suggestion but it doesn't work if you are load balancing between 2 or more instances of JBoss since the AJP port needs to be balanced between servers. – djangofan May 9 '11 at 1:40

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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