Installing ColdFusion 9 on OSX Snow Leopard, Lion, and Mountain Lion 64-bit

Intro

I upgraded some of my Macs to Lion and Mt. Lion over the last week and had problems when trying to Install ColdFusion 9.0.2. When trying to connect CF to Apache (during the install) no errors were reported, but the connection did not work.

The Problem

At first the problem was that when trying to browse to /CFIDE/administrator/index.cfm the browser would prompt me to download index.cfm instead of rendering it. This got me looking at /etc/apache2/httpd.conf. There I saw that the JRun settings had not been added. They look something like this:


# JRun Settings
LoadModule jrun_module /Applications/ColdFusion9/runtime/lib/wsconfig/1/mod_jrun22.so
<IfModule mod_jrun22.c>
JRunConfig Verbose false
JRunConfig Apialloc false
JRunConfig Ignoresuffixmap false
JRunConfig Serverstore /Applications/ColdFusion9/runtime/lib/wsconfig/1/jrunserver.store
JRunConfig Bootstrap 127.0.0.1:51800
#JRunConfig Errorurl url <optionally redirect to this URL on errors>
#JRunConfig ProxyRetryInterval 600 <number of seconds to wait before trying to reconnect to unreachable clustered s$
#JRunConfig ConnectTimeout 15 <number of seconds to wait on a socket connect to a jrun server>
#JRunConfig RecvTimeout 300 <number of seconds to wait on a socket receive to a jrun server>
#JRunConfig SendTimeout 15 <number of seconds to wait on a socket send to a jrun server>
AddHandler jrun-handler .jsp .jws .cfm .cfml .cfc .cfr .cfswf
</IfModule>

So I found that code in another file and pasted it into httpd.conf and restarted apache. It wouldn't start. Eventually I checked in the system log (by firing up Console on the Mac) and saw this error message:


Did find:\n\t/Applications/ColdFusion9/runtime/lib/wsconfig/1/mod_jrun22.so: mach-o, but wrong architecture

So next I decided to run the ColdFusion web server configuration tool. I removed any existing config and then tried to add a new one. I pointed to all of the appropriate files and when I tried to apply the changes and create the connection, I saw this:

The Solution

I knew from somewhere (don't recall where) that these connectors that it was looking for are bundled up inside of the wsconfig.jar (which is located in [ColdFusionFolder]/runtime/lib/.

I found the wsconfig.jar, made a copy of it and renamed it to wsconfigFiles.zip. I then unzipped them in place. This created a new wsconfigFiles folder. In there I found the connecters/apache folder, but there was no intel-macosx64 folder. The web server config folder explicitly told me it was look for that folder. So it looks like the installer, when trying to make the connection used the 32-bit version of mod_jrun22.so and when that failed reverted the httpd.conf to the backed up version that it makes.

So, how do I go about getting the 64-bit version of mod_jrun22.so. Well, you can compile it yourself using the instructions here at Scott Pinkston's Blog. Or you can download the precompiled file from Scott.

However you get it, you now need to get that file into the wsconfig.jar so that the Web Server Config tool will work correctly.

Next I took that new mod_jrun22.so file and coppied it into that wsconfigFiles folder I created earlier by unzipping wsconfig.jar. I put it into wsconfigFiles/connectors/apache/intel-macosx64/prebuilt/.

Then, in terminal I browsed to that directory and jar'd the files into a new wsconfig.jar


cd /Applications/ColdFusion9/runtime/lib/wsconfigFiles/
jar -cmf META-INF/MANIFEST.MF wsconfig.jar *

Next, I renamed the old wsconfig.jar to wsconfig.jar.old and copied the new wsconfig.jar into its place in [coldfusion]/runtime/lib. Then I ran it.


sudo java -jar wsconfig.jar

Then when I made the connection in the web server config tool it found the new mod_jrun22.so with no problem and made the connection.

There was still one problem though. The default document was not set to index.cfm. So I needed to go to /etc/apache2/httpd.conf and find this section:


#
# DirectoryIndex: sets the file that Apache will serve if a directory
# is requested.
#
<IfModule dir_module>
DirectoryIndex index.html
</IfModule>

And add an entry for index.cfm


#
# DirectoryIndex: sets the file that Apache will serve if a directory
# is requested.
#
<IfModule dir_module>
DirectoryIndex index.cfm
DirectoryIndex index.html
</IfModule>

One more thing for Lion and Mountain Lion

Finally everything worked as expected... EXCEPT...

On OSX Lion and Mountain Lion many people have reported that certain things did not work with CF9. Specifically the Settings Summary did not load in CFAdmin and CFDocument did not work. Fortunately, I heard from Wil who heard from Kurt, who heard from Peter that there is a simple fix for this.

In CFAdmin (or in [coldfusion]/runtime/bin/jvm.config) add the following JVM argument.


-Dawt.toolkit=sun.awt.HToolkit

And that's it. Restart CF and you should have a fully functioning CF9.0.2 install.

It's really not that bad. I have done this 3 times now and had no issues. There are a lot of steps, but it's really not that hard.

Related Blog Entries

Comments
Mike's Gravatar Thanks! I got to the point of finding the missing macosx64 folder and figured I'd better google.

I discovered this all slightly differently than you, but likely no more efficiently. The file wsconfig.log at cf_root/runtime/lib/wsconfig had this entry:

java.io.FileNotFoundException: connectors/apache/intel-macosx64/prebuilt/mod_jrun22.so

Took me a while to find where mod_jrun22.so was hiding, well at least the 32 bit version that is..

# jar tf runtime/lib/wsconfig.jar | grep mod_jrun22.so
connectors/apache/intel-macosx/prebuilt/mod_jrun22.so
connectors/apache/intel-win/prebuilt/mod_jrun22.so
connectors/apache/intel-win64/prebuilt/mod_jrun22.so
connectors/apache/sparc-solaris/prebuilt/mod_jrun22.so
connectors/apache/sparc-solaris64/prebuilt/mod_jrun22.so
connectors/apache/intel-linux64/prebuilt/mod_jrun22.so
connectors/apache/intel-linux/prebuilt/mod_jrun22.so

That's when I knew I had to find a precompiled 64-bit mod_jrun22.so.

From here though I plan to do the rest of the install manually. There is some documentation on this available, such as here:

http://helpx.adobe.com/coldfusion/kb/manually-conf...

That is obviously old, but I do have a working version of 9.0.1 on Snow Leopard I hope cross referencing will be all that I need to finish this off. At this point I've had enough with the CF installer to not want to go back.
# Posted By Mike | 10/4/12 3:59 PM
Andy Welsh's Gravatar Hi! Just wanted to give you a big thank you- I've been struggling with getting this all working for weeks... Really appreciate you blogging this!

Andy
# Posted By Andy Welsh | 10/4/12 6:46 PM
Ryan Guill's Gravatar I just had this issue installing 9.0.2 on osx 10.6. Had 9.0.0 installed and working fine for a long time, uninstalled it and after installing 9.0.2 ran into this. These instructions helped a ton, thank you very much! The only thing I did different is I didnt run the wsconfig again (actually I did a couple of times and couldnt get it to work), so I just copied the jrun section from a backup of my httpd.conf file into my new one and made sure the .so file was in the right place. Restarted apache and everything works great. Thanks again!
# Posted By Ryan Guill | 10/23/12 9:10 PM
Jusuf Darmawan's Gravatar Thank you so much. Help me to solve my problem.
# Posted By Jusuf Darmawan | 10/25/12 4:54 PM
Marcel Dix's Gravatar Thank you very much! It's good to know that people like you take the time to put this in a blog. Although I wonder why Adobe still did not solve this apparent bug in the installer.
# Posted By Marcel Dix | 6/8/13 6:30 PM
BlogCFC was created by Raymond Camden. This blog is running version 5.9.1. Contact Blog Owner