Apache2 Web Server Configuration on Windows

This document outlines the few simple steps involved in setting up and configuring an integration of Apache2 and JBoss 5 on Windows. For configuration on Linux refer to Apache2 Web Server Configuration on Linux.

Prerequisite: IFS Applications must be installed with JBoss. In the following steps, IFS_HOME will represent the JBoss application server install directory

NOTE: This guide contains steps to manually alter configuration files. It is best recommended that you backup such files prior to doing any alterations.

Step 1: Download Apache2 Web Server

If you do not already have an Apache2 installation, get the latest Apache2 package from Apache.org and install it. We require no special configuration, just use the default settings. In the following steps, APACHE_HOME will represent the Apache install directory.

NOTE: It is recommended to Install the Apache Web Server on the same server machine as the JBoss Application Server. The installation directory can be any location of your choice.

Step 2: Download mod_jk 1.2.x

Download the latest package available from Tomcat's "Download Tomcat connector section" page . Always download the latest stable release if possible.

Rename the lib mod_jk.so and drop it in APACHE_HOME/modules directory.

NOTE: Don't use any release prior to mod_jk 1.2.15. Earlier releases are fairly buggy

Step 3: Setup Apache to use modjk

Add this line at the very bottom in APACHE_HOME/conf/httpd.conf

# Include mod_jk configuration file
Include IFS_HOME\instance\INSTANCE\conf\apache\httpd-jboss.conf

Replace the IFS_HOME and INSTANCE placeholders with relevant values for your installation.
Example: Include D:\IFSApp8\instance\PROD\conf\apache/httpd-jboss.conf

NOTE: The "IFS_HOME\instance\INSTANCE\conf\apache" folder contains files generated by the IFS installer. They require no alterations if both APACHE_HOME and IFS_HOME are on the same server.

Step 4: Disable JBoss HTTP/1.1 Connector

Once the previous step is completed Apache is ready to handle web requests. However the JBoss web server is also listening for HTTP requests. Since we have now setup Apache to handle the HTTP requests, it's best that we disable the JBoss web HTTP connector.

Locate the server.xml file in "IFS_HOME\jboss-eap-5.1\jboss-as\server\INSTANCE\deploy\jbossweb.sar" and either remove or comment out the following line.

<Connector address="${jboss.bind.address}" compressableMimeType="application/x-msdownload,application/octet-stream,application/xml,image/bmp,text/html,text/xml,text/plain" compression="on" connectionTimeout="20000" maxHttpHeaderSize="16384" port="8080" protocol="HTTP/1.1" redirectPort="8443" useSendfile="false"/>

Check if the following line is available in the server.xml as well, if not add it.

<Connector address="${jboss.bind.address}" port="8009" protocol="AJP/1.3" redirectPort="8443"/>

That's it. Start up Apache and JBoss. Off you GO !