Tips Using CF8 Instances with JRun4 and Apache on Windows

The goal is to run completely separate ColdFusion servers, with unique webroots, using the same install of Apache 2.2.x on Windows. This is particularly useful

in development when mapping XML config files for Flex, Model-Glue, or Coldspring.

There is a useful article on Adobe's website called Installing and Configuring ColdFusion MX 6.1 Multiple Instances with IIS and Apache Virtual Hosts. I recommend using it, but remember the following tips and notes that I discovered.

Despite it being written for CFMX 6.1, it still applies to CF8, except that I found a couple of important tips missing from the article. I am pretty new to Apache but have found things to be pretty simple to figure out - still there might be an even easier way to make what I did happen, but the most important thing to me is, I got it working.

First, make sure the following code really is at the bottom of your httpd.conf file

# JRun Settings
LoadModule jrun_module "C:/JRun4/lib/wsconfig/1/mod_jrun22.so"
<IfModule mod_jrun22.c>
JRunConfig Verbose false
JRunConfig Ignoresuffixmap false
JRunConfig Apialloc false
JRunConfig Serverstore "C:/JRun4/lib/wsconfig/1/jrunserver.store"
JRunConfig Bootstrap 127.0.0.1:51020
#JRunConfig Errorurl url <optionally redirect to this URL on errors>
#JRunConfig ProxyRetryInterval 600 <number of seconds to wait before trying to reconnect to unreachable clustered server>
#JRunConfig ConnectTimeout 15 <number of seconds to wait on a socket connect to a jrun server>
#JRunConfig RecvTimeout 300 <number of seconds to wait on a socket receive to a jrun server>
#JRunConfig SendTimeout 15 <number of seconds to wait on a socket send to a jrun server>
AddHandler jrun-handler .jsp .jws .cfm .cfml .cfc .cfr .cfswf
</IfModule>

You might see httpd.conf.1, httpd.conf.2, httpd.conf.3 files and maybe your httpd.conf file doesn't have the above code, but your httpd.conf.2 file does. That happened to me, and I simply copied and pasted the code into httpd.conf, and restarted apache.

In my httpd.conf file I use the include for httpd-vhhosts.conf like this

# Virtual hosts
Include conf/extra/httpd-vhosts.conf

I had to comment out where the DocumentRoot is defined in httpd.conf, as well as the Directory tag-set that follows. The DocumentRoot gets defined in each VirtualHost, but what I found was so does the path defined in that Directory code.

So with www2 as my second VirtualHost(webroot), here is an example of my VirtualHost

<VirtualHost *:80>
   JRunConfig Apialloc false
   JRunConfig Serverstore "C:/JRun4/lib/wsconfig/www2/jrunserver.store"
   JRunConfig Bootstrap 127.0.0.1:51000   
   
   DocumentRoot "C:/www2"
   ServerName localdev2
   ErrorLog logs/www2-error_log

   <Directory "C:/www2">
    #
    # Possible values for the Options directive are "None", "All",
    # or any combination of:
    # Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
    #
    # Note that "MultiViews" must be named *explicitly* --- "Options All"
    # doesn't give it to you.
    #
    # The Options directive is both complicated and important. Please see
    # http://httpd.apache.org/docs/2.2/mod/core.html#options
    # for more information.
    #
    Options Indexes FollowSymLinks
   
    #
    # AllowOverride controls what directives may be placed in .htaccess files.
    # It can be "All", "None", or any combination of the keywords:
    # Options FileInfo AuthConfig Limit
    #
    AllowOverride None
   
    #
    # Controls who can get stuff from this server.
    #
    Order allow,deny
    Allow from all
   
   </Directory>
</VirtualHost>

Secondly, when you login to the JRun Console to start the proxy service, you need to stop and start that thing a few times to refresh the connection. When I tested it in the browser, the JRun Server being used, was outputting as cfusion (default), which was wrong. When I refreshed the proxy service, it suddenly outputted the correctly JRun Server as expected.

Restart Apache, ColdFusion Instance, and then your proxy service and things should work fine.

One other thing to note, I had created a CF8 Instance, then removed it. When I went to create it again, using the same name - it didn't work. The browser kept spinning, and never timed out. As soon as I changed to a name I'd never used, it worked quickly.

Comments
Copyright ©2007 JimPickering.com. Some rights reserved. BlogCFC was created by Raymond Camden. This blog is running version 5.1.004.