Showing posts with label mod_jk. Show all posts
Showing posts with label mod_jk. Show all posts

Thursday, 10 September 2009

JBoss 4.2.2 and Apache 2 with AJP

In case I'm not the only person on the Internet with an interest in this, JBoss 4.2.2 does not play nicely with Apache using the AJP protocol.

After a lot of experimentation with various combinations of settings at both the Apache 2.2 end (mod_jk and mod_proxy_ajp) I came across the following:

https://jira.jboss.org/jira/browse/JBPAPP-366

I found this slightly reassuring.

Due to various reasons and time restrictions, I was not able to upgrade to 4.2.3 - but I thought it might have a compatible upgraded / patched version of the jbossweb.jar. Nope.

So, I did some digging around and figured out that the source code is available for anonymous download from a subversion repository at:

http://anonsvn.jboss.org/repos/jbossweb/

see:

http://docs.jboss.org/process-guide/en/html/svnaccess.html

Paraphrased steps to apply the patch:
- Download the JBoss Web project from the JBOSSWEB_2_0_1_GA tag - to ensure compatibility
- Adjust the build.properties.default file to specify version 4 2 2 GA
- Copy JBoss 4.2.2 into the appropriate directory, or run the ant command to have a fresh distribution downloaded
- Edit the 2 Java classes mentioned in the patch in the Jira issue that I linked to earlier
- Run the appropriate ant build command

Take your shiney custom built jbossweb.jar and copy it over the existing one in the jboss-web.deployer/lib directory.

Restart JBoss and enjoy not having to restart JBoss periodically to free up those connection resources.

Update:

You should also look at the: What is an optimized mod_jk configuration for use in Apache with JBoss? Red Hhat Knowledgebase article.

In addition, the usual consideration should be afforded to JVM settings for memory sizes and garbage collection.