ModCFML

Config Options

The default Apache configuration of mod_cfml is as follows:

PerlRequire "/path/to/mod_cfml.pm"
PerlHeaderParserHandler mod_cfml
PerlSetVar LogHeaders false
PerlSetVar LogHandlers false
PerlSetVar CFMLHandlers ".cfm .cfc .cfml"


The following page describes what these options do and how to utilize them.

PerlRequire "/path/to/mod_cfml.pm"

REQUIRED. Path changes.

This line tells mod_perl where to find the mod_cfml module so that the perl code it contains can be compiled. Required Perl modules such as mod_cfml are compiled when Apache starts and run in system memory. mod_cfml is *very* small, and generates almost no memory-resident system footprint whatsoever.

PerlHeaderParserHandler mod_cfml

REQUIRED. Never changes.

This line tells mod_perl which part of the Apache Request Loop that mod_cfml should run in. In mod_cfml's current form, it runs during the HeaderParser phase of the Apache request loop. This is so that mod_cfml can inject new header data if necessary. Beyond this phase, header data should not be modifed.

PerlSetVar Logheaders false|true

Optional.
Values: "true" or "false"
Default: "false"

This variable tells mod_cfml to log the incoming request headers that it sees. The logs will contain both before, and after snapshots of incoming request headers. The main purpose of this logging function is to make sure mod_cfml is detecting incoming requests (load balanced instances, for example) and ensure that headers are being modifed as the request passes through mod_cfml.

Logs sent from mod_cfml are sent as "Notices" - which means they will bypass typical Apache loglevels. It is fairly important to keep these set to "false" for large sites, as setting it to "true" can put a huge strain on both processing time and IO Wait as massive log files are written. The main purpose of the mod_cfml logging options are for debugging purposes to ensure things are working properly. The logging functions were not written for or intended for every-day use.

IMPORTANT: Enabling logging is not recommended for high-traffic sites.

PerlSetVar LogHandlers false|true

Optional.
Values: "true" or "false"
Default: "false"

This variable tells mod_cfml to log how handlers are interpreted. First mod_cfml will log what it currently sees it's handlers as being (good for making sure you have your handlers set right), then it will log if the incoming request matches a handler value.

Again, all logs are sent to Apache as "Notices", so they bypass any Apache loglevel you may have set. Further, they are very IO and processing intensive. Logging is not recommended for every-day use.

PerlSetVar CFMLHandlers ".cfm .cfc .cfml"

Optional.
Values: [variable]
Default: ".cfm .cfc .cfml"

This variable is a space-delimited list of strings for mod_cfml to look for in an incoming reuqest URI. If the string is present in the request URI, then mod_cfml will attach the X-Tomcat-DocRoot header to the incoming request. Tomcat will then see that if the requested host has not been seen by Tomcat before.

For example, you could add the value ".jsp" to this attribute, and automatically create Tomcat hosts for JSP-based sites. Strangely enough, there is nothing about mod_cfml that requires it to only be useful for CFML sites.