Installing and Configuring ColdFusion MX 6.1 Multiple Instances with IIS and Apache Virtual Hosts
Table of Contents
Creating Multiple Instances of ColdFusion
In this section, you will configure multiple instances by creating new instances of JRun and deploying ColdFusion to each new instance.
- Stop the cfusion server from the command prompt or in the Windows Services control panel.
- Copy the cfusion-ear directory from the cfusion server in
C:\JRun4\servers\cfusion\cfusion-ear\to a location of your choosing. In this example I choseC:\working\cfusion-template. You will use these files when you create new instances of ColdFusion MX. As you create new instances, you will copy the entire folder to the server root of the new instance. - Start cfusion server through the Windows Services control panel or from the command line.
- Create a new JRun server or instance of JRun and deploy ColdFusion
MX to it. To create the new JRun server, you must have JRun admin
server running. You can start the process in the control panel or
from the command line with the following command:
{jrun4}\bin\jrun -start admin - Open a web browser and type the following URL to access the JMC:
http://<host>:8000/. - After logging into the JMC with the username and password that you specified in the ColdFusion MX installation, click Create New Server, at the top of the JMC.
-
Type a name for the JRun server; in this example I used cfusion2; next, click the Create Server button.
Figure 5. Creating a new server in the JMC
-
Choose the ports for the server (Figure 6). Specify a JNDI port in the range of 2900-3000; you can specify any port for the Web Server Port Number or Proxy Port Number. In this example, I chose the default values:
Figure 6. Choosing the ports for the new JRun server in the JMC
-
Now that you have created a new JRun server, you can add it as a service on Windows; if you are on Unix, you will start JRun from the command line. To add the server as a service, use the jrunsvc command. For information on the jrunsvc command type:
c:\jrun4\bin\jrunsvc ?To add the server as a service type the following command:
C:\JRun4\bin>jrunsvc -install cfusion2 "Macromedia JRun CFusion2 Server" "Macromedia JRun CFusion2 Server"The following message appears if the command succeeds:
Service "Macromedia JRun CFusion2 Server" installed with display name "Macromedia JRun CFusion2 Server" - Copy the cfusion-ear directory from the temporary location you copied
them to earlier to the server root for the new server you just created.
In this example, I copy the files from
C:\working\cfusion-template\cfusion-eartoC:\JRun4\servers\cfusion2\cfusion-ear. - Start cfusion2 (or your new server name) server through the Services control panel or from the command line.
- Delete the default-ear from the newly created JRun server. Since
both cfusion-ear and default-ear have a context root of
/, they will conflict; therefore, you must delete the default-ear. I deleted mine fromC:\JRun4\serves\cfusion2\default-ear. You must also undeploy the flashgateway.ear included with JRun so that it does not conflict with the gateway that is packaged with ColdFusion. To undeploy the flashgateway.ear, click the server name in the left frame of the JMC. Click J2EE components, then click "X" next to the Flash Remoting EAR. - You have now successfully created two instances of ColdFusion. For each additional instance, follow steps 4–13 each time you want to create a new server.
Note: In some cases you may want to have individual settings for each instance. For example, perhaps you want to configure the first instance with a maximum JVM heap of 512MB, and you want to have 256MB for the second instance. Or maybe you want to configure a different classpath for each instance. By default, this is not possible; you must create different jvm.config files for each instance and follow the instructions in TechNote 18206: JRun 4.0: Configuring Individual JVM Settings for each JRun Server to configure different JVM configurations.