SUSE Support

Here When You Need Us

How to Configure mod_jk for Apache/Tomcat on SLES 11

This document (7012556) is provided subject to the disclaimer at the end of this document.

Environment

SUSE Linux Enterprise Server 11 Service Pack 2
SUSE Linux Enterprise Server 11 Service Pack 1

Situation

This document describes how to configure mod_jk for Apache / Tomcat on SLES 11 SP2.
 
NOTE:  mod_proxy, in conjunction with proxy ajp is the recommended approach for linking the Apache Web Server to Tomcat on Open Enterprise Server 11, but there are cases in which mod_jk needs to be used.  Even though it is NOT recommended, the steps outlined here for SLES11, are similar on an OES11 server.

Resolution

This document outlines the steps needed to get mod_jk working with Apache and Tomcat on SLES11
 
1.) From YaST, install the mod_jk package for Tomcat, located in software, search on mod_jk
 
2.) In /etc/sysconfig/apache2 add JK module to APACHE_MODULES, it may go at the end of the line as such:
APACHE_MODULES="... ... ... ... ...jk"
 
3.) Create the following directory as the root user /etc/apache2/mod_jk/  
 
4.) Create the file /etc/apache2/mod_jk/mod_jk.conf  and add the following lines:
Add the following lines:
 
JkLogFile                       /var/log/apache2/mod_jk.log
JkWorkersFile           /etc/apache2/mod_jk/workers.properties
JkShmFile                       /etc/apache2/mod_jk/mod_jk.shm
 
# Set the jk log level [debug/error/info]
JkLogLevel                      info
 
# Select the timestamp log format
JkLogStampFormat        "[%a %b %d %H:%M:%S %Y] "
 
# JK mount
JkMount /sample worker1
JkMount /sample/* worker1
 
5. ) Create the file/etc/apache2/mod_jk/workers.properties 
Add the following lines:
 
worker.list=worker1
worker.worker1.type=ajp13
worker.worker1.host=127.0.0.1
worker.worker1.port=8009
 
6.) Create the file: /var/log/apache2/mod_jk.log 
 
7.) Modify /etc/apache2/httpd.conf  to include the mod_jk.conf
Include /etc/apache2/mod_jk/mod_jk.conf  (Note: do NOT include the workers.properties file, mod_jk.conf points at it, and will use it.  Trying to include it with the Apache config scripts will cause Apache to fail on loading)
 
8.) Run the rcapache2 restart command.
 
 
 

Additional Information

If a sample webapp (i.e. sample.war from the Apache Software Foundation) is being used, it can be placed here:  srv/tomcat6/webapps
 
Note: If the webapp being run through tomcat needs to be accessed via HTTPS on the Apache side, add the JkMount statements to the appropriate vhost file in /etc/apache2/vhosts.d just above the </VirtualHost> entry.
 
 
 
 

Disclaimer

This Support Knowledgebase provides a valuable tool for SUSE customers and parties interested in our products and solutions to acquire information, ideas and learn from one another. Materials are provided for informational, personal or non-commercial use within your organization and are presented "AS IS" WITHOUT WARRANTY OF ANY KIND.

  • Document ID:7012556
  • Creation Date: 05-Jun-2013
  • Modified Date:12-Oct-2022
    • SUSE Linux Enterprise Server

< Back to Support Search

For questions or concerns with the SUSE Knowledgebase please contact: tidfeedback[at]suse.com

tick icon

SUSE Support Forums

Get your questions answered by experienced Sys Ops or interact with other SUSE community experts.

tick icon

Support Resources

Learn how to get the most from the technical support you receive with your SUSE Subscription, Premium Support, Academic Program, or Partner Program.

tick icon

Open an Incident

Open an incident with SUSE Technical Support, manage your subscriptions, download patches, or manage user access.