CFMXJrun on the MacBook Pro is (more or less) complete
With much help from Simeon I'm all set with CFMX and jrun on my MBP.
I initially followed (again with some nudges from Simeon) the Definitive guide. And now that I'm done, have gotten adventurous.
The guide calls for using Lingon, which does just fine, except I'd rather not run the servers when I'm writing, surfing the web etc. No need to waste resources when they can be put to other uses :)
Some googling led me to a post from Sean, that (it took me a while to realize this) was almost 3 years old. Before I could even start doing what Sean prescribed (*nix n00b here) I had to learn what a shell script was and how to write one.
That done. I started playing with what Sean described. And then Simeon came to my aide yet again with an example script he uses to fire off servers. He's more of a Command line(r) than I am, so I took that and what Sean described 3 years ago and came up with what's below. It's mostly the same app Sean wrote about, except the command line to fire off CFMX and java are different.
So to start my servers
#!/bin/sh
JRUN_HOME="/Applications/JRun4"
LOG_HOME="${JRUN_HOME}/logs"
if test x$1 = x
then
server=default
else
server=$1
fi
/System/Library/Frameworks/JavaVM.framework/Versions/1.4.2/Home/bin/java -server -Djava.awt.headless=true -jar /Applications/JRun4/lib/jrun.jar -start ${server}
1>$LOG_HOME/${server}-out.log 2>$LOG_HOME/${server}-err.log &
and to stop them
#!/bin/sh
JRUN_HOME="/home/jrun"
if test x$1 = x
then
server=default
else
server=$1
fi
/System/Library/Frameworks/JavaVM.framework/Versions/1.4.2/Home/bin/java -server -Djava.awt.headless=true -jar /Applications/JRun4/lib/jrun.jar -stop ${server}
named CFMXstart and CFMXstop respectively. Then Seans Apple Script, directly from his site.
You'd need to still do the chmod +x filename on both to make them executable.
set scriptStem to "/Users/scorfield/bin/cfmx"
display dialog "Manage which server instance?" buttons {"Cancel", "Start", "Stop"} default answer "default"
set response to result
set operation to button returned of response
set serverName to text returned of response
if operation is "Start" then
do shell script scriptStem & "start " & serverName
else if operation is "Stop" then
do shell script scriptStem & "stop " & serverName
end if
Now I click my CF Launcher app and type in the server name and can either start or stop it.
Now to tackel MySQL or leave MS SQL in Parallels, I'm not sure.
UPDATE: Make sure you change any paths to reflect your own setup. unless you have a seancorfield user on your mac and installed your Jrun to the same place Sean did.
This is my V1 to get me going. I'd like to use this to learn more Apple Script, maybe add a drop down and somehow check the status of the server... we'll see. It's ruff, but better than nothing

There are no comments for this entry.
[Add Comment]