My Personal Online Recycle Bin
You may find something useful here...........

Friday, December 30, 2005

Integrate Apache mod jk and struts action (*.do)

This week, I have implemented a new small module (built with struts framework) in the testing server. After implemented the module, I tried to run one round of testing to test the modules. At the beginning, everything was fine until when I click on my module link (http://xxxx/xxxx/xxxx/xxxx.do). I was expecting the modules loaded in a new browser. A new browser did appear but it was a no page found error page. I was stunt because I have no idea why my page didn't showed up. I have already run this modules n times in my local machine. And everything is fine.

Then I start to investigate what is possible problems. May be the jsp is in wrong directory, may be the path in configuration file have typo mistake and etc? But I am sure whatever possible problem in my mind should not be the right because if is those problem, it will showed an error page and not an empty page.

Suddenly I thought of may be the envionment is different. The testing server is running apache for load balancing while my machine is not. I quickly did a search in google for apache configuration (I have never setup a apache server) and find the possible solution.

The solution is as follow:


Under document root add this
JkMount /*.do loadbalancer
JkMount /WEBAPPS/* loadbalancer


The "JkMount /*.do loadbalancer" tell the apache to load balance for all files end with .do. While the "JkMount /WEBAPPS/* loadbalancer" is to load balance all the files under your WEBAPPS path.

If you are interested to know more about configuring apache with tomcat, please read Apache 2.x + Tomcat 4.x + Load Balancing (or Private JVMs). Lastest apache tomcat connector can be download here

0 Comments:

Post a Comment

<< Home