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.
The first step in creating this setup is to get all the versions of Adobe ColdFusion we want to install.
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/.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
To connect the created sites follow the following step.
While the above should work for apache, I have had issues. So as an alternative here are the steps to manually connect Apache.
--snip--
JRunConfig Bootstrap 127.0.0.1:proxyportnumber
--snip--
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.