The amazing adventures of Doug Hughes

On my development machine, I run ColdFusion 7 in ‘multi-server’ mode. This comes in handy if you need to create a separate instance of ColdFusion because of needs of a project or client. I also run Apache as my web server. While I am not a big fan of the httpd.conf file (mostly out of lack of familiarity), it makes it a lot easier to run multiple web sites on Windows XP. (Yes, I know there are tools that allow you to do this with IIS, but all the ones I have tried have been buggy and made messing with httpd.conf a pleasant experience). I also add sites to my HOSTS file and give them a ‘domain’ of ‘dev’ (, for example). This makes it easier for me to keep track of which environment I am in, and in a lot of cases, save some typing as I usually abbreviate the project (, for example).

Like most ColdFusion developers, I wanted to play with ColdFusion 8 when it went into public beta. I wanted to be able to use ColdFusion 8 and not have to deviate much from my development practices. I wound up installing ColdFusion 8 as a .ear file and deploying it to the same instance of JRun on which ColdFusion 7 is running. This way I could manage all my ColdFusion instances in one place. I ran into one small problem though, how do I get a site configured in Apache to use the ColdFusion 8 server rather than the ColdFusion 7 server? For those who may not know, when you are using IIS and multiserver install of ColdFusion, when you add news ‘sites’ to IIS, you ccan specify what instance of ColdFusion to use for the site. The answer was surprisingly simple.

First, keep in mind these instructions pick up AFTER ColdFusion 8 has been installed and deployed to your JRun server and the server is running. It also assumes that Apache has already been configured to work with ColdFusion

  1. Go into your JRun Admin and find the ‘server’ you specified when you deployed ColdFusion 8, and click the link. In my case, its named ‘cf8’.
  2. In the resulting screen, click the ‘Services’ link in the navigation bar.
  3. In the next screen, click the ‘Start’button next to the ‘Proxy Service’. Take note of the ‘proxy port’, we will need that in a bit.
  4. Create a directory, with whatever name you woud like) under {Jrun}/lib/wsconfig (In my case, I named it ‘cf8’…original, I know)
  5. Open up httpd.conf and create a <virtualHost> to use, or you can use an existing one.
  6. In httpd.confand look for a block of code that looks like:
    # JRun Settings
    LoadModule jrun_module "C:/JRun4/lib/wsconfig/1/"
    <IfModule mod_jrun20.c>
    JRunConfig Verbose false
    JRunConfig Apialloc false
    JRunConfig Ssl false
    JRunConfig Ignoresuffixmap false
    JRunConfig Serverstore "C:/JRun4/lib/wsconfig/1/"
    JRunConfig Bootstrap
    #JRunConfig Errorurl <optionally redirect to this URL on errors>
    #JRunConfig ProxyRetryInterval 600
    #JRunConfig ConnectTimeout 15
    #JRunConfig RecvTimeout 300
    #JRunConfig SendTimeout 15
    AddHandler jrun-handler .jsp .jws .cfm .cfml .cfc .cfr .cfswf

    This information is what Apache uses to pass off requests to ColdFusion.

  7. Copy the following lines:
    JRunConfig Apialloc false
    JRunConfig Serverstore &quot;C:/JRun4/lib/wsconfig/1/;
    JRunConfig Bootstrap
  8. Paste the above lines inside the <virtualHost> block you created, or chose, in step 6.
  9. In the line: JRunConfig Serverstore “C:/JRun4/lib/wsconfig/1/”, change the path so it matches the path of the directory you created in step 4. Make sure you keep the ‘/‘ on the end. Don;t worry about the file not being there, it will get added auto-magiaclly.
  10. In the line JRunConfig Bootstrap, replace the port number (the number after the colon) with the ‘proxy port’ number we noted in step 3.
  11. Restart Apache.

The <virtualHost> you created will now use ColdFusion 8 instead of the default server (which in my case was ColdFusion 7).

How do we know its using ColdFusion 8? Easy, just create a test page with <cfdump var=”#server#” />, you’ll see a version number that begins with ‘8’.

You can also use this method for pointing Apache to different instances of the same version of ColdFusion, since, as far as JRun cares, they are all just servers.

Comments on: "Running CF8 & CF 7 on JRun with Apache" (4)

  1. Tony Garcia said:

    Hi Scott,
    Thanks for showing me how to run CF7 and CF8 on the same machine. The only trouble I’m having is being able to access the CF8 administrator. I created a virtual host called localhost.cf8 and I can get to the administrator by going to http://localhost.cf8/CFIDE/administrator/index.cfm, but all of the images have broken paths. Any tips on a better way to do this??


  2. Scott F Stroz said:

    @Tony – I typically just use the port number assigned from JRun (should start at 8300). So for instance, you should be able to access your CF8 admin by using localhost:8301 (check the JRun admin to see what port number is assigned to the instance)


  3. Tony Garcia said:

    Yep — that worked. Thanks again!


  4. Hi Scott

    I’m just wondering what version of Apache were you using? I have 2.2.6 running on Leopard and I am trying to install Coldfusion 7. I have yet to try 8 but more people have had success with 8. Hardly anything on CF 7 and this version of apache.
    An error appears on installation saying that it does not support the version 2.2.6 (only certain versions of 1.x and 2.x)
    I might just have to install CF8, however, if you know of a fix (without changing the version of apache), I would appreciate your help.



Comments are closed.

Tag Cloud

%d bloggers like this: