Welcome!

ColdFusion Authors: Yakov Fain, Pat Romanski, Liz McMillan, Maureen O'Gara, Greg Ness

Related Topics: ColdFusion

ColdFusion: Article

CFDJ Feature — It Is Possible!

Simultaneous development with CF7 and CF8

Now that Scorpio is here (at least in beta), it is time to start figuring out all the new tricks of the trade, right? However, as most of your clients will not be switching immediately, you will still have to be doing ColdFusion 7 work for some time.

How do you run both ColdFusion 7 to support your current clients and ColdFusion 8 to keep your development skills sharp? You could run one using the built-in Web server, but that's not really the same as your production systems. Instead, let's take a look at using the multiserver configuration option to run both CF7 and CF8 instances simultaneously and under your choice of Web server. The problem is, the system requirements for CF7 and CF8 are not compatible with each other, right? Yes and no...it's not quite out of the box, but it is possible to have complete working copies of each, running in complete parallel. The key is using the multiserver configuration and the JVM config.

ColdFusion Multiserver Configuration
For those who have never worked with the multiserver configuration (myself included until a few months ago), what is it? During the installation process for ColdFusion, the installer prompts you to select a server configuration option (see Figure 1). There are three options: single server (default), multi-server, and J2EE deployment. The single server option allows you to install a single copy of ColdFusion on your development workstation and connect it to your Web server of choice. This was always the route I took and I expect many did as well.

The J2EE deployment option gives you the ability to set up ColdFusion as an EAR or WAR file that can then be deployed to a Java application server such as JRun or Tomcat. If this went straight over your head, you probably need to know more about Java servers and this option won't be a lot of use to you - who needs a Java server if you can use the single self-contained server option, right?

The second option - multiserver deployment - is the one we are going to look at here. This option installs a full copy of Adobe's JRun 4 application server and then installs an instance of ColdFusion as a Web application on that Java application server. Adobe has set this up so that you can manage the different server instances deployed (including ColdFusion) through the ColdFusion administrator and never have to log into the JRun administrator. This is very nice for those of us who don't want to or don't have the time to become Java application server experts.

What Multiple Instances Give You
There are many benefits to setting up ColdFusion in a multiserver configuration. By going this route, you can deploy multiple instances of ColdFusion on the same server - hence the "multi-server" configuration. There are many benefits from a production standpoint including adding additional security between applications in the form of sandboxes and fine-tuning the JVM settings to boost the performance of different applications.

From a developer's standpoint, especially on our own development workstations, a multi-instance deployment of ColdFusion also provides several benefits. First, we can configure different settings including ColdFusion mappings and data sources for different applications. Have you ever had two applications that use the same framework but different versions? Both require the same mapping to be set up, but the mapping points to different file system locations. With a multi-instance deployment of ColdFusion you can put each application in its own ColdFusion instance, as you can configure the mappings and any other settings uniquely for each application.

The second and more important benefit in this case is that you can set different instances of ColdFusion to run using different JVMs. This is critical when trying to set up both ColdFusion 7, which only supports up to JVM 1.4.2, and ColdFusion 8, which will support JVM 1.4.2 but is better suited and performs better on the latest JVM (1.6).

The Install
Let's walk through the process of setting up a ColdFusion development workstation with both ColdFusion 7 and ColdFusion 8 deployed side-by-side. First a bit of background as to how I am putting together these instructions: my workstation does not have ColdFusion installed at all, so I am starting clean. Also, my workstation is running Windows Vista, so it already prefers the latest JVM, and, last, I am using IIS 7 for my Web server. This is not a big deal, although there are still a few issues regarding the JVM that we will walk through at that point.

Since I am running Windows Vista, I'm going to start with the ColdFusion 8 installer. You could easily do this process in reverse, but the ColdFusion 7 installer and Windows Vista don't play as nicely together as it is an "unsupported operating system." The first step is to run the ColdFusion 8 installer, agree to the license, and select the Developer Install (in my case). At this point, you will be prompted to select the installer configuration (see Figure 1).

For this install, select the multiserver configuration option. As mentioned previously, this will install a copy of Adobe's JRun 4 server, then install and deploy ColdFusion as a Web application on that server. By going this route, we can install an instance of ColdFusion 8 side-by-side with an instance of ColdFusion 7, which is our end goal.

At this point, the installation goes pretty much the same way as a single server configuration would. There are two things to take note of, however. When the installer asks for different path names (i.e., the CF Administrator location), remember that we will be installing both ColdFusion 7 and ColdFusion 8, which will utilize different CFIDE folders. My recommendation, and what has worked for me thus far, is instead of putting the CFIDE folder in c:\inetpub\wwwroot, put it in c:\inetpub\cfmx8root or c:\inetpub\cfmx7root. This way it is obvious later on which CFIDE folder belongs to which version.

The other thing to take note of is when the installer asks which Web site(s) to configure for use with ColdFusion. Again, in my case I am using IIS, so this may look a bit different based on your choice of Web server. With IIS, the installer gives you the option of installing to all Web sites, selecting one or more Web sites, or using the built-in Web server (see Figure 2).

On my first attempt, I selected "All IIS Websites" and this caused me quite a few headaches down the road. On my second attempt, I wised up and specified to only install and configure ColdFusion for the Default Web Site. By selecting this option, it's much easier to configure new Web sites down the road to communicate different instances of ColdFusion.

At this point, you should be good to go with the rest of the ColdFusion installation.

Your First ColdFusion Instance
When you log into the ColdFusion administrator after the installation, you should see a new menu item on the left-hand navigation menu called "Enterprise Manager" with a sub-link of "Instance Manager" (see Figure 3).

This screen is where you will add and remove instances of ColdFusion without having to use the JRun management console. Let's take a quick moment to look at the process of adding a new ColdFusion instance. First, click on the "Instance Manager" link under "Enterprise Manager." Then, click the "Add New Instance" button. You should see a screen similar to Figure 4 prompting you for information about the new instance/server.


More Stories By Jeff Chastain

Jeff Chastain has been developing software applications using object-oriented programming for over 12 years and has been developing Web applications in ColdFusion for over 8 years. He has experience in a variety of industries, from Fortune 500 companies to his own consulting practice. Currently, Jeff is an applications architect and systems developer for Alagad, Inc., and contributes to the blog at http://www.doughughes.net.

Comments (7) View Comments

Share your thoughts on this story.

Add your comment
You must be signed in to add a comment. Sign-in | Register

In accordance with our Comment Policy, we encourage comments that are on topic, relevant and to-the-point. We will remove comments that include profanity, personal attacks, racial slurs, threats of violence, or other inappropriate material that violates our Terms and Conditions, and will block users who make repeated violations. We ask all readers to expect diversity of opinion and to treat one another with dignity and respect.


Most Recent Comments
marc_44 09/19/09 06:06:00 AM EDT

Hi,
I tried to install Coldfusion 8.01 and Coldfusion 9Beta on Windows 7 as described in this article. I succeeded to install the ear file in Jrun4 but I cannot get IIS7 or Apache (2.28) to recognize the installed Aplication server. In IIS 7 I make a website and use the Adobe Webserver connector to install the connector, in Apache I use Virtual Hosts and add the modified lines about serverstore and bootstrap. Did anyone succeed?
Marc

Gabriel Rose 04/29/08 10:10:20 PM EDT

I was also getting the service-specific error 2 - it appears the installer for JVM 1.4.2 overwrote the version of the JVM in the Jrun4/jre directory. The original version was Version 6 which has been changed to 1.4.2. I had backed up the JRun4 directory before installing so copied the original jre folder back. Now all the services are starting happily.

David Brown 01/11/08 08:25:49 PM EST

Hi Eric, We have the same issue with our 2 servers that are running the multi instances. I have not tried to worry about it since I really don't need to start them that often. I hope someone can help.

Eric Davis 01/11/08 05:58:42 PM EST

I've got 2 cf8 instances and 2 cf7 instances installed. The odd thing is that the jrun launcher and cf administrator don't recognize that the cf7 instances are running. I can stop and restart them just fine using the JRun Launcher, but only after I use the Windows Service MMC to stop the services. Any ideas on why this is happening?

Drew 11/27/07 10:13:28 AM EST

This doesn't *actually* work. There is a bug in CF8 where it doesn't know where the CFIDE is mapped to. You must set this in neo-runtime.xml. I couldn't figure out where to put the tag and only after putting it inside every did it actually work. Here's the line:
c:\inetpub\cfmx8root

After coldfusion loads administrator control correctly, it destroys the nice formatting of this file and it becomes one long line.

Marc 09/03/07 05:14:50 AM EDT

Thanks, This helped a lot. I figured out how to use CF7/CF8 on Apache/Jrun4. Interested? Mail me.

David Brown 08/12/07 09:40:28 PM EDT

I have followed the steps of this article, but continue to get a error every time I try to start the Adobe ColdFusion 7 as CF7 service added from the command prompt. In Jrun Console I can see the CF7 server running and I did copy the config file and changed home to java.home=c:/j2sdk1.4.2_15/jre
The service installs fine, but when I try to start it in services I get the following error.

The Adobe ColdFusion 7 AS CF7 service terminated with service-specific error 2 (0x2).

Any suggestions?