Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

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

Just asked on StackOverflow, but more appropriate here.

I have my Apache HTTP server set up to forward all requests to Tomcat, i.e. proxy_ajp.conf looks like:

ProxyPass / ajp://localhost:8009/

where Tomcat is listening on port 8009. This works find except when I try to access squirrelmail (i.e. webmail) on the server. Is there a way to forward all requests to Tomcat except those going to /webmail/?

Thanks for the help.

share|improve this question
up vote 1 down vote accepted


ProxyPass /webmail !
ProxyPass / ajp://localhost:8009/
share|improve this answer

Absolutely. I do this for web apps where I don't want people snooping in WEB-INF.

  ProxyPass / ajp://localhost:8009 /

  <Proxy />
    Order Deny,Allow
    Allow from All

  <Proxy /webmail>
    Order Deny,Allow
    Deny from All
share|improve this answer
Thanks, but I was actually hoping to still let request to webmail go through. They just wouldn't go to Tomcat. Someone on StackOverflow suggested this: RewriteEngine On RewriteCond REQUEST_URI !^/webmail* RewriteRule / /tomcat/ <Location /tomcat> ProxyPass ajp://localhost:8099/ </Location> but the rewrite rule doesn't seem to be kicking in. – Joe Aug 31 '10 at 3:14

A second proxy pass for /webmail ahead of the proxy pass for / may work. I believe they are matched in order.

share|improve this answer

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.