HOME     WEB DESIGN     WEB DEVELOPMENT     PORTFOLIO     ABOUT JS     CONTACT     BLOG
 

It's Blog...It's Blog...
...it's big, it's heavy, it's "good". For all of you who remember the Ren and Stimpy days, that was probably a flashback. For everyone else, sit back and enjoy our blog from the wide world of web development and design.


Taming the Cat...Tomcat and Coldfusion 8
<< January, 2009 >>
SMTWTFS
123
45678910
11121314151617
18192021222324
25262728293031
Search Blog

Categories
Archives
RSS

 

28 February 2008
Doug
Taming the Cat...Tomcat and Coldfusion 8
It is possible without JBOSS



Ok, this week on Thursday Tips Day, I have a rather unique situation I was working on for a client.  The issue:  To get Tomcat 6 working on a Windows 2003 server running IIS and have ColdFusion 8 running on the Tomcat install.

This is not as easy as it would seem.  According to the Adobe ColdFusion 8 site (www.adobe.com/coldfusion) Tomcat is not directly supported as is was in the past.  The only mention of Tomcat in any of the installation documentation is only in a JBOSS type instance.  So here's the first question...why would someone want to do this?

The client's decision is actually a very good one.  Those of us familiar with ColdFusion over the years would agree that JRun is not the best Java server around.  In fact it sometimes causes more harm than good.  And in some unique situations it really ends up crashing the server and causing all kinds of Coldfusion errors when it gets too bogged down.  Now in CF8's Enterprise Edition, the server monitoring tools are very good in letting you know what is causing the overloads.  Sometimes it's your own code doing it.  Sometimes it's not.  However for those of us not willing to spend the $4,000+ to purchase a copy of Enterprise Edition, we're back to the same page as always.

Anyway, by choosing a Java server such as Tomcat, which has plenty of public support and has been running Java apps for quite some time very reliably on both Linux and Windows platforms (and even a Macintosh here and there I've seen), the client will be able to run their JSP apps, plus leverage Tomcat's excellence in running CF8's Java based programming technology.  Therefore a very lean and mean system and as the client puts it, "a smaller footprint" on their server.

The Installation Sequence

Ok, so to start, go ahead and download the latest version of Tomcat (http://tomcat.apache.org/download-60.cgi) and install it on your Windows2003 Server.  You can do the direct services install or the longer more in depth binary install, but both work just fine.  After the installation is complete.  You should easily be able to browse to http://localhost:8080 to get the nice little Tomcat welcome page.

Next download a copy of CF8 from Adobe's website (http://www.adobe.com/products/coldfusion/) and install that on your server next by using the "Deploy as J2EE, and as a .WAR" installation.  When the installation is complete you should have a .WAR file most likely if you used the defaults in your C:\ColdFusion8 root directory.

Stop the Tomcat Server via your services or direct command line. 

Now copy the .WAR file into your {TomcatRoot}\webapps directory. 

Start the Tomcat Server and within a few minutes, Tomcat should have expanded all of your directories into the webapps folder.  So at the end you should have a /cfusion directory sequence in your webapps directory.

Stop the Tomcat Server again. 

Ok, now for a fun part.  Open up notepad and create a .bat file called setenv.bat and place it in the {TomcatRoot}\bin folder.  Place the following code in that .bat file making sure to change the bolded areas to your exact folder structure:

rem Set a few variables.
set JAVA_HOME=C:\Program Files\Java\jre1.5.0_14
set CF_HOME=C:\Program Files\Apache Software Foundation\Tomcat 6.0\webapps\cfusion
set CF_WEB_INF=%CF_HOME%/WEB-INF

rem Concatenate binary file directories into a single variable.
set CF_SHARED_LIB=%CF_WEB_INF%/cfusion/lib
rem The following variable must be on a single line.
set CF_SHARED_LIBS=%CF_SHARED_LIB%;%CF_SHARED_LIB%/_nti40/bin;
%CF_WEB_INF%/cfusion/jintegra/bin;
%CF_WEB_INF%/WEB-INF/cfusion/jintegra/bin/international

rem Add libraries for binary files to the Windows system path.
set PATH=%PATH%;%CF_SHARED_LIBS%

rem Set JVM options to enable sandbox security (all on one line).
set 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"

rem Set JVM options for CORBA. Uncomment this line if vbjorb.jar is not in
rem your JRE's lib/ext directory.
rem set CF_CORBA_JVM_OPTIONS=-Xbootclasspath/a:"%CF_WEB_INF%/lib/vbjorb.jar"

rem Consolidate JVM options.
rem * Uncomment this line if you've configured CORBA
rem set CF_JVM_OPTIONS=%CF_SECURITY_JVM_OPTIONS% %CF_CORBA_JVM_OPTIONS%
rem * Uncomment this line if you haven't configured CORBA
set CF_JVM_OPTIONS=%CF_SECURITY_JVM_OPTIONS%

rem Populate JAVA_OPTS, which will be used by the catalina.bat file
rem when starting the JVM.
set JAVA_OPTS=%CF_JVM_OPTIONS%

Ok, go ahead and start Tomcat back up, and browse to localhost:8080/cfusion/cfide/administrator and with any luck, you should have the nice welcome screen of the ColdFusion 8 admin staring you in the face.  Go ahead and configure your instance with datasources, etc. and place any .cfm files you want to run in the /cfusion/cfide/ directory.

That's it.  I'm now in the process of getting the .cfm files to render in other directories and folder structures in the rest of the Tomcat so you can browse to other directories with .cfm files and get them to render.  Until next week!

Posted by dougjustice at 12:00 AM | Link | 0 comments
Subscription Options

You are not logged in, so your subscription status for this entry is unknown. You can login or register here.

No comments found.

Post a comment (login required)