org.apache.jk.config

Class ApacheConfig

Implemented Interfaces:
LifecycleListener

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 Listener in the server.xml file like so:

 <32Server ... >
   ...
   org.apache.ajp.tomcat4.config.ApacheConfig 
       options />
   ...
 <32/Server >
where options can include any of the following attributes:

Authors:
Costin Manolache
Larry Isaacs
Mel Martinez
Bill Barker

Field Summary

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

Fields inherited from class org.apache.jk.config.BaseJkConfig

append, configHome, debug, forwardAll, jkDebug, jkLog, jkWorker, legacy, noRoot, regenerate, tomcatHome, workersConfig

Constructor Summary

ApacheConfig()

Method Summary

protected boolean
addExtensionMapping(String ctxPath, String ext, PrintWriter mod_jk)
Add an Apache extension mapping.
protected boolean
addMapping(String fullPath, PrintWriter mod_jk)
Add a fulling specified Appache mapping.
protected boolean
addMapping(String ctxP, String ext, PrintWriter mod_jk)
Add a partially specified Appache mapping.
protected void
generateContextMappings(Context context, PrintWriter mod_jk)
protected boolean
generateJkHead(PrintWriter mod_jk)
Generate the loadModule and general options
protected void
generateSSLConfig(PrintWriter mod_jk)
Generate SSL options
protected void
generateStupidMappings(Context context, PrintWriter mod_jk)
Forward all requests for a context to tomcat.
protected void
generateVhostHead(Host host, PrintWriter mod_jk)
Generate Virtual Host start
protected void
generateVhostTail(Host host, PrintWriter mod_jk)
Generate Virtual Host end
protected PrintWriter
getWriter()
Get the output Writer.
protected void
initProperties()
Initialize defaults for properties that are not set explicitely
void
setCertsIndicator(String s)
What is the indicator for the client SSL certificated(default is SSL_CLIENT_CERT
void
setCipherIndicator(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(String s)
What is the indicator for SSL (default is HTTPS)
void
setJkConfig(String path)
set the path to the output file for the auto-generated mod_jk configuration file.
void
setModJk(String path)
set the path to the mod_jk Apache Module
void
setSessionIndicator(String s)
What is the indicator for SSL session (default is SSL_SESSION_ID)

Methods inherited from class org.apache.jk.config.BaseJkConfig

addExtensionMapping, addMapping, execute, executeContext, executeEngine, executeHost, executeServer, generateContextMappings, generateJkHead, generateJkTail, generateSSLConfig, generateStupidMappings, generateVhostHead, generateVhostTail, getAbsoluteDocBase, getConfigFile, getHost, getWriter, initProperties, isAbsolute, lifecycleEvent, log, patch, setAppend, setConfigHome, setForwardAll, setJkDebug, setJkLog, setJkWorker, setLegacy, setNoRoot, setWorkersConfig

Field Details

JK_LOG_LOCATION

public static final String JK_LOG_LOCATION
default mod_jk log file location


MOD_JK

public static final String MOD_JK
default location of mod_jk Apache plug-in.


MOD_JK_CONFIG

public static final String MOD_JK_CONFIG
default path to mod_jk .conf location


WORKERS_CONFIG

public static final String WORKERS_CONFIG
default path to workers.properties file This should be also auto-generated from server.xml.

Constructor Details

ApacheConfig

public ApacheConfig()

Method Details

addExtensionMapping

protected boolean addExtensionMapping(String ctxPath,
                                      String ext,
                                      PrintWriter mod_jk)
Add an Apache extension mapping.
Overrides:
addExtensionMapping in interface BaseJkConfig


addMapping

protected boolean addMapping(String fullPath,
                             PrintWriter mod_jk)
Add a fulling specified Appache mapping.
Overrides:
addMapping in interface BaseJkConfig


addMapping

protected boolean addMapping(String ctxP,
                             String ext,
                             PrintWriter mod_jk)
Add a partially specified Appache mapping.


generateContextMappings

protected void generateContextMappings(Context context,
                                       PrintWriter mod_jk)
Overrides:
generateContextMappings in interface BaseJkConfig


generateJkHead

protected boolean generateJkHead(PrintWriter mod_jk)
Generate the loadModule and general options
Overrides:
generateJkHead in interface BaseJkConfig


generateSSLConfig

protected void generateSSLConfig(PrintWriter mod_jk)
Generate SSL options
Overrides:
generateSSLConfig in interface BaseJkConfig


generateStupidMappings

protected void generateStupidMappings(Context context,
                                      PrintWriter mod_jk)
Forward all requests for a context to tomcat. The default.
Overrides:
generateStupidMappings in interface BaseJkConfig


generateVhostHead

protected void generateVhostHead(Host host,
                                 PrintWriter mod_jk)
Generate Virtual Host start
Overrides:
generateVhostHead in interface BaseJkConfig


generateVhostTail

protected void generateVhostTail(Host host,
                                 PrintWriter mod_jk)
Generate Virtual Host end
Overrides:
generateVhostTail in interface BaseJkConfig


getWriter

protected PrintWriter getWriter()
            throws IOException
Get the output Writer. Override with method to generate web server specific configuration.
Overrides:
getWriter in interface BaseJkConfig


initProperties

protected void initProperties()
Initialize defaults for properties that are not set explicitely
Overrides:
initProperties in interface BaseJkConfig


setCertsIndicator

public void setCertsIndicator(String s)
What is the indicator for the client SSL certificated(default is SSL_CLIENT_CERT


setCipherIndicator

public void setCipherIndicator(String s)
What is the indicator for client SSL cipher suit (default is SSL_CIPHER)


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(String s)
What is the indicator for SSL (default is HTTPS)


setJkConfig

public void setJkConfig(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.

Parameters:


setModJk

public void setModJk(String path)
set the path to the mod_jk Apache Module

Parameters:


setSessionIndicator

public void setSessionIndicator(String s)
What is the indicator for SSL session (default is SSL_SESSION_ID)


Copyright B) 2000-2003 Apache Software Foundation. All Rights Reserved.