ColdFusion & OS X / Unix Matt | 31 May 2007 12:15 am
OS X Upgrading ColdFusion 7 to ColdFusion 8 with Apache2, Jrun4, MultiServer Config
I like to have ColdFusion running on OSX as it would on my Linux server using mod_jrun thorough Apache2. The CF8 install process wants me to uninstall Jrun4 but I’ll just move things out of the way. As well Jrun still wants to use my default version of Java. Since I don’t want my entire laptop using Java 1.4.2 which is required for Jrun as far as I know, I’ll need to modify the CF8 startup script. As well, I’ll make sure to clean out my old mod_jrun config entries in my apache2 httpd.conf file.
I’ll include a detailed narrative with command line entries and code. If you have any questions, I’ll monitor the comments on this page. I hope your install goes well!
Open a Terminal
# Comments are preceded with a hash.
# stop Jrun and thus the ColdFusion service. I have a little program I can quit, you can always kill your jrun service directly from the OS X activity monitor by searching for Jrun … or stop it dead in the terminal by looking for it’s process id and killing that:
ps ax | grep -i jrun
# 1118 p1 S 0:10.01 java142 -jar jrun.jar -start cfusion
kill -9 1118
# I use a “9″ kill signal which is the equivalent of ripping the plug out of the wall
# find and backup Jrun config files
locate jrun
location Jrun
sudo cp /etc/httpd/jrun.conf /etc/httpd/jrun.conf.bak
# I know there’s some pointers to Jrun in my apache httpd.conf file too, back that up just in case
sudo cp /etc/httpd/httpd.conf /etc/httpd/httpd.conf.bak
# find ColdFusion related stuff to back it up
locate coldfusion
locate ColdFusion
# go into main application dir running either as a standalone, under tomcat or in my case under Jrun
cd /opt/Local
tar zcvf Jrun4_cf7.tgz Jrun4
# now move the Jrun4 directory temporarily
sudo mv Jrun4 Jrun4.cf7
# go into StartupItems and backup the startup script
cd /Library/StartupItems
sudo tar zcvf ColdFusionMX7Multi_good.tgz ColdFusionMX7Multi
# find your CFIDE directory to backup if it’s outside of your coldfusion base directory, mines at /home/www/localhost/CFIDE
cd /home/www/localhost
sudo tar zcvf CFIDE_cf7.tgz CFIDE
# and now move it as well
sudo mv CFIDE CFIDE.cf7
# Step away from the terminal
Browse to your CF8 RC 1 installer: scorpio_RC_osx.zip and unzip it.
This creates ColdFusion 8 Installer. Double click that.
Select your language, click “OK”
Accept the terms of the license agreement., Click “OK”
I select “Developer Edition” and do not enter a serial number.
I select the Multiserver Configuration.
The next screen is a warning asking if CF8 or Jrun4 is already installed. Well Jrun4 is already installed but I’ve moved it out of the way and made a backup of any existing config files. I answered “no” to this question.
Now I selected everything for installation, the docs, start cf on system init (this makes a script in /Library/StartupItems) and install LiveCycle Data Services ES. I won’t use it personally in the near future but we’re doing a bunch of Flex stuff inhouse.
Now I’m asked for my Jrun4 directory. I’ll specify the location of my original Jrun4 install which is now moved out of the way. /opt/local/Jrun4
I don’t have a serial number for LiveCycle Data Services so i leave this blank, click next, except this new agreement and click next again.
Now I’m asked if there’s an earlier version of ColdFusion on this machine, why yes there is. Mine is at /opt/local/JRun4.cf7/servers/cfusion/cfusion-ear/cfusion-war/WEB-INF/cfusion/
The next step confirms that a previous version of ColdFusion is installed and asks if I’d like to use the built in webserver or configure my webserver for use with CF8. I chose to configure my webserver.
On this next screen I click the Add button. I select Apache from the Web Server dropdown, and end up leaving the defaults for my config directory and paths to the apache binaries.
** Note: these default locations for Apache are for the standard OS X install of apache 1.3 which I had previously dismantled and symlinked all the standard defaults to my apache2 install. Your apache configuration directory is where you’ve got your httpd.conf file. You can find the location of httpd and apachectl by typing the command “which httpd” or “which apachectl” in the terminal. **
The next screen asks where you’d like to place the coldfusion administrator (the CFIDE) directory. I put it the same place as where i’d be able to see http://localhost in a web browser. You can put it anywhere that’s locally web accessible.
After choosing your cf admin directory click next again and you’ll be prompted for a main cf administrator password. You’ll have the option to setup other administration accounts later with granular permissions but this is the all access account.
Next I’m asked if I’d like to enable RDS, the Remote Development Service. Since this is a development machine and there are some debugging features that go along with RDS, I’m going to enable it and specify a password.
Lastly I’m asked for my current user password for the user I’m logged in as, matt. I will specify this now because I’ve opted to have CF start when I login.
This last screen sums up what’s about to happen. I review, click OK and hope for the best (note my web root path is translated from the symlink I gave coldfusion during the install, this is not an error)
# httpd.conf
# The jrun installer is just going to add configuration settings to your httpd.conf file on top of what’s already there. I noticed a few slight differences in these settings. I’ve gone into httpd.conf and deleted the old stuff.
# By default Jrun4 still wants to startup using whatever version of Java you have set as your default and in my experience, java 1.5 just doesn’t work.
# change the startup script so that version 1.4.2 of java is used to fire up jrun4, leaving version 1.5ish for everything else on your mac
# I have a symlink in /usr/bin that points java142 to it’s real location on my machine
ln -s java142 -> /System/Library/Frameworks/JavaVM.framework/Versions/1.4.2/Commands/java
sudo edit /Library/StartupItems/ColdFusion8Multi/ColdFusion8Multi
# removing some existing lines of code, my startup script now looks like this:
#!/bin/sh
. /etc/rc.common
#
# Start ColdFusion 8 Multiserver
#
# Because this is a start up script, and will be run by root, we use a specific
# user (the user who installed) to run ColdFusion
CF_DIR=”/opt/local/JRun4″
RUNTIME_USER=”matt”
# 1.0/Initial
##
if [ ${1:-noset} = "stop" ]; then
cd “$CF_DIR/lib”
su $RUNTIME_USER -c “java142 -jar jrun.jar -stop cfusion”
exit 0
fi
cd “$CF_DIR/lib”
su $RUNTIME_USER -c “java142 -jar jrun.jar -start cfusion &”
Now I reboot. CF8 could be stated manually but I’d like to test the auto start as well.
Everything comes up fine.
I browse to http://localhost/CFIDE/administrator/ and I see the new administrator. The first thing I’m going to do is edit all my MySQL (3) datasources to MySQL (4/5). Unfortunately it looks like each one needs to be dropped and created from scratch, no biggie.










on 13 Jun 2007 at 1:00 pm 1.brian said …
HELP!!:)
when I try to add a new local web server, I have to following:
Jrun host:localhost
Jrun Server:coldfusion
Web Serverproperties:
Web server Apache
Configuration directory: (blank, and when I put in /usr/sbin/ which is where the httpd file is, it doesn’t work)
I then click OK and let it stop/restart, and I get an error message that says that /usr/sbin/ isn’t a valid location.
I’m new to macs, and never used apache, so please go easy on me.
Thanks!
on 13 Jun 2007 at 1:25 pm 2.Matt said …
I assume from your comment about being new to a mac and never using apache that you’re not upgrading to ColdFusion 8 from ColdFusion 7. Also, I assume you’d like to just use the version of apache that comes with your Macintosh, version 1.3. This page was initially about upgrading but the instructions for a fresh install are very similar. And really, using Apache 1.3 that comes with your mac is fine too unless you’ve got specific needs for version 2 (most folks don’t).
On the page in the ColdFusion 8 install process called “Configure Web Servers / Websites, I click the “Add” button. Up pops a separate box where my default installation of Apache is recognized. (If you skipped this Add step, I’d delete the ColdFusion and Jrun directories and rerun the installer). I confirmed the location of the things it was looking for by opening up a terminal and looking for the config directory and the two programs. Specific commands to type in, one at a time, minus the quotes and hitting the enter key after each are: “ls -l /etc/httpd” “which httpd” “which apachectl”. You should see some that there are files in the /etc/httpd directory and that both httpd and apachectl can be found in the location that’s listed in the “Add Web Server Configuration” window.
If my assumptions are incorrect here and you’ve installed Apache 2 separately while uninstalling Apache 1.3, then I imagine the locations of httpd and apachectl will not be found. I can look up what the defaults were and assist with that as well.
Hopefully this helps a bit, if not, repost some more details with what else you need or any more specific issues that are coming up. I do have some screen shots that I could post after work this evening.
-Matt