Administer > System security > Trusted sign-on > Example: Enabling trusted sign-on > Example: Configuring the Apache web server to forward requests to Tomcat

Example: Configuring the Apache web server to forward requests to Tomcat

To configure the Apache web server to forward requests to Tomcat, complete the following tasks.

Task 1: Install the mod_jk binary in the correct folder

  1. Obtain the binary version of mod_jk here.
  2. Extract the downloaded .zip file, and then put the mod_jk.so file to the /modules directory in the Apache installation.

Task 2: Add settings to the httpd configuration file

Add the following lines to the httpd.conf file in the /conf directory:

# Load mod_jk module
LoadModule jk_module modules/mod_jk.so
# Where to find workers.properties
JkWorkersFile conf/workers.properties
# Where to put jk shared memory
JkShmFile logs/mod_jk.shm
# Where to put jk logs
JkLogFile logs/mod_jk.log
# Set the jk log level [debug/error/info]
JkLogLevel info
# Set the wildcard to forward to tomcat
JkMount /webtier/* worker1

Task 3: Add settings to the httpd configuration file

Create a workers.properties file in the /conf directory and put the following content in the file:

worker.list=worker1,jkstatus

#Set properties for worker1 (ajp13)
worker.worker1.type=ajp13
worker.worker1.host=hpsmucmdb.in.vm
worker.worker1.port=8009
worker.worker1.ping_timeout=1000
worker.worker1.connect_timeout=10000
worker.worker1.prepost_timeout=10000
worker.worker1.socket_timeout=10
worker.worker1.connection_pool_timeout=60
worker.worker1.connection_pool_size=90
worker.worker1.retries=2
worker.worker1.reply_timeout=300000

# status worker
worker.jkstatus.type=status

 

This setup is for forwarding requests to a single worker Tomcat. If more than one Tomcat instance is required on the same server, the following changes are required:

  • Worker name in worker.properties

  • AJP Port configuration aligned between worker.properties and the server.xml file in Tomcat

  • A lb statement in workers.properties

Related topics

Trusted sign-on
Example: Enabling trusted sign-on