Let’s say that your development, production and QA environments all want to play around with the ColdFusion administrator settings independantly of the actual application code. Development checks code into CVS, QA verifies it and a build is cut to production. What would happen if the administrator settings were different in each environment? Doesn’t sound like a very stable, or safe, process. One way around this is to have your ColdFusion root directory located completely outside your deployment path, perhaps even on a network drive. Here’s how to start.

  1. When installing ColdFusion, choose the J2EE installation with the WAR file option
  2. Once installation is complete, unpack (with any zip application) the WAR file to a temporary folder
  3. Now create a folder on the same mounted drive as where you’ll be running ColdFusion (Jboss) from where all persistent data will be held
  4. In your temporary folder, you’ll see a WEB-INF directory. Move the cfusion and cfclasses directory from there to the folder you create in step 3
  5. Now you can move the CFIDE and WEB-INF directories to the folder (or war file) of your web application

Now you’ll be modifying the WEB-INF\web.xml file in several places. Here’s an example – your deployment directory path for your application is…
C:\jboss-4.0.1\server\default\deploy\myapp.war

Now let’s say that when production gets a new build, that they must delete the entire JBoss directory and deploy a completely new one from the build. You want to house your persistent files outside of that directory, such as…
C:\PersistentData

In your myapp.war\WEB-INF\web.xml file, you must change the value for all instances of the following properties to point to your persistent data folder.

  • cf.class.path
  • cf.lib.path
  • cfRootDir

For this specific example, one value would be…

<context-param id="macromedia_context_89">
   <param-name>cf.lib.path</param-name>
   <param-value>../../../../../../PersistentData/cfusion/lib</param-value>
</context-param>

Once all are changed, ColdFusion – on startup – will now look in that location for all of its required libraries.