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

I have this architecture:

            http                   Ajp
[Apache A] -------> [Apache B] ----------> [Tomcat]

there is a way to configure [Apache B] to forward an ajp request in order to achive this:

             Ajp                  Ajp
[Apache A] -------> [Apache B] ----------> [Tomcat] 


many thanks in advance.

share|improve this question

You need mod_proxy_ajp, which adds ajp support to mod_proxy.

share|improve this answer
I know how to forward an http request on the ajp channel. But how configure [Apache B] to catch the ajp incoming connection? Can you give me an example? – user40747 Apr 16 '10 at 14:15

You can setup a reverse proxy on Apache A, so that all requests for your app go to Apache B with a config like:

ProxyPass /myapp
ProxyPassReverse /myapp

Then, using ModJK on Apache B, you set up a file to define your tomcat servers and any load-balancing and connection parameters. In your vhost block, you set JKmounts to the tomcat server. So, if you have as a tomcat application, you would do

jkmount /myapp/* worker1

Where worker1 would be defined in the file like:


So the request will come in to apache A, which will get proxied to B and then mod_jk'ed over to the tomcat server.

share|improve this answer
i'm forced to do this. there's a firewall between the two apache and the only connection that I can establish is to the second apache, and obviously i cannot change the firewall configuration – user40747 Apr 16 '10 at 15:53
Ok. In that case, I think the first scenario is going to be the best bet. Set up a mod_proxy from A->B, so that everything gets proxied to Apache B. So all A is doing is acting as a gateway for everything to B. Then setup ModJK (or mod_proxy_ajp if you prefer) from Apache B to the tomcat server. Since everything is effectively proxied twice, there were most certainly be some performance impact with this. – Alex Apr 16 '10 at 16:24
I have modified my answer to reflect what I was talking about in my last comment. I have not tried a setup like this, but I think this will work. – Alex Apr 16 '10 at 16: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.