Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Multi-CFML engine test environment

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

like image 738
Mister Dai Avatar asked Aug 01 '12 19:08

Mister Dai


3 Answers

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.

like image 180
Jason Dean Avatar answered Oct 13 '22 12:10

Jason Dean


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...

like image 26
Stephen Moretti Avatar answered Oct 13 '22 11:10

Stephen Moretti


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.

like image 22
Sergey Galashyn Avatar answered Oct 13 '22 11:10

Sergey Galashyn