CF9 CF8 Railo Multiserver Install Under JRUN

Published: {ts '2011-06-23 00:00:00'}
Author: Steven Neiland
Site Url: http://www.neiland.net/article/cf9-cf8-railo-multiserver-install-under-jrun/

As time goes by more and more often I find myself developing on different versions of ColdFusion and even on different CFML Engines such as Railo. To make cross engine testing easier I recently configured my development environment with Adobe CF8 & CF9 with Railo all running on a JRUN multiserver setup on windows.

Here I will detail the steps I took to configure this.

Step 1: Download the Install Files

The first step in creating this setup is to get all the versions of Adobe ColdFusion we want to install.

Download Adobe ColdFusion

Download CF9 Here

Download CF8 Here

Download CF7 Here

Download Railo

When you go to download Railo you do not want the installer package. Instead you want to get the WAR file.http://www.getrailo.org/index.cfm/download/.

Step 2:Install CF9 in Multiserver Configuration

For this setup we will use JRUN as the servlet engine. The easiest way to do this is to install ColdFusion 9 in multiserver configuration. To do this download the CF9 installer (link above) and run the installer. When you get to the "installer configuration" screen select "MultiServer" and continue as normal.

Install patches

At this stage you should download and install all the patches for cf9 to the server. This means we are going forward with the most secure configuration.

Step 3: Create a CF9 Instance

Once the patches are installed open the instance manager and create an instance for cf9. As we are using a fully patched CF9 install all the applied cf9 patches will be replicated to create this instance.

Step 4: Install CF8 as a J2EE EAR

Unlike when we created the CF9 instance, in order to create a CF8 instance we need a WAR file or an EAR file. To create this file, run the ColdFusion 8 installer. When you get to the "Installer Configuration" screen as before, select "J2EE Configuration". Complete the setup and save the created the WAR/EAR file.

Now that the file is create, go back into the main ColdFusion administrator and create a new instance. This time we name it CF8 and specify the EAR/WAR file we just created.

Step 5: Install Railo

Unlike ColdFusion, you can download the Railo WAR file directly from the getrailo.org website. Simply download the WAR file and save it. Then repeat the process of creating an instance through the ColdFusion administrator.

Step 6: Access the Instances Administrator Panels

At this stage we have all three CFML engines running so the next step is to configure them as we need. We can access the admin panels for CF9 and CF8 instances directly from the root administrator or we can type the path in directly. For reference here are the paths for my configuration.

ColdFusion Admin Urls

  • Root: http://127.0.0.1/CFIDE/administrator/index.cfm
  • CF9: http://127.0.0.1:8301/CFIDE/administrator/index.cfm
  • CF8: http://127.0.0.1:8302/cf8/CFIDE/administrator/

Accessing Railos Admin

As Railo uses a different path structure to access its administrator you will get an error if you try to access its administrator from the instances list. Also Railo has two admin panels Server and Web.

The Server admin which is a global administrator similar to ColdFusions admin. The Web admin is a per context administrator which normally allows for each site to have its own unique configuration, however because we are using JRUN we can only have one context for railo (as thats all jrun can handle per instance.

In order to get onto the Railo admin panels use these urls.

  • Railo Server Admin: http://127.0.0.1:8303/railo-context/admin/server.cfm
  • Railo Web Admin: http://127.0.0.1:8303/railo-context/admin/web.cfm

A note on Openbluedragon

While technically this technique should work for OpenBD, on my system I got a 403 error when trying to access any cfm file. (jsp files worked though). I have not found a solution to date for this and since I have not "yet" worked on an OpenDB server I have not put too much time into trying to figure this out.

If you want to use OpenBD I would actually switch away from JRUN altogether to tomcat or jetty. Several people have noted that tomcat is faster and leaner than JRUN. In addition Coldfusion X will use tomcat so maybe now is a good time to get ready for the switch.

Step 7: Create Domains For Each Project and CF Server

Now that we have our ColdFusion/Railo servers running we need to connect our webserver to direct traffic for different domains to each one.

The way I handle multiserver testing is to use a single code directory for a project but to have a separate sub domains for each cf server I want to run the code on. So for example if I am developing a project and I want to test it on all 3 instances I setup 3 domains for it.

To do this open your "hosts" file with notepad and paste in the following lines. For me it was located in "C:\Windows\System32\drivers\etc". Note that it may be hidden as it is a system file with no extension so you may have to enable visibility on hidden files and folder.

127.0.0.1 cf9.myproject.localhost 127.0.0.1 cf8.myproject.localhost 127.0.0.1 railo.myproject.localhost

With your changes saved, your web browser will always go directly to localhost for these domains.

Step 8: Create IIS Sites/Apache VHosts for each Project/Domain

With the domains created we now need to create websites on the server for the project and connect them to the relevant CFML instance.

I am assuming that you know how to create a site in IIS or a vhost in Apache so I'll skip the details. Just know that you want to create one site/vhost for each cfml/domain instance you want matching the domains you created in your hosts file.

Step 9: Connect Sites To Instances

To connect the created sites follow the following step.

  1. Open the JRUN folder and run the webservice configuration tool located there. On my machine this was located at "C:\JRun4\bin\wsconfig.exe".
  2. Click Add
  3. Enter your JRUN host. This should be your desired site/vhost.
  4. Select your JRUN server. This is where we choose the actual cfml instance we want to run for this server.
  5. Select your webserver (IIS or apache)

Step 9 Alternative: Apache

While the above should work for apache, I have had issues. So as an alternative here are the steps to manually connect Apache.

  1. Open the jrun administrator and supply the username and password you setup for the root ColdFusion administrator. http://127.0.0.1:8000
  2. Note down the proxy port of the instance you want to use for a particular vhost
  3. Open your vhosts file and add the following line to the desired vhost substituting the proxy port from the jrun administrator
--snip-- JRunConfig Bootstrap 127.0.0.1:proxyportnumber --snip--

In Conclusion

Ok folks so there you have it. Mutliple cfml engines running on one machine using JRUN.

Note that there are many permutations of this configuration, and that this is only how I do it. In addition CF10 will run on Tomcat so you may want to consider switching to that now.

Hope this helps.