Novell Home

My Favorites

Close

Please to see your favorites.

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
(on OES11: /var/opt/novell/tomcat6/webapps/webapps )

Also, on OES11, the port is 9009

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 NetIQ/Novell/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-13
  • Modified Date:26-JUL-13
    • SUSESUSE Linux Enterprise Server

Did this document solve your problem? Provide Feedback