We had a fun time yesterday updating our ColdFusion which is currently deployed under Tomcat. So, I wanted to document what we did to make it an easier transition on the production box.
First, download the file. We downloaded the English Java Installer JAR, 142.24 MB. Although it says that you should download the complete file from the trial center, the complete file with the updater applied may be obtained from the above link. Use java -jar to unpack the cfusion.war file from the jar file.
The only thing currently in the ROOT directory is the index.jsp file and some images for the Tomcat Manager. There is no index.jsp file in the cfusion directory. So, you will keep the functionality of your Tomcat manager. **Note** if you already have cfusion deployed in the ROOT directory or anywhere else, you can back up the neo-query.xml file (/ROOT/WEB-INF/fcfusion/lib). This is the file that contains all of your datasources. If you are going to redeploy your web application, these will disappear. So, simply making a backup of your neo-query.xml file will save a little time later.
Use jar -xvf to unpack all of the contents of the cfusion.war into /ROOT
Copy the setenv.sh script below to the tomcat_root/bin directory
Disable directory browsing in the server in the tomcat web.xml file by changing the listings settings from the default of true to false.
Modify the jk.conf file to contain /CFIDE
Remove any symbolic links to the CFIDE from the webroot.
Restart Tomcat and the webserver.
Open up your ColdFusion administrator and go to the page. If you see things, you are in business, if you have some complaints, check the links below that we used to hack together the setenv.sh script.
In order to now get the CF Administrator to run as well as the charting components, we referenced the following pages:
- Installing ColdFusionMX for J2EE on Tomcat http://www.macromedia.com/support/coldfusion/j2ee/phase2-tomcat-deploy.html
- Macromedia ColdFusion Technote: ColdFusion MX: Using cfchart or other graphics rendering objects on Unix platforms with JVM 1.4.1 or higher http://www.macromedia.com/go/tn_18747
- Macromedia ColdFusion TechNote: ColdFusion MX 7: 'Graphing service is not available' error when accessing the ColdFusion Administrator http://www.macromedia.com/go/ceb0e519
- Strange Error Messages and Headless Systems: http://www.alagad.com/index.cfm/name-aicheadless
- Coercing the Alagad Image Component to Work on Headless Systems http://www.doughughes.net/index.cfm?event=viewEntry&entryI=29
In order to resolve the problem on Tomcat 4, you need to have a file called setenv.sh in your tomcat_root/bin directory as referenced in #1 in the list above. The contents of the file, however, is a mixture of the other 4 references in the list.
setenv.sh
# Establish variables
JAVA_HOME="/usr/lib/jvm/java"
CF_HOME="/opt/tomcat/webapps/cfusion"
CF_WEB_INF=$CF_HOME/WEB-INF
# Add binary file directories to system path
CF_SHARED_LIB=$CF_WEB_INF/cfusion/lib
CF_SHARED_LIBS=$CF_SHARED_LIB:$CF_SHARED_LIB/_ilnx21/bin
LD_LIBRARY_PATH="$CF_SHARED_LIBS:$LD_LIBRARY_PATH"
# Establish security JVM options (all on one line).
CF_SECURITY_JVM_OPTIONS="-Djava.security.manager
-Djava.security.policy=$CF_WEB_INF/cfusion/lib/coldfusion.policy
-Djava.security.auth.policy=$CF_WEB_INF/cfusion/lib/neo_jaas.policy"
# Establish graphics JVM options (all on one line).
CF_GRAPHICS_JVM_OPTIONS="-Xbootclasspath/a:$JAVA_HOME/lib/tools.jar:
$JAVA_HOME/jre/lib/rt.jar:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/jre/lib/i18n.jar:
$CF_WEB_INF/cfusion/lib/webchartsJava2D.jar
-Djava.awt.headless=true"
# Set JVM options for CORBA. Use if vbjorb.jar is not in your JRE's
# lib/ext directory. If used, append $CF_CORBA_JVM_OPTIONS to
CF_JVM_OPTIONS
# CF_CORBA_JVM_OPTIONS=-Xbootclasspath/a:"$CF_WEB_INF/lib/vbjorb.jar"
CF_JVM_OPTIONS="$CF_SECURITY_JVM_OPTIONS $CF_GRAPHICS_JVM_OPTIONS"
JAVA_OPTS="$CF_JVM_OPTIONS -Xms128m -Xmx256m"
export LD_LIBRARY_PATH
Phew!