Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.tomcat.modules.config
Class ApacheConfig

    java.lang.Object
      org.apache.tomcat.core.BaseInterceptor
          org.apache.tomcat.modules.config.BaseJkConfig
              org.apache.tomcat.modules.config.ApacheConfig

public class ApacheConfig
extends BaseJkConfig

Generates automatic apache mod_jk configurations based on the Tomcat server.xml settings and the war contexts initialized during startup.

This config interceptor is enabled by inserting an ApacheConfig element in the <ContextManager> tag body inside the server.xml file like so:

     < ContextManager ... >
       ...
       <ApacheConfig options />
       ...
     < /ContextManager >

where options can include any of the following attributes:

- configHome - default parent directory for the following paths. If not set, this defaults to TOMCAT_HOME. Ignored whenever any of the following paths is absolute.
- jkConfig - path to use for writing Apache mod_jk conf file. If not set, defaults to "conf/auto/mod_jk.conf".
- workersConfig - path to workers.properties file used by mod_jk. If not set, defaults to "conf/jk/workers.properties".
- modJk - path to Apache mod_jk plugin file. If not set, defaults to "modules/mod_jk.dll" on windows, "modules/mod_jk.nlm" on netware, and "libexec/mod_jk.so" everywhere else.
- jkLog - path to log file to be used by mod_jk.
- jkDebug - JK Loglevel setting. May be debug, info, error, or emerg. If not set, defaults to emerg.
- jkWorker The desired worker. Must be set to one of the workers defined in the workers.properties file. "ajp12", "ajp13" or "inprocess" are the workers found in the default workers.properties file. If not specified, defaults to "ajp13" if an Ajp13Interceptor is in use, otherwise it defaults to "ajp12".
- forwardAll - If true, forward all requests to Tomcat. This helps insure that all the behavior configured in the web.xml file functions correctly. If false, let Apache serve static resources. The default is true. Warning: When false, some configuration in the web.xml may not be duplicated in Apache. Review the mod_jk conf file to see what configuration is actually being set in Apache.
- noRoot - If true, the root context is not mapped to Tomcat. If false and forwardAll is true, all requests to the root context are mapped to Tomcat. If false and forwardAll is false, only JSP and servlets requests to the root context are mapped to Tomcat. When false, to correctly serve Tomcat's root context you must also modify the DocumentRoot setting in Apache's httpd.conf file to point to Tomcat's root context directory. Otherwise some content, such as Apache's index.html, will be served by Apache before mod_jk gets a chance to claim the request and pass it to Tomcat. The default is true.

Version:
  $Revision: 1.32 $ $Date: 2004/02/25 07:06:59 $
Author:
  Costin Manolache, Larry Isaacs, Mel Martinez

Field Summary
`static java.lang.String` | `JK_LOG_LOCATION` default mod_jk log file location
`static java.lang.String` | `MOD_JK` default location of mod_jk Apache plug-in.
`static java.lang.String` | `MOD_JK_CONFIG` default path to mod_jk .conf location
`static java.lang.String` | `WORKERS_CONFIG` default path to workers.properties file This should be also auto-generated from server.xml.

Fields inherited from class org.apache.tomcat.modules.config.BaseJkConfig
`configHome, forwardAll, jkDebug, jkLog, jkWorker, noRoot, regenerate, tomcatHome, workersConfig`

Fields inherited from class org.apache.tomcat.core.BaseInterceptor
`cm, ct, ctx, debug, DECLINED, loghelper, OK`

Constructor Summary
`ApacheConfig()`

Method Summary
`protected boolean` | `addExtensionMapping(java.lang.String ctxPath, java.lang.String ext, java.io.PrintWriter mod_jk)` Add an Apache extension mapping.
`protected boolean` | `addMapping(java.lang.String fullPath, java.io.PrintWriter mod_jk)` Add a fulling specified Appache mapping.
`void` | `execute(ContextManager cm)` executes the ApacheConfig interceptor.
`protected void` | `initProperties(ContextManager cm)` Initialize defaults for properties that are not set explicitely
`void` | `setCertsIndicator(java.lang.String s)` What is the indicator for the client SSL certificated(default is SSL_CLIENT_CERT
`void` | `setCipherIndicator(java.lang.String s)` What is the indicator for client SSL cipher suit (default is SSL_CIPHER)
`void` | `setExtractSSL(boolean sslMode)` By default mod_jk is configured to collect SSL information from the apache environment and send it to the Tomcat workers.
`void` | `setHttpsIndicator(java.lang.String s)` What is the indicator for SSL (default is HTTPS)
`void` | `setJkConfig(java.lang.String path)` set the path to the output file for the auto-generated mod_jk configuration file.
`void` | `setModJk(java.lang.String path)` set the path to the mod_jk Apache Module
`void` | `setSessionIndicator(java.lang.String s)` What is the indicator for SSL session (default is SSL_SESSION_ID)

Methods inherited from class org.apache.tomcat.modules.config.BaseJkConfig
`addInterceptor, addMapping, contextInit, engineState, getAbsoluteDocBase, initWorker, setConfigHome, setForwardAll, setJkDebug, setJkLog, setJkWorker, setNoRoot, setWorkersConfig`

Methods inherited from class org.apache.tomcat.core.BaseInterceptor
`addContainer, addContext, addHandler, addSecurityConstraint, afterBody, authenticate, authorize, beforeBody, beforeCommit, contextMap, contextShutdown, contextState, copyContext, engineInit, engineShutdown, engineStart, engineStop, findSession, getContext, getContextManager, getDebug, getInfo, getLog, getNote, getNote, handleError, log, log, log, log, postInitCheck, postReadRequest, postRequest, postService, postServletDestroy, postServletInit, preInitCheck, preService, preServletDestroy, preServletInit, registerHooks, reload, removeContainer, removeContext, removeHandler, removeInterceptor, requestMap, sessionState, setContext, setContextManager, setDebug, setInfo, setNote, setNote`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### MOD_JK_CONFIG

    public static final java.lang.String MOD_JK_CONFIG

  default path to mod_jk .conf location

  See Also:
    Constant Field Values

### WORKERS_CONFIG

    public static final java.lang.String WORKERS_CONFIG

  default path to workers.properties file This should be also auto-generated from server.xml.

  See Also:
    Constant Field Values

### JK_LOG_LOCATION

    public static final java.lang.String JK_LOG_LOCATION

  default mod_jk log file location

  See Also:
    Constant Field Values

### MOD_JK

    public static java.lang.String MOD_JK

  default location of mod_jk Apache plug-in.

Constructor Detail

### ApacheConfig

    public ApacheConfig()

Method Detail

### setJkConfig

    public void setJkConfig(java.lang.String path)

  set the path to the output file for the auto-generated mod_jk configuration file. If this path is relative then it will be resolved absolutely against the getConfigHome() path.

### setModJk

    public void setModJk(java.lang.String path)

  set the path to the mod_jk Apache Module

### setExtractSSL

    public void setExtractSSL(boolean sslMode)

  By default mod_jk is configured to collect SSL information from the apache environment and send it to the Tomcat workers. The problem is that there are many SSL solutions for Apache and as a result the environment variable names may change. The following JK related SSL configureation can be used to customize mod_jk's SSL behaviour. Should mod_jk send SSL information to Tomact (default is On)

### setHttpsIndicator

    public void setHttpsIndicator(java.lang.String s)

  What is the indicator for SSL (default is HTTPS)

### setSessionIndicator

    public void setSessionIndicator(java.lang.String s)

  What is the indicator for SSL session (default is SSL_SESSION_ID)

### setCipherIndicator

    public void setCipherIndicator(java.lang.String s)

  What is the indicator for client SSL cipher suit (default is SSL_CIPHER)

### setCertsIndicator

    public void setCertsIndicator(java.lang.String s)

  What is the indicator for the client SSL certificated(default is SSL_CLIENT_CERT

### initProperties

    protected void initProperties(ContextManager cm)

  Initialize defaults for properties that are not set explicitely

  Overrides:
    `initProperties` in class `BaseJkConfig`

### execute

    public void execute(ContextManager cm)
                 throws TomcatException

  executes the ApacheConfig interceptor. This method generates apache configuration files for use with mod_jk. If not already set, this method will setConfigHome() to the value returned from cm.getHome().

  Overrides:
    `execute` in class `BaseJkConfig`
  Throws:
    `TomcatException`

### addExtensionMapping

    protected boolean addExtensionMapping(java.lang.String ctxPath,
                                          java.lang.String ext,
                                          java.io.PrintWriter mod_jk)

  Add an Apache extension mapping.

  Overrides:
    `addExtensionMapping` in class `BaseJkConfig`

### addMapping

    protected boolean addMapping(java.lang.String fullPath,
                                 java.io.PrintWriter mod_jk)

  Add a fulling specified Appache mapping.

  Overrides:
    `addMapping` in class `BaseJkConfig`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2001 Apache Software Foundation. All Rights Reserved.