Viewing Individual Entry / Main
October 3, 2003
Some applications claim to be platform independent, I will explain to you why I think CFMX 6.1 truly is. I will walk through the steps of deploying the java only install of CF onto windows, do some development work. Then jar CFMX and the CFML files up into an ear file and deploy right onto linux (or any other OS you choose). All without running any installer for CF on linux. Truly a write once deploy anywhere scenario. Pretty Cool eh?
The first step that needs to be taken is do download the java (jar based) install of CF. This install does not contain platform dependant files (verity, CFX, COM) but does include the core files of CFMX. When you go to http://www.macromedia.com/downloads download the AIX install of CFMX. It is not just for AIX it runs on any OS with a J2EE application server, the file extension for the file is .jar.
To run the installer enter the command java -jar coldfusion-macr-java.jar (this will bring up the GUI)
You can also run this installer in the console by adding the options i console. For a full listing of the options type -? In this example I will run in GUI and let the installer build an ear for me that I will deploy onto JRun. Here are the steps that I followed, while these steps apply to JRun they may be a little different based on the application server you are using.
- Run the CFMX 6.1 installer java -jar coldfusion-macr-java.jar
- Choose the ear file J2EE installation
- Create a new JRun server through the JMC
- Delete the default-ear from the server you just created in {jrun-root}/server/{serverroot}/default-ear
- Under the JRun servers root {jrun-root}/server/{serverroot}/ create a directory called cfusion-ear
- Copy the cfusion.ear from the installed directory to {jrun-root}/server/{serverroot}/cfusion-ear/
- Within the directory {jrun-root}/server/{serverroot}/cfusion-ear/ Extract the ear with the following command jar xvf cfusion.ear
- Within the directory {jrun-root}/server/{serverroot}/cfusion-ear/ create a cfusion-war directory and move cfusion.war to cfusion-war.
- Within the directory {jrun-root}/server/{serverroot}/cfusion-ear/cfusion-war extract the war file with the following command jar xvf cfusion.war
- Within the directory {jrun-root}/server/{serverroot}/cfusion-ear/META-INF open the application.xml and change
<web-uri>cfusion.war</web-uri> to <web-uri>cfusion-war</web-uri>
- Delete both cfusion.ear and cfusion.war
- Start JRun and CF will deploy, hit the CF admin. The CFadmin URL will be dependant by the port you setup JRun to run on and the context root you chose during installation. I have the port 8101 and a context root of / for my install so my url is:
http://127.0.0.1:8101/CFIDE/administrator/index.cfm
- Walk through the Configuration wizard
At this point we are ready to start development. You also have the option of configuring CF to work with an external webserver. For this example I will create a few simple CF pages and setup a few datasources in the admin. The next step is to jar this entire install up and move it over to a Linux box and extract the ear into place.
Now in order to deploy the ColdFusion ear onto any OS/J2EE server combination of your choosing you will first need to jar it up.
- Make sure JRun is shut down
- Within the directory {jrun-root}/server/{serverroot}/cfusion-ear/ run the following command to package CF up
jar cvf cfusion-package.ear *.*
I have JRun installed on RH 8.0 Linux and that is where I will move and deploy this file but the fact is you could deploy this file anywhere you wanted.
- On my linux box I have JRun 4 installed and I have created a JRun server to deploy onto
- In the JRun server root of the linux box {jrun-root}/server/{serverroot}/ create a cfusion-ear directory
- In the directory {jrun-root}/server/{serverroot}/cfusion-ear/ copy the cfusion-package.ear from Windows to the Linux box
- Extract the ear file on the linux box in the directory {jrun-root}/server/{serverroot}/cfusion-ear/ with the following command
jar xvf cfusion-package.ear
- Delete cfusion-package.ear
- Start the JRun server on the linux box and you are in business
Using this approach you can build one ear file that could be deployed on any developers machine regardless of operating system. All you need is a J2EE server and JRun for developers is free. After doing development you can jar up CF and move it to another environment for testing then onto production for deployment. Let me know what you think about this approach.
Comments
This is also a good approach when you are using multiple instances or cloning CF servers in a cluster.
Posted by Brandon Purcell at 10/3/03 10:28 AM
Thanks for this Brandon. We're looking at ways of cloning CF servers and this approach could be extremely useful.
Posted by Barry at 10/3/03 10:48 AM
What does Jrun have to do with it, I want to run CFMX as an application under BEA's weblogic, must I stick with jrun?
Posted by Geoffrey Barth at 10/7/03 9:03 AM
Step 3.Create a new JRun server through the JMC How does one do this and why, I just want to depoy this on my weblogic server.
Posted by Robert Wilson at 10/7/03 9:09 AM
Follow the instructions at http://www.macromedia.com/support/coldfusion/j2ee/cfmxj2ee_weblogic_deploy.html for deploying CFMX. I used JRun for this particular example because I had to choose some J2EE server to illustrate the concepts. The same concept applies to any application server. After you have deployed on Weblogic following the instructions above you can jar up the extracted ear and deploy it on any server.
Posted by Brandon at 10/7/03 10:25 AM
I'm trying to create a cluster with a context root of "" or "/". I've configured two CF instances on one JRun with the appropriate context root, and they both work at their own http ports.
However, once I add them to the cluster and navigate to them in JMC the Coldfusion Web Application is not shown anymore. Removing the server from the cluster and restarting it caused the Web App to re-appear.
Additionally, when I try to hit a test site running on Apache connected to the cluster, I get an Internal Server Error, and the following in my error_log (all entries are from one hit):
[Fri Oct 17 16:13:26 2003] [notice] jrApache[4613] could not initialize Server_1:63.108.123.137:51002 [Fri Oct 17 16:13:26 2003] [notice] jrApache[4613] Couldn't initialize from remote server, JRun server(s) probably down. [Fri Oct 17 16:13:27 2003] [notice] jrApache[4613] could not initialize Server_1:63.108.123.137:51002 [Fri Oct 17 16:13:27 2003] [notice] jrApache[4613] Couldn't initialize from remote server, JRun server(s) probably down. [Fri Oct 17 16:13:28 2003] [notice] jrApache[4613] could not initialize Server_1:63.108.123.137:51002 [Fri Oct 17 16:13:28 2003] [notice] jrApache[4613] Couldn't initialize from remote server, JRun server(s) probably down. [Fri Oct 17 16:13:29 2003] [notice] jrApache[4613] could not initialize Server_1:63.108.123.137:51002 [Fri Oct 17 16:13:29 2003] [notice] jrApache[4613] Couldn't initialize from remote server, JRun server(s) probably down. [Fri Oct 17 16:13:29 2003] [notice] jrApache[4613] JRun will not accept request. Check JRun web server configuration and JRun mappings on JRun server
Can anyone help? I really need to get this cluster going...
Posted by Leon at 10/17/03 2:22 PM
Make sure you removed the default-ear and any other applications that could conflict with the / mapping
Posted by Brandon at 10/17/03 3:45 PM
I changed the context root of the app in default-ear to "/default", so that shouldn't be the problem.
This article (http://www.dreamweaver.com/support/coldfusion/ts/documents/tn18314.htm) says
"If a website is associated with multiple ColdFusion application servers, each ColdFusion application server must have a unique context root that is not at the top level (/). Therefore, all URLs must start with site_name/context_root, as in www.myco.com/techsupp/index.cfm, where www.myco.com is the site name and techsupp is the context root."
However, the existance of macromedia.com seems to belie this statement. My need for a cluster with the / context root is getting pretty desperate. Can anyone help me out?
Thanks!
Posted by Leon at 10/24/03 3:28 PM
I was expecting to see fewer steps for deploying a web application. I would expect:
(1) Fire up the Tomcat manager.
(2) Select the WAR file to deploy.
(3) Done.
My assumption is the only work required during installation was to put a coldfusion.jar file (or several jar files that collectively represented coldfusion) in Tomcat's common/lib directory.
My further assumption is a ColdFusion developer can use some tool to convert all of his code into class files and make web.xml and context.xml files all within the META-INF and WEB-INF directories.
At least that's how it's working for me doing Java development.
Other than that, I've been pleased to see Coldfusion grow into a crossplatform application.
Posted by Bruce at 1/27/05 2:13 PM
I should clarify a little. As a java developer I configure ant to build my WAR files and then deployment is the two steps I first mentioned.
The instructions presented in this blog for installing a coldfusion EAR involved unpacking the EAR manually and restarting the web server, which I don't think should be necessary.
On the system installation side of things, I don't understand what all the installer has to do, unless it also includes installing the JRun server. Excuse my ignorance if this is the case.
Posted by Bruce at 1/27/05 2:17 PM
Platform independent?
Maybe the code is, but not the installer itself.
Try installing the CFMX6.1 for Solaris on an Intel platform running Solaris 10.
The installer is relying on a Java version bundled as part of the installation - which includes Java compiled for the Sparc architecture - and thus fails.
I couldn't find a work-around either.
Posted by Howard at 3/25/05 11:18 AM
Howard, In the instructions I am not using the platform specific installer. I am using the jar based installer where you use java -jar coldfusion-macr-java.jar. This will run fine on any platform. Brandon
Posted by Brandon at 3/27/05 11:18 AM
This sounds great... I think it will work - I am a CF developer and was to deploy a J2EE applicaiton at a client site who currently does not have CF. I am not sure about the deployment techniques required to deploy on a Win2000 server... Would the above work in my scenerio or does the client have to purchase CF?
Posted by Shahbaz Mirza at 10/12/05 6:42 AM
|