ColdFusion Muse

Running ColdFusion 10 in Distributed Mode

Mark Kruger October 20, 2014 5:22 PM ColdFusion Comments (6)

A recent discussion on CF-Talk had a member trying to find instructions for setting up ColdFusion in "Distributed mode" on a CF 11 server. If you have never heard of "distributed mode" you are not alone among CF developers. It's not a common setup in my experience. Here's a quick 101. Many processes and daemons on a given server communicate using the TCP stack. TCP provides a predictable, high capacity, mature protocol for piping requests and data in and out of server processes. In this case, IIS or Apache communicate with CF through the local loopback (localhost or 127.0.0.1) IP address and a port - usually 8012 (or 8013 or 8014) chosen at installation. Naturally you can alter the IP address to which you are connecting, changing it from the loopback to... well any IP that's listening on 8012. That means you can set up your ColdFusion servers separately from your web servers. After all it's just IP networking. Why would you do that? The Muse will let his guest handle that question.

Meanwhile, to preempt (or perhaps spur) discussion, the Muse will note that this process is similar to something called "Reverse proxy" which functions in much the same way. The difference being with CF distributed, IIS on the front end handles all the "http stuff" and passes the request to CF just like it was a local engine, whereas with reverse proxy the HTTP request is simply redirected to the alternate server. That means the alternate server needs to be a full webserver plus application server. While that increases the overhead a bit, it has some advantages - but that's a topic for a different post.

Back to our CF-Talk question, it quickly became apparent that not many folks actually knew how to accomplish this task on a CF 10 (or 11) server due to the underlying platform switch to Tomcat. After some back and forth Byron Mann chimed in with some very specific instructions on how to get this done. Byron is a lead engineer at HostMySite - which makes the Muse feel better about their ColdFusion support. :) Here's his tutorial.

Read More
  • Share:

6 Comments

  • Mike Collins's Gravatar
    Posted By
    Mike Collins | 10/21/14 9:01 AM
    Also, Check out the Clustering session from cfsummit 2014. They cover this topic, make some good recommendations, and also did some screen capture videos that can help you get this setup.
  • Ed Andrade's Gravatar
    Posted By
    Ed Andrade | 10/21/14 10:23 AM
    I prototyped the same idea for my client, except we run our app servers on Ubuntu with Apache HTTP server connected to Tomcat (AJP connector) for CF. We use non-sticky sessions in our clusters so each request can be handled from any server in the cluster.

    I configured Apache to know about all the Tomcat instances in the cluster even though it would use the local one by default first. But if for some reason Tomcat died on the local server, and Apache was still up, it would fall over to the next Tomcat instance, so on and so forth until it got to the end of the line trying to find a working Tomcat instance. Because of the age of some of the system we have outside of CF we actually have Tomcat 6 & 7 running on each app server, so Apache had two fallover settings, one for Tomcat 6 and the other for 7. It was pretty cool to see in operation, to bad they did not implement it. Oh well. Fun learning experience!
  • Mark Kruger's Gravatar
    Posted By
    Mark Kruger | 10/21/14 10:32 AM
    @Mike,

    Great! I'll see if I can scare up a link.

    @Ed,

    Awesome information Ed. Thank you. Sounds complex - but redundancy always is I guess :)
  • Matthew C Parks's Gravatar
    Posted By
    Matthew C Parks | 12/22/14 9:05 AM
    I am currently in-process of setting up new servers to use Distributed Mode in our new production set up. Where I agree it is an uncommon set up, I have used in the past with UNIX and Apache and has worked well. I am running into an issue with IIS and the context root set up.

    Web server talks to CF App server over 8011 port, confirmed that works with C:\{instance_name}/wwwroot/index.cfm page getting executed. But attempting to switch to D:\website\site1 situtation is not working.

    So my question is two fold. Can we have a Distributed Mode set up to run more than one web site on one instance of CF 11? That is what we really need at end of day, but as it stands I can not even get one to one working with a different web root other than the default wwwroot for the installed instance. Any suggestions, please.
  • Matthew C Parks's Gravatar
    Posted By
    Matthew C Parks | 1/12/15 2:55 PM
    One solved and another issue has come up.

    We were able to resolve the Multihoming issue with CF and Distributed Mode (DM). The instance server.xml was modified to have multi virtual hosts.

    The second issue we are facing, is the securing the communications between CF and IIS with the DM set up. The "packet sniffers" show the data id not encrypted. User comes in on HTTPS to site, site is severed no problem. With IIS and CF on the same server, data is encrypted no problem. DM caused the data to not be encrypted.

    I was wondering if you had any suggestions or ideas on where I might look to get this resolved.
  • naga's Gravatar
    Posted By
    naga | 2/5/16 1:50 AM
    I have one problem with apche virtual hosting + CF11.

    I am using apache with CF11 and virtual hosting document root on NFS mounted folder. when I access my cf test page from that document root folder I am getting "Define the page request properties. " message on browser. No data coming.. any idea what could be the problem.

    Also If I use local folder instead of NFS mounted folder for apache virtual host document root I am getting results fine.

    I have verified the permissions and everything looking good.

    One more thing is this is working fine in Apache + CF8