org.apache.jk.config

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

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

Author: Costin Manolache Larry Isaacs Mel Martinez Bill Barker

Field Summary
static StringJK_LOG_LOCATION
default mod_jk log file location
static StringMOD_JK
default location of mod_jk Apache plug-in.
static StringMOD_JK_CONFIG
default path to mod_jk .conf location
static StringWORKERS_CONFIG
default path to workers.properties file This should be also auto-generated from server.xml.
Constructor Summary
ApacheConfig()
Method Summary
protected booleanaddExtensionMapping(String ctxPath, String ext, PrintWriter mod_jk)
Add an Apache extension mapping.
protected booleanaddMapping(String fullPath, PrintWriter mod_jk)
Add a fulling specified Appache mapping.
protected booleanaddMapping(String ctxP, String ext, PrintWriter mod_jk)
Add a partially specified Appache mapping.
protected voidgenerateContextMappings(Context context, PrintWriter mod_jk)
protected booleangenerateJkHead(PrintWriter mod_jk)
Generate the loadModule and general options
protected voidgenerateSSLConfig(PrintWriter mod_jk)
protected voidgenerateStupidMappings(Context context, PrintWriter mod_jk)
Forward all requests for a context to tomcat.
protected voidgenerateVhostHead(Host host, PrintWriter mod_jk)
protected voidgenerateVhostTail(Host host, PrintWriter mod_jk)
protected PrintWritergetWriter()
protected voidinitProperties()
Initialize defaults for properties that are not set explicitely
voidsetCertsIndicator(String s)
What is the indicator for the client SSL certificated(default is SSL_CLIENT_CERT
voidsetCipherIndicator(String s)
What is the indicator for client SSL cipher suit (default is SSL_CIPHER)
voidsetExtractSSL(boolean sslMode)
By default mod_jk is configured to collect SSL information from the apache environment and send it to the Tomcat workers.
voidsetHttpsIndicator(String s)
What is the indicator for SSL (default is HTTPS)
voidsetJkConfig(String path)
set the path to the output file for the auto-generated mod_jk configuration file.
voidsetModJk(String path)
set the path to the mod_jk Apache Module
voidsetSessionIndicator(String s)
What is the indicator for SSL session (default is SSL_SESSION_ID)

Field Detail

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 Detail

ApacheConfig

public ApacheConfig()

Method Detail

addExtensionMapping

protected boolean addExtensionMapping(String ctxPath, String ext, PrintWriter mod_jk)
Add an Apache extension mapping.

addMapping

protected boolean addMapping(String fullPath, PrintWriter mod_jk)
Add a fulling specified Appache mapping.

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)

generateJkHead

protected boolean generateJkHead(PrintWriter mod_jk)
Generate the loadModule and general options

generateSSLConfig

protected void generateSSLConfig(PrintWriter mod_jk)

generateStupidMappings

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

generateVhostHead

protected void generateVhostHead(Host host, PrintWriter mod_jk)

generateVhostTail

protected void generateVhostTail(Host host, PrintWriter mod_jk)

getWriter

protected PrintWriter getWriter()

initProperties

protected void initProperties()
Initialize defaults for properties that are not set explicitely

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: path String path to a file

setModJk

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

Parameters: path String path to a file

setSessionIndicator

public void setSessionIndicator(String s)
What is the indicator for SSL session (default is SSL_SESSION_ID)
Copyright © 2000-2011 Apache Software Foundation. All Rights Reserved.