Red Hat Training

A Red Hat training course is available for Red Hat JBoss Web Server

5.4. Configuring the Environment

After you have installed JBoss Enterprise Web Server, set the JAVA_HOME for your Tomcat (refer to Procedure 5.5, “Configuring Tomcat”).
Optionally, you can also:

Procedure 5.5. Configuring Tomcat

Before starting Tomcat, set its JAVA_HOME variable to point to a supported JDK (1.6.0):
  1. Locate the tomcat configuration file:
    • For Tomcat 5: /opt/redhat/ews/etc/sysconfig/tomcat5
    • For Tomcat 6: /opt/redhat/ews/etc/sysconfig/tomcat6
  2. Open the configuration file and delete the hash (#) sign at the beginning of the following line:
    # JAVA_HOME="/usr/java"

Procedure 5.6. Removing SSL

JBoss Enterprise Web Server by default supports SSL. However, you may remove the SSL support.
Follow this procedure to remove or add SSL:
  1. Go to /opt/redhat/ews/etc/httpd/conf.d
  2. Rename the SSL configuration file:
    • To remove SSL, rename ssl.conf to ssl.conf.disabled.
    • To re-enable the SSL, rename ssl.conf.disabled to ssl.conf.

Procedure 5.7. Configuring log4j

Follow this procedure to add log4j logging to Tomcat:
  1. Go to the /opt/redhat/ews/share/extras directory.
  2. Copy the log4j.jar and log4j.properties files to the lib directory of the Tomcat directory:
    • If using Tomcat 6, run the following commands:
      extras]# cp log4j.jar log4j.properties ../tomcat6/lib
      extras] # cp tomcat-juli-adapters.jar /opt/redhat/ews/share/tomcat6/lib
    • If using Tomcat 5, run the following commands:
      extras]# cp log4j.properties ../tomcat5/common/classes
      extras]# cp log4j.jar ../tomcat5/common/lib

Procedure 5.8. Configuring mod_jk

To configure the HTTP Server to use mod_jk, define the following:
  • available workers (JBoss instances) in the workers.properties file
  • the mod_jk configuration file mod_jk.conf
Follow this procedure to configure the HTTP Server to use mod_jk as its load balancer:
  1. Create a workers.properties file in /opt/rehat/ews/etc/httpd/conf/httpd/conf/ (refer to http://tomcat.apache.org/connectors-doc/reference/apache.html).
  2. Create a mod_jk.conf in /opt/rehat/ews/etc/httpd/conf/httpd/conf.d/, (refer to http://tomcat.apache.org/connectors-doc/reference/apache.html).

    Note

    You can also copy and modify the sample files mod_jk.conf.sample and workers.properties.sample available in /opt/rehat/ews/etc/httpd/conf/httpd/conf/: modify their content as needed and rename them to mod_jk.conf and workers.properties.

Procedure 5.9. Configuring mod_cluster

  1. From Red Hat Customer Portal, download the jboss-ep-native ZIP file for your operating system and architecture.
  2. Unzip the downloaded file.
  3. In the location, where you have extracted the file, change to jboss-ep-<VERSION> /native/lib[64]/httpd/modules
  4. Run the following command to copy mod_cluster modules to /opt/redhat/ews/lib[64]/httpd/modules:
    modules]# cp mod_advertise.so mod_manager.so mod_proxy_cluster.so mod_slotmem.so -t /usr/lib[64]/httpd/modules
  5. In /opt/redhat/ews/httpd/conf/httpd.conf add a hash (#) sign at the beginning of the following line to disable the mod_proxy_balancer module:
    LoadModule proxy_balancer_module modules/mod_proxy_balancer.so
    This module is incompatible with the JBoss HTTP Connector.
  6. Configure the server to load the JBoss HTTP Connector modules:
    1. Create the file /opt/redhat/ews/httpd/conf.d/JBoss_HTTP.conf.
    2. Add the following lines to the file JBoss_HTTP.conf:
      LoadModule slotmem_module modules/mod_slotmem.so
      LoadModule manager_module modules/mod_manager.so
      LoadModule proxy_cluster_module modules/mod_proxy_cluster.so
      LoadModule advertise_module modules/mod_advertise.so