Calendar

Subscribe

External Links

Web 2.0

RSS

About Me

Search

Leopard Installed and CF Running with Fusion Debug

Well after a delay with Parcel Force (Because it was a Friday I think) My copy of Leopard turned up today. So Having backed up everything over the weekend I was ready to install it as soon as I opened the package. I did a clean install (Select options on the install menu) and thus erased everything off the machine. With me being me I forgot something to backup my WebSites Folder, but Mozy came to the rescue so I did my first restore which I will say was very very sweet and swift. I'll blog about that another time.

So back to the topic in hand, using Mark Drew's blog posting as a start point I managed to get the default cfusion to start. I then wanted to ensure that while I was using Multi Server edition I could start any server I have installed with different ports so they didn't conflict.

So I created a script with the following contents:


#!/bin/sh
. /etc/rc.common

JRUN_HOME="/Applications/JRun4"
LOG_HOME="${JRUN_HOME}/logs"
CONFIG_FILE="jvm_debug8700.config"
SERVER="cfusion"
RUNTIME_USER="BigMadKev"


if [ ${1:-noset} = "stop" ]; then
su $RUNTIME_USER -c "${JRUN_HOME}/bin/jrun -stop ${SERVER}"
exit 0
fi

su $RUNTIME_USER -c "${JRUN_HOME}/bin/jrun -config ${JRUN_HOME}/bin/${CONFIG_FILE} -start ${SERVER} 1>
${LOG_HOME}/${SERVER}-out.log 2>${LOG_HOME}/${SERVER}-err.log &"

With the last line on one line, Changing the parameters as needed: JRUN_HOME = The Location you install JRUN.

LOG_HOME = The Directory you want the JRUN Logs stored in.

CONFIG_FILE = The Name of the JVM Config file you wish to use.

SERVER = Is the name of the JRun Server you want to start

RUNTIME_USER = You UserName to run the account as.

Once the file is saved in say: /Users/[USERNAME]/Documents/ as startCF Open up a terminal session: Applications > Utilities > Terminal Type:

CD /Users/[USERNAME]/Documents

Chmod +x startCF

You will then be able to start CF with

./startCF

You will be asked for the user's password for the service to start.

And stop the instance with

./startCF stop

Now you will have noticed that I have called the CONFIG_FILE "jvm_debug8700.config" this is a copy of the standard "jvm.config" file located in the bin folder under the JRun Install folder.

With details from the Fusion Debug documentation I saved a copy of the orginal "jvm.config" as "jvm_debug8700.config" then made my changes to the Java Args:

From:


# Arguments to VM
java.args=-Xmx512m -Dsun.io.useCanonCaches=false -XX:MaxPermSize=192m -XX:+UseParallelGC -Djava.awt.headless=true -Dcoldfusion.rootDir={application.home}/

To:


# Arguments to VM
java.args=-Xmx512m -Dsun.io.useCanonCaches=false -XX:MaxPermSize=192m -Djava.compiler=NONE -Xnoagent -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8700 -Djava.awt.headless=true -Dcoldfusion.rootDir={application.home}/

You could create one of these files for each of the servers you want to debug with a different port number in the address=XXXX part.

This will allow you to then have multiple CF Servers running on your mac all with different Debug Ports.

Like some others I then wanted to be able to also run CF7 So I run the CF 7.0.2 Installer and selected the EAR option and then expanded the files are detailed in the readme file attached with the install.

I then started up the JRun Admin and created a new Server removed the deafult-ear folder and copied in the cfusion-ear folder (Remember to edit the application.xml file in cfusion-ear/META-INF to changed cfusion.war ref to cfusion-war)

Then if you try to start the same way as CF8 you get some compile errors so the solution is a new script file as below:


#!/bin/sh
. /etc/rc.common

JRUN_HOME="/Applications/JRun4"
LOG_HOME="${JRUN_HOME}/logs"
CONFIG_FILE="jvm.config"
SERVER="cfusion7"
DEBUG_PORT="8701"
RUNTIME_USER="BigMadKev"


if [ ${1:-noset} = "stop" ]; then
su $RUNTIME_USER -c "/System/Library/Frameworks/JavaVM.framework/Versions/1.4.2/Home/bin/java -server -Djmx.invoke.getters=true -Djava.awt.headless=true -jar ${JRUN_HOME}/lib/jrun.jar -stop ${SERVER}"
exit 0
fi

su $RUNTIME_USER -c "/System/Library/Frameworks/JavaVM.framework/Versions/1.4.2/Home/bin/java -server -Xmx512m -Dsun.io.useCanonCaches=false -XX:MaxPermSize=192m -Djava.compiler=NONE -Djmx.invoke.getters=true -Xnoagent -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=${DEBUG_PORT} -Djava.awt.headless=true -jar ${JRUN_HOME}/lib/jrun.jar -start ${SERVER} 1>
${LOG_HOME}/${SERVER}-out.log 2>${LOG_HOME}/${SERVER}-err.log &"

And again run the chmod -x on the file.

The additional parameter DEBUG_PORT allows you to choose the port that the debugger should run on.

These scripts all basically run the same way they will ask for your password for the user account entered in the script.

I currently don't use APACHE just the built in webserver.

If you want to see what jrun servers are running you can type and run this in terminal

ps ax | grep -i jrun

Very handy especially while I was try to work all this out.

May the Scotch Be With You

Comments
Microsoft-IIS/6.0