ModCFML

Config Options

The default Apache configuration of mod_cfml is as follows:

LoadModule modcfml_module modules/mod_cfml.so
CFMLHandlers ".cfm .cfc .cfml"
ModCFML_SharedKey "secret key also set in the Tomcat valve config"
# Optional, all for logging and debugging:
# LogHeaders true
# LogHandlers true
# LogAliases true
# VDirHeader false


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

LoadModule cfml_module modules/mod_cfml.so

This line tells Apache to load the mod_cfml module when Apache starts, so that it can be run in system memory. Mod_cfml is *very* small, and generates almost no memory-resident system footprint whatsoever.

CFMLHandlers ".cfm .cfc .cfml"

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

This variable is a space-delimited list of file extensions for mod_cfml to look for in an incoming request URI. All items need to start with the "." character.
The actual check is done on anything following the first "." (dot) in the requested filename. If the requested filename contains multiple dots, eg. "my.strange.name.cfm", then a match will be done on "strange.name.cfm", which will not match ".cfm".
Also be aware that the web directories do not contain a dot (".") in their name, as anything following the first dot will be regarded as file extension.

If the file extension is matched, then mod_cfml will add the mod_cfml headers to the incoming request. Tomcat will then use this information for a new web context (or web context host alias), in case it has not set up the web context 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.

ModCFML_SharedKey "secret key also set in the Tomcat valve config"

This is a two-way setting: it must either be set both in Apache httpd and in Tomcat, or at none of them. The Apache side simply adds an incoming header with the shared key value. The Tomcat side checks if a secret key is set in it's config, and if so, requires any incoming request to have the shared key in it's incoming "X-ModCFML-SharedKey" header.

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 the incoming request headers as they are after mod_cfml has done it's job. 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 Waits, 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, and not even if all seems to be running smoothly.

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.

LogAliases false|true

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

This variable tells mod_cfml if it needs to log the directory aliases it finds. This setting only has an effect if the VDirHeader setting underneath, is set to true (the default).

As said before, 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.

VDirHeader false|true

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

This variable tells mod_cfml if it needs to add the header X-VDirs. This header will contain a list of the directory mappings / virtual directories for the current web context.The information in this header is currently only used in Lucee, where it will recreate these mappings for the current request.