Web Contexts and Component Configuration

←Previous

Web Contexts and Component Configuration

Next →


Web Contexts Overview


A Note on Terminology

Please note that although there may be technical differences, for our purposes, we will use the terms Java servlet container and J2EE application server interchangeably. This document is intended to provide knowledge of these components' interactions with CFMumps sufficient to allow the reader to effectively run and administer CFMumps and CFMumps applications. It is not intended to provide the reader with a deep technical understanding of J2EE or Java servlet technology, as such things are better covered by documentation specifically suited to that endeavor.

Java Servlet Containers/J2EE Application Servers

All modern CFML platforms are implemented as J2EE servlets, running in what is known as a Java Servlet Container or J2EE Application Server. Examples of these include:

  • Apache Tomcat (default container shipped with the Lucee and Railo installers, as well as Adobe ColdFusion 10 and newer)
  • Adobe JRun (shipped with Adobe ColdFusion 9 and older)
  • Oracle GlassFish (originally developed by Sun Microsystems)
  • Eclipse Jetty (developed by the Eclipse Foundation)
  • IBM WebSphere family:
    • IBM WebSphere Application Server (now known as "traditional WebSphere Application Server", or "tWAS"; originally shipped in 1998)
    • IBM WebSphere Liberty (a modern, lightweight, and modular re-work of the original WebSphere)
    • Open Liberty (a standalone, open source project, which provides the core features of WebSphere Liberty, minus several IBM-specific enterprise components)

In all of these servlet containers, CFML application servers (as well as other J2EE applications) are deployed as one or more WAR (Web ARchive) files, an extended version of the JAR (Java ARchive) format. 

The Web Context

In J2EE parlance, a web context is essentially a single web-based application (note that this definition isn't entirely precise, but will suffice for our purpose of managing CFMumps' use of web contexts), consisting generally of a document root, being a place where CFML, CFScript, HTML, JavaScript, CSS, and other application assets can be stored, as well as some sort of virtual host definition, being the host name or network address at which the contained application will respond, as defined by the servlet container's web server configuration (such as server.xml in Apache Tomcat and others). Each web context contains a WEB-INF/ subdirectory directly beneath its document root, which is where the servlet container/application server places files specific to that particular web context, in our case including context-specific log files and configuration files for the CFML platform (such as Lucee or Adobe ColdFusion).

In the standard Lucee/Tomcat deployment of CFMumps, the Apache web server is configured as a reverse proxy running in front of Tomcat and connecting to it via AJP, or the "Apache JServ Protocol". An Apache module called mod_cfml maintains synchronization between Apache's virtual host configuration and the servlet container's virtual host configuration. On startup, the servlet container will make sure that a WEB-INF/ subdirectory exists and is up-to-date within the web context's document root.

The CFMumps Component Library

In order to develop CFMumps applications, the entire contents of the lib/ subdirectory in the CFMumps distribution (i.e. /opt/cfmumps/lib) must be copied into the document root of each CFMumps application's web context. This will enable access to the CFMumps ColdFusion Components (CFCs), in which the CFMumps APIs are defined. This can be accomplished with the following commands, presuming that CFMumps is installed at /opt/cfmumps. If CFMumps is installed elsewhere, replace /opt/cfmumps accordingly:

Deploying CFM
/opt/cfmumps/bin/cfmumps deploy --components --root=</path/to/document/root> --connector=<GTMJI|CacheExtreme|REST|MWire>