Manually connecting Apache to a ColdFusion instance

I realised the other day when I was talking to a friend that my previous post on manually creating ColdFusion instances was kind of missing the last part of the process.

You've created a ColdFusion instance. You can start it up and you can access the admin. You've even made sure that proxy port is active, but now what? How do I manually hook up my shiny new instance to a web server? So I thought I'd write up this bit as well.

I haven't used IIS in a long time, so I'm not even going to contemplate how you would manually set that web server up with ColdFusion, but I can tell you how to connect Apache.


Manually creating MultiServer instances of Adobe ColdFusion Server

In the past I've blogged about manually deploying ColdFusion instances on Multiserver JRun and Apache. For a while now I've been meaning to write about the process of doing a complete manual creation of a JRun instance and deploying Adobe ColdFusion Server on that instance.

Why? Well. Its something I do all the time and its actually really easy. But why? Well I broke my JRun admin instance about 18 months ago. I couldn't fix it and no one seemed to be able to help me, so I resorted to manually creating and deploying ColdFusion instances on JRun.

Before Christmas, one of my colleagues had the exact same problem I has with JRun admin as I had. She asked me if I knew how to fix it. Having spent time on it and abandoned it I told her to manually create her instances. Inevitably she asked me if I'd written it down anywhere. Of course, I haven't, so now I'm going to.


Compiling ColdFusion Applications for Deployment

I've been compiling ColdFusion applications on and off over the years for various reasons, usually on my server or another server that I have access to.

Recently I've been compiling for deployment to an external server that I've not had access. I ran into a few problems with the resulting compiled code not running on these servers while it runs perfectly locally.

To start at the beginning, I've often simply pre-compiled an application in place, so that it need not compile the templates on first access. Occasionally I've compiled for source-less deployment. Usually under those circumstances I've had access to the server, where I've simply loaded source code onto the server, compile, dropped the compile code into place and then removed the source.


Manually creating JRun Server instances.

I'm having a spot of bother with the JRun JMC (Java Management Console) at the minute. 

For some reason I'm getting error messages like this :


Installing CF Instances in a different location

I got asked yesterday - how can I set up a CF Instance somewhere other than the default location?

Its actually pretty easy. In the JMC (Java Management Console) when you create a new server instance simply give the server path as a fully qualified path rather than using the {java.home} variable in the front of the path. And that is it.

If you want to change the path of an existing server, the paths reside in the Jrun4/lib/Servers.xml file. In theory, you should be able to move the server folder and change the path in the server.xml file and hey presto! I say "in theory" because I've never tried this.

Don't forget to shut the JRun server down before you do this....

ColdFusion Instance "bugs"

I'm holiday and if the wife knew I was reading coldfusion blogs I'd be for it and its sad that I'm posting to my blog, but what the heck! I need to mention this before I forget about it.

A while back I did a quick check list on setting up Multi-server CFMX under JRun. (see the related entry) I mentioned in that article that you need to change cfusion.war to cfusion-war in the application.xml file. What I didn't mention and what I probably did on autopilot was also changed cfusion.ear to cfusion-ear. I thought I would mention this in passing as Andy Allan blogged about it on Thursday.

He also mentions a problem with instances and log paths that you should be aware of.

Now I'm gonna run away before the wife catches me... ;)

CFMX MultiServer Set up

This is more a "note to self" than anything else, but here you go...

I've been messing about with the Multi server set up for CFMX7. J2EE applications, Clustering and multiserver installations is something I haven't really looked at since umm... CF4.5.1, so I thought it was time to look at it all over again.

I had a few hassles, but with Andy Allan of the Scottish CFUG's help I've now ironed out all the wrinkles on my dev server set up.What I've got is Apache 2.0.55, with Jrun 4 Updater 6 running multiple CF instances and sites, one of which is actually my test bed for this blog. (Bit naughty really seeing as I run CFMX standard with IIS on my production server, but you have to try these things out some how!)

Anyway, here's the steps to a working install.

  1. Install Apache
  2. Install CFMX 7.01 using option 2 (Multi-Server install)
  3. Do another install of CFMX 7.01 using option 3 (J2EE install) making an cfusion.ear file
  4. Use something like winrar to unzip the ear file into a folder called cfusion-ear
  5. Extract the cfusion.war into cfusion-war folder
  6. Hang onto the cfusion.ear file, so you don't have to build it again, but delete the cfusion.war file out of the folder structure
  7. Edit the application.xml file in the cfusion-ear/META-INF folder - change the web-uri to cfusion-war rather than cfusion.war
  8. Create your various instances for your various websites in the Java Management Console (JMC)
  9. Remove the default-ear folder from the server instance folder for each instance that will be running CFMX
  10. Copy the cfusion-ear folder into the server folder for each instance
  11. Set up your websites in Apache using virtual hosts
  12. Use the wsconfig tool to connect the first Java Server Instance to apache
  13. Edit your httpd conf file.
    Leave :
    view plain print about
    1LoadModule jrun_module "C:/JRun4/lib/wsconfig/1/"
    2JRunConfig Ssl false
    3AddHandler jrun-handler .jsp .jws .cfm .cfml .cfc .cfswf .cfr
    in the global part of your config file, but copy the rest into each virtual host.
  14. Change the port number on the bootstrap for each website to point at the appropriate Java Server Instance.
  15. Change the Serverstore variable to point to different numbered folders for each website and create these folders. You can put a copy of the file in there, but its not required.
  16. Go into cfusion-ear\cfusion-war\WEB-INF for each server, edit the web.xml file and uncomment the SES URL settings
  17. Go into the SERVER-INF folder for each instance and edit the jrun.xml. Set the deactivated attribute to "false" under the jrun.servlet.jrpp.JRunProxyService class, if it isn't already.
  18. Start your instances and start your apache server (or restart as appropriate)
  19. and thats it....