5

Does anyone have a good way to set up multiple CFML engines, and versions of them, together in a suitable environment for cross testing a CFML based application.

Ideally, I'd like this to be Ubuntu Server based as I'm using it with VirtualBox (under Windows 7). Plus it'd be helpful if it was possible to switch between, so my laptop can cope with one at a time rather than all running at once. I'm thinking of the following:

  • Adobe ColdFusion 9
  • Adobe ColdFusion 10
  • Railo 3.3.x
  • Railo 4.x
  • OpenBD 2.x

I'd also like to get them serving from the same shared directory, so I don't have to have a copy of the code for each engine. Cheers

Jeromy French
  • 11,812
  • 19
  • 76
  • 129
Mister Dai
  • 796
  • 1
  • 6
  • 19

3 Answers3

7

You mentioned being able to "switch between, so my laptop can cope with one at a time rather than all running at once", I'm guessing that you are thinking that each one will run on a different VM, or that they might require a huge amount of memory. I don't think you need to worry about that. Unless you require that they be on different machines, I think you could do this all on one VM and with one instance of a servlet container (like Tomcat).

From a high-level view, here is how I would do it.

  1. Install Tomcat
  2. Create or download .wars for each of the engines.
  3. Deploy said .wars to that one instance of Tomcat
  4. Set up Tomcat to use each of those servlets from a different host name (server.xml)
  5. Create a code directory outside of Tomcat for your one copy of the code
  6. Set up a Symbolic link in each webapp to link the code folder into the servlet

You should then be able to hit the same source from each engine by visiting the different host names in the browser.

I may be missing something. It has been a long time since I set something like this up. You'll likely need to make a bunch of tweaks (JVM settings, switching to Sun/ORACLE JVM vs. OpenJDK, etc).

I don't think running this many engines will cause you great trouble. In my experiences, for development, I have had 3 instances of CF9 running on Tomcat using only 189mb of RAM. And each additional instance did not increase that number by 1/3. Far less. It would not surprise me if you could run all of those handily with less than 512md of RAM. Possibly even 256mb if you are really hurting on memory.

I hope this helps.

Jason Dean
  • 9,585
  • 27
  • 36
  • Thanks Jason, I was thinking of having them all in a single VM. Useful to know that you didn't have much in the way of memory usage with the multiple instances, means I might just throw away that worry about not stopping / starting each of them. Sounds like a decent approach if I can get it all working nicely together, mostly curious about CF9/10 and how happy they'll be on non-Adobe-customised tomcat. – Mister Dai Aug 01 '12 at 20:51
  • I know CF9 will be fine. With CF10 I don't think you need to worry unless you use CGI.PATH_INFO. – Jason Dean Aug 02 '12 at 02:10
  • I'm using FW/1 which does rely on CGI.PATH_INFO for SES URLs. But there's a couple of fixes out there for that or (from what I understand) if CF10 is deployed as a WAR to tomcat then it's not an issue. – Mister Dai Aug 02 '12 at 07:09
  • wanted to thank you again. I've got this all up and running now with the engines sharing the same tomcat instance. Initially had a headache when I added CF10 on top of all the others but it turned out to be a mix of tomcat not having enough memory (128M default) and the PermGen space being too small to cope. – Mister Dai Aug 03 '12 at 11:53
2

For ColdFusion 10, Railo and OpenBD you would be looking at deploying with standalone installations of Tomcat, Jetty or JBoss.

ColdFusion 9, probably the easiest solution is "Enterprise Multiserver configuration" setup.

With these kinds of installation they are pretty much platform agnostic.

The things to be aware of are the web server, proxy and jndi ports that are used by each installation, but only if you want to run more than one server at a time.

After that it's whether you are bothered about proxying from apache or Nginx to the server instances and the connector you want to use.

No idea if this helps...

Peter Boughton
  • 110,170
  • 32
  • 120
  • 176
Stephen Moretti
  • 2,442
  • 1
  • 18
  • 29
  • Thanks, figured there might be some port conflicts to worry about, will be sure to watch out for that. Also could be useful to throw nginx / Apache in front of all of them to make it a little easier to access. – Mister Dai Aug 01 '12 at 20:57
  • Stephen, I updated your answer, but just to check it's what you're referring to... CF9 has "Enterprise Multiserver configuration" (i.e. JRun) and "J2EE configuration" (i.e. EAR/WAR) - [see here](http://www.neiland.net/files/gallery/multiserver-coldfusion-railo-install/cf_setup_multiserver_lrg.png) - I've assumed that by "Multi Server J2EE" you mean JRun, but figured I'd post this to make sure... – Peter Boughton Aug 01 '12 at 22:08
  • Hi Peter, yes the enterprise multi server configuration is what I meant. I tend to roll the j2ee ear/war deployment into the multi server install, because I don't actually use the multi server install until I have deployed a shiny new instance via an expanded ear file. – Stephen Moretti Aug 01 '12 at 23:48
1

Since you've mentioned the VirtualBox, I'll share my personal approach to this task. It includes few fairly simple steps:

  1. Install Ubuntu Server as VirtualBox guest (host is also Ubuntu).
  2. Set up only basic software like JVM and updates. Set up virtual
  3. machine networking as bridged adapter to use my Wi-Fi connection.
  4. Configure my Wi-Fi router DHCP to assign static IP for MAC address of the virtual machine.
  5. Add entry to my (host) system hosts: ip_assigned_to_vm virtual.ubuntu
  6. Set up guest additions and mount my ~/www directory inside the machine to access web applications.

Now, when I need another machine for experiments, or some other configuration of software (I've tested ACF 10 and Railo 4 this way) I do two things:

  1. Clone existing clean machine.
  2. Make sure it is using the same MAC address with bridged interface.

That's it.

It doesn't matter which of the machines I run, they all can be accessed as http://virtual.ubuntu (of course, it requires proper web-server configuration on the guest). Same time they are independent and it is completely safe to make anything I wish and test anything that runs on Ubuntu.

Obvious downsides are that I can run just one machine at a time, plus much more disk space is used. Not a problem to me.

I've tried approach with Tomcat and multiple WARs, but it has couple of issues: I can't use different JVM and Tomcat settings, also if I screw the setup -- all the Tomcat hosts are down.

Hope this helps.

Sergey Galashyn
  • 6,946
  • 2
  • 19
  • 39
  • The cloning tip is useful, saves me recreating guests if I mess anything up. Kind of need them all on the same host as I'd like to eventually automate the testing across all the different CFML engines. – Mister Dai Aug 01 '12 at 21:47
  • @MisterDai Personally I don't see much use of such automated testing because differences aren't crazy as in browsers. Unless you are using engine-specific code heavily AND need to run the code on many enviroments (but why would you do such thing to yourself?). – Sergey Galashyn Aug 02 '12 at 17:23
  • 1
    It's for my project "CFTracker" which monitors CFML engines and exposes internal information on Apps, Sessions, QueryCache etc... A lot of the work is done by dropping down to the Java internals of each engine as they're very different at that level. Sadistic enough I know and I give it away for free too :P – Mister Dai Aug 03 '12 at 11:50