I was working at La Cantine today, a great co-working place in Paris. In fact, I prefer this place than incubators. It’s like a big loft with long tables, cozy armchairs, sofas, a bar; anything you need to work in an productive environmnent. You’ll meet developers, designers, investors, technical book writers, etc.
And when you work/play/chat/drink in a co-working place, there’s regularly someone with a problem. Noob questions like “I can’t connect to the Wifi network”! “I can’t restore my backup!”, and also more advanced questions.
So, I was asked today: “How can I install Tomcat on my MacBook ?”. I supposed that in 2008, there should be tons of articles about installing Tomcat on a Mac, but I did not find one. Actually, I admit that I only looked at the first result page on Google… you know that Google is pretty good at crawling blogs. Did you try to search for flex ruby graph or ruby sqs graph ?
Before calling for help, the guy -let’s call him Roger- read some forum posts, began to install Tomcat in /usr/local, set its environment variables, and ran into the famous error message “The BASEDIR environment variable is not defined correctly”.
Roger, you need to know one thing: there’s develoment environment and production environment. So do those three simple things and you’ll be fine:
- Untar Tomcat to your /Applications directory. Important: Take the tar.gz archive, it keeps file modes and authorizations for *nix systems
- With the Terminal, create a file named .bash_profile in your home directory (aka ~) via the command nano ~/.bash_profile and copy-paste this text:
.
export CATALINA_HOME=/Applications/apache-tomcat-5.5.26 export JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Versions/1.5/Home alias starttomcat="$CATALINA_HOME/bin/startup.sh" alias stoptomcat="$CATALINA_HOME/bin/shutdown.sh"
- Start a new Terminal and type starttomcat and stoptomcat to… you guess.
I did put Tomcat in the /Applications folder for on reason: it’s not hidden in the Finder and it’s easily accessible. Noobs do not understand the difference between system directories and friendly directories on Mac OS X. And they want to see the Tomcat folder, so they can put their .war files in the webapps directory and check log files with one click on the mouse button.
By the way, I didn’t ask Roger why the hell he was coding a new project in Java. And I really do not want to know…
Recent Comments