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.

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

2 Answers 2

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 http://apacheb.domain.com/myapp
ProxyPassReverse /myapp http://apacheb.domiain.com/myapp

Then, using ModJK on Apache B, you set up a workers.properties 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 www.domain.com/myapp as a tomcat application, you would do

jkmount /myapp/* worker1

Where worker1 would be defined in the workers.properties file like:

worker.worker1.port=8009
worker.worker1.host=tomcat_host_name
worker.worker1.type=ajp13

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

 
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.