I am writing this tutorial because I know many people who still struggle when it comes to configure and manage ColdFusion 8 instances on a JRun server the proper way.

I had to learn it the hard way, and there was a lot of trial an error involved, so I decided to write this definitive guide.

I will use my current work as a use case, so you can understand exactly what the situation is, and hopefully re-use it in real life.

Basically we have ColdFusion 8 installed on each developer's computer, and in order to have everything separated, we have one ColdFusion instance per project, so we can save on resources, and can fine tune each of the instances (by changing each of the Java Virtual Machines separately) according to the application needs.

There is a few ways to accomplish this task, but lately I found that the easiest way if to use ColdFusion Administrator itself, and let it do all the work for you. Here is how I do it, assuming you have ColdFusion 8 multi-server configuration already installed:

  1. Ensure the Macromedia JRUN Admin Server and Macromedia JRUN CFusion server are running, so you have total access to the ColdFusion instance administrator
    Windows Services
  2. Go to 127.0.0.1:8000 (that is your JRun administrator Environment) JRun Login
  3. Enter the username and password for the JRUN Administrator, lowercase username of "admin" and the password used to install ColdFusion 8 default is "password". If it does't work, you can reset it by doing the following steps:

    1. Go to [server_install]:\JRun4\servers\admin\SERVER-INF\jrun-users.xml
    2. Change the line: true to false
    3. Edit the following:

    You should now be able to login to the administrator
    Jrun Login
  4. Once logged in you will see the servers that you already have installed. JRun Screen
  5. Now check on which port CFUSION is installed. Default is 8300
    JRUN Services
  6. You can now access the main ColdFusion server in order to create your new instance. You should be able to login to http://127.0.0.1:your_cfusion_port. In this case 8300, so you can bookmark http://127.0.0.1:8300/cfide/administrator.
    The login details should be the same as your default JRun admin (admin, password) CF Administrator
  7. On the left hand menu, click on Enterprise Manager, and as it expands, you will see "Instance Manager". Click on it and you will see thee following screen.
    Enterprise Manager
  8. You should now see all your servers again, but this time you will click on the "Add New Instance" button. Add New Instance
  9. Give your server a name, and add a path on the server directory field. ColdFusion will normally put this data automatically, but in this case we will change it to point to where we store our JRun servers (c:\JRunServers). Could be anywhere really. Only make sure you DO NOT check the checkboxes for the services to be created automatically. I'll explain this more later on. Server Details
  10. It will take some time now, but it's important that you are patient here, as it's deploying your new application, and creating all the necessary files including a new ColdFusion Administrator. Once it’s finished, you should see a screen like this: Process Finished

If you got to this point, that means you've completed 95% of the task successfully, and you should already have an instance created.

Now, there is a "gotcha" to it, it's not yet considered as a Windows Service. And that is mainly because you told it not to back on step 9.

The reason why you did that, is because by allowing ColdFusion to create your Windows Service, you are also allowing it to create it as a native service. Meaning it will be using the Native Virtual Machine, and not the one you selected manually.

Why is that a problem? One may ask.

Basically if you allow it to happen, that means you have no control over your Virtual Machine, and can not fine tune settings like maximum and minimum memory, garbage collector timming and etc.

In other words you let windows manage it for you, and can not have any control whatsoever of what is happening with your application.

The solution then, is to create a jvm.config manually and turn your instance into a Windows Service manually. I have done this before, and I can assure you it is a very boring job, and you need to pay extra attention, otherwise your server will not even start-up, and you will lose hours trying to find out what is going on.

That is why I have put together a quick and dirty Adobe AIR app that does all the job for you, so you will only need to "tell" it what your configurations are, and it will create two files for you on your new instance's folder.

You then only need to execute a batch file (created "automagically" by my application), and your service will be created pointing to your newly generated jvm.conf file. Obviously, you can edit this jvm.conf file in order to do some fine tuning, but once the service is created, you only need to make your changes and restart the service, without the need of creating the service again.

It is a very basic application, as there is no reason to complicate. It does the job in a very clever way, and really saves you time and effort. I will be accepting suggestions in terms of functionality should anybody think there is anything else to be done. Here is the link to the project: http://jvmconfig.riaforge.org/

I hope you enjoyed it!
Marcos Placona
http://www.placona.co.uk

 

About This Tutorial
Author: Marcos Placoná
Skill Level: Advanced 
 
 
 
Platforms Tested: CF8
Total Views: 109,375
Submission Date: July 29, 2009
Last Update Date: July 29, 2009
All Tutorials By This Autor: 4
Discuss This Tutorial
Advertisement

Sponsored By...
Mobile App Development (IOS, Android, Cordova, Phonegap, Objective-C, Java) - Austin, Texas Mobile Apps - Touch512, LLC.