apache2 infront of tomcat6 with mod_jk or mod-proxy problem

Well first of all let me say that my application has been developed using struts2, java, jsp, tomcat6. For preventing double form submission I have made use of tokenSession interceptor. Additionally I have 2 wars namely PIconstructionWeb and PIdistributionWeb. And goal is to make switching between these wars when needed, WITHOUT removing anything from tomcat and restarting tomcat.

I have tried both mod-proxy and mod_jk. To be honest mod-proxy is more simple.

In mod-proxy everything has worked. And necessity for NOT restarting tomcat to make chages has been reached. BUT as I said above I am using tokenSession interceptor, and with mod-proxy EVERY form submission is recieving "invalid.token" result. May be you know how to solve this issue. The configuration has been made with mod-proxy is as following:

ServerName virbank.ru

ProxyRequests Off

ProxyPreserveHost On

Order deny,allow

Allow from all

ProxyPass /PIconstructionWeb http://localhost:8080/PIconstructionWeb/

ProxyPassReverse /PIconstructionWeb http://localhost:8080/PIconstructionWeb/

ProxyPass /PIdistributionWeb http://localhost:8080/PIdistributionWeb/

ProxyPassReverse /PIdistributionWeb http://localhost:8080/PIdistributionWeb/

ProxyPass / http://localhost:8080/PIdistributionWeb/

ProxyPassReverse / http://localhost:8080/PIdistributionWeb/

On the other hand with mod_jk everything is working (including tokenSession issue). But necessity for NOT restarting tomcat has not been reached. Because one of my wars should reside in ROOT directory of tomcat, and whenever I want to switch I have to restart tomcat. The worker I have defined, is as following:

Define 1 real worker using ajp13

worker.list=piworker

Set properties for piworker (ajp13)

worker.piworker.type=ajp13

worker.piworker.host=localhost

worker.piworker.port=8009

I wonder is there any thechnique here to define meaning of the following?

worker.piworker1.host=localhost:8009/PIconstructionWeb

worker.piworker2.host=localhost:8009/PIdistributionWeb

If somebody has solved similar problem please help.

PS with mod_jk: defining workers with differenent ports, and in tomcat server.xml setting different listening ports to 2 wars is tedious and not preferred.

My tomcat should not be restarted because system should always respond to 3rd party external payment systems. And they are working 24 hours a day.

0 Replies

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct