Application Layer Switching Module for Apache

Apache Configuration Directives

This section document contains list of supported configuration directives.

NOTE: This module requires services of mod_proxy (mod_proxy_http, mod_proxy_ajp, ..) for reverse proxy operations. Thus, in order to operate properly mod_proxy and mod_proxy_http have to be present in the server. See configuration examples.

<L7Pool>

Description: Specify a load balancing pool with name poolname
Syntax: <L7Pool poolname> ... </L7Pool>
Context: Server configuration
Default value: none
Status: Available since version 0.1.0

L7PoolMember

Description: Specify a pool member and it's attributes for this load balancing pool
Syntax: L7PoolMember url [key=value] ...
Context: Within L7Pool directive
Default value: none
Status: Available since version 0.1.0

info As mod_layer7 uses mod_proxy for reverse-proxy operations you can configure pool members using AJP13,FTP,CONNECT or HTTP protocols. Just remember to load and configure required mod_proxy_ajp, mod_proxy_http, etc.. modules properly. See mod_proxy documentation for more details.

warning If you use balancer pools then persistence and load balancing decisions are handled by mod_proxy_balancer.

warning Currently only http pools have been used/tested. Other pool types might not work properly (or at all).

L7PersistMethod

Description: Specify a persistency method and related attributes to this load balancing pool
Syntax: L7PersistMethod method-name [key=value] ...
Context: Within L7Pool directive
Default value: none
Status: Available since version 0.1.0

cookie-insert

source-address

L7BalancingMethod

Description: Specify a load balancing method for this load balancing pool
Syntax: L7BalancingMethod method-name [key=value] ...
Context: Within L7Pool directive
Default value: round-robin
Status: Available since version 0.1.0

round-robin

weighted-round-robin

fastest-response-times

request-uri-hashing

random

L7RedirectRewrite

Description: Specify HTTP redirect rewrite behaviour for this load balancing pool
Syntax: L7RedirectRewrite mode [key=value] ...
Context: Within L7Pool directive
Default value: none
Status: Available since version 0.1.0

L7CookieRewrite

Description: Specify HTTP Cookie name rewriting behaviour for this load balancing pool
Syntax: L7CookieRewrite clientside serverside [key=value] ...
Context: Within L7Pool directive
Default value: none
Status: Available since version 0.1.0

L7PoolMonitor

Description: Specify pool monitor configuration for pool members
Syntax: L7PoolMonitor monitor-name [key=value] ...
Context: Within L7Pool directive
Default value: round-robin
Status: Available since version 0.1.0

L7PoolMonitor directive can be used for associating pool monitoring configurations with configured pool members.

http

warning Describe parameters supported by http monitor.

icmp

warning Describe parameters supported by icmp monitor.

L7DefaultPool

Description: Specify default pool to be used for processing requests
Syntax: L7DefaultPool pool-name
Context: Within L7Pool directive
Default value: first configured L7Pool
Status: Available since version 0.1.0

...

L7PerlScript

Description: Specify perl script file that contains L7EventFunction definitions.
Syntax: L7PerlScript filename
Context: Within L7Pool directive
Default value: none
Status: Available since version 0.1.0

Specify the script file from where the event functions are loaded.

L7PerlInclude

Description: Specify additional Perl include path
Syntax: L7PerlInclude /path/to/perl/modules
Context: Within L7Pool directive
Default value: none
Status: Available since version 0.1.0

With this directive you can specify additional Perl include pages if you have some own Perl modules you want to use in L7PerlScript containing L7EventFunction definitions.

L7EventFunction

Description: Specify perl sub-routine for different events
Syntax: L7EventFunction event routine-name
Context: Within L7Pool directive
Default value: none
Status: Available since version 0.1.0

Define the sub-routine to be called during different steps of request processing cycle. See L7PerlScript for more information on how to load event functions/sub-routines...

ON_REQUEST

...

ON_REQUEST_DATA

...

ON_RESPONSE

...

ON_RESPONSE_DATA

...

ON_LBFAILURE

...

Examples

Example configuration with:

# load mod_proxy module(s) required for reverse proxy operations..
LoadModule proxy_module      /opt/local/apache/2.2.15+dso/modules/mod_proxy.so
LoadModule proxy_module_http /opt/local/apache/2.2.15+dso/modules/mod_proxy_http.so
LoadModule proxy_module_ajp  /opt/local/apache/2.2.15+dso/modules/mod_proxy_ajp.so

# load mod_layer7 module
LoadModule layer7_module /opt/local/mod_layer7/0.1.0/modules/libmod_layer7.so

# Pool for web-application (tomcat)
#
# NOTE: first defined pool is default pool 
#       use L7DefaultPool to override/explicitely define default pool

<L7Pool "dynamic-pool">
  L7PoolMember "ajp://10.0.0.12:5090" ratio=1.0
  L7PoolMember "ajp://10.0.0.13:5090" ratio=1.0
  L7PoolMember "ajp://10.0.0.14:5090" ratio=0.5

  L7BalancingMethod "round-robin"
  L7PersistMethod   "cookie-insert"
</L7Pool>

# pool of normal HTTP servers for static content
# (eg. images, css files, ...)

<L7Pool "static-pool">
  L7PoolMember "http://10.0.0.20" ratio=1.2
  L7PoolMember "http://10.0.0.21" ratio=1.0
</L7Pool>

# You could also use mod_proxy_balancer pools
# 
# <L7Pool "balancer-pool">
#  L7PoolMember "balancer://mycluster"
# </L7Pool>  
#
# <Proxy balancer://mycluster>
# BalancerMember http://192.168.1.50:80
# BalancerMember http://192.168.1.51:80
# </Proxy>
# 

L7DefaultPool     "dynamic-pool"
L7PerlScript      "example1.pl"

# define sub-routine names to be called on different 
# events during HTTP request processing cycle.
# 
L7EventFunction ON_REQUEST   on_request
L7EventFunction ON_RESPONSE  on_response
L7EventFunction ON_LBFAILURE on_lbfailure
# L7EventFunction ON_STARTUP   on_startup
# L7EventFunction ON_SHUTDOWN  on_shutdown

Get mod_layer7 for Apache 2.x at SourceForge.net. Fast, secure and Free Open Source software downloads