Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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
add comment

3 Answers

up vote 1 down vote accepted

Use

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

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>

  <Proxy /webmail>
    Order Deny,Allow
    Deny from All
  </Proxy>
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
add comment

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
add comment

Your Answer

 
discard

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.