I've been working on some code which needs to be able to run on ColdFusion and Railo. There are several posts about running them on top of a servlet container or JEE server, but I've gone for a quick and dirty solution which I use on Windows.
I have ColdFusion installed as standalone connected to an Apache webserver (it could be IIS it makes no difference). I have also downloaded and extracted the Railo Express version which runs on Jetty to c:\webserver\railo-express (where you extract it is not important as long but avoid spaces).
You can fire up Railo by finding the start.bat file in the C:\webserver\railo-express directory. After a couple of seconds you'll be able to browse to http://localhost:8888 and see the Railo welcome screen. As Railo is running on port 8888.
If port 8888 is already in use (or you want to run on port 80) you can choose a different port by editing the following line in the jetty.xml configuration file.
<Set name="port"><Property name="jetty.port" default="8888"/></Set>
If you do choose port 80, make sure that IIS and the Apache webserver are not running.
Railo will run code in the C:\webserver\railo-express\webroot\ directory. Obviously i only want one version of my code so copying code from the ColdFusion webroot to the Railo webroot is not an option.
Thanks to Gert from Railo for pointing out in the comments that you can just edit the Railo.xml file to point to your existing webroot by editing the line:
<Set name="resourceBase"><SystemProperty name="jetty.home" default="."/>/C:/webserver/htdocs/</Set>
Or, instead, I can create a "virtual folder" in the Railo webroot which links to the ColdFusion webroot. This is called a Symbolic Link and you can do it in Windows 7 by firing up a DOS prompt (type cmd into the "search box" on the Windows 7 start menu or use the "run" dialog).
Change the current working directory to the Railo webroot by typing in:
Now create the symbolic link to the directory where you have your ColdFusion webroot.
mklink wwwroot C:\webserver\htdocs /D
If you run that command you should see:
symbolic link created for wwwroot <<==>> C:\webserver\htdocs
Now you can run the code in the ColdFusion webroot via Railo Express by doing:
If ColdFusion is running at the same time then you can run the same script at the same time in two different CFML engines. This isn't a perfect solution (see Matt Woodwood's post on how to do it better) but it's quick and easy :)