Adding and changing Mod JK JVM route, URI encoding and thread settings for JBoss

In your JBoss server there is a file that can be amended to alter the URI encoding and the number of threads used by JBoss. Additionally if you’re using mod_JK to link Apache HTTP and JBoss/Tomcat you can specify a JVM route parameter here that allows Apache to route incoming requests to the correct node.

To do this we need to look at the following file:

\jboss\server\[SERVER NAME]\deploy\jbossweb-tomcat55.sar\server.xml

In here we can amend a couple of parameters and add in a few extra values. For thread numbers and URI encoding look in the file for:

      <!-- A HTTP/1.1 Connector on port 8080 -->
      <Connector port="8080" address="${jboss.bind.address}"
         maxThreads="250" strategy="ms" maxHttpHeaderSize="8192"
         emptySessionPath="true"
         enableLookups="false" redirectPort="8443" acceptCount="100"
         connectionTimeout="20000" disableUploadTimeout="true"/>

We can then edit the maxThreads parameter for more threads if needed although check your applications recommended threads, for instance ATG recommends no more than 250 threads per server. We can also add in the following parameter here for URI encoding which is: URIEncoding=”UTF-8″.

      <!-- A HTTP/1.1 Connector on port 8080 -->
      <Connector port="8080" address="${jboss.bind.address}" URIEncoding="UTF-8"
         maxThreads="250" strategy="ms" maxHttpHeaderSize="8192"
         emptySessionPath="true" 
         enableLookups="false" redirectPort="8443" acceptCount="100"
         connectionTimeout="20000" disableUploadTimeout="true"/>

For the JVM route we need to amend this line in the server.xml file:

<Engine name="jboss.web" defaultHost="localhost">

To the below, adding the jvmRoute parameter:

<Engine name="jboss.web" jvmRoute="[MY MODE JK NODE NAME]" defaultHost="localhost">

Doing this should help you with your mod_JK setups and remove a few issues between Apache and JBoss.

This content is published under the Attribution-Noncommercial-Share Alike 3.0 Unported license.

Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • del.icio.us
  • StumbleUpon
  • Reddit
  • TwitThis
  • Facebook
  • Google Bookmarks
  • MySpace
  • Technorati

Technorati Tags: , , , , , , , ,

  1. Running multiple instances of Jboss on one server.
  2. Setting the JDK version and compiler in JBoss for JSP pages
  3. Creating XML from PHP/ MySQL for use with SPRY
  4. Google Maps API part 1: Accurate Geocoding for UK Postcodes
  5. Using Javascript/ AJAX to post HTML form data
  6. Setting Database Connections in JBoss/ ATG
  7. How to Setup Debugging in Eclipse for JBoss
  8. Hot Deploy Java code/ ATG components on JBoss
  9. Changing the HTTP port Oracle uses