mamamusings

elizabeth lane lawley's thoughts on technology, academia, family, and tangential topics

Wednesday, 28 April 2004

installing tomcat 5 on os x

You’d think there’d be some documentation of this somewhere, wouldn’t you?

Nope. None. Lots on Tomcat 4. None on Tomcat 5. And none that don’t assume some crucial details that I had to bang my head against for a while.

So, for my own reference later (and for the benefit of others who want to do this without having to read a book on the subject), here’s what I ended up doing.

I installed all the XCode 1.1 developer tools for OS X 10.3 (the December 2003 CD). Then I installed the Java 1.42 developer tool update and the Java application server package from the Apple developer site.

The appserver package install gave me Tomcat 4 in the /Library/Tomcat directory, which I then renamed to Tomcat4.

Then I downloaded the latest binary of Tomcat 5 from the Apache Jakarta site.

Following guidelines that I found on developer.com for installing Tomcat 4, I extracted the Tomcat 5 files into a directory in usr/local, and then created a symbolic link to it from the Library directory, like so:

ln -s /usr/local/jakarta-tomcat-5.0.19 /Library/Tomcat

Turns out that when you download and extract the files from the .zip archive, the permissions aren’t set properly to allow execution of the files, so I had to change the permissions on the .bat and .sh files in the /Library/Tomcat/bin directory to allow execution.

chmod 755 /Library/Tomcat/*.sh
chmod 755 /Library/Tomcat/*.bat

When I tried to run Tomcat at this point (/Library/Tomcat/startup.sh), I got an error telling me that JAVA_HOME was not defined. You’d be surprised how hard it is to find out how to fix this seemingly small problem. Several sites told me that I could set JAVA_HOME to /usr, but that was not successful. Then I tried setting it to /Library/Java, but that didn’t work, either. I finally found the solution on SnipSnap.org (although their server wasn’t responding, so I had to use the Google-cached version). Turns out you have to set it to /Library/Java/Home, like so:

setenv JAVA_HOME /Library/Java/Home

Once I’d done that I was able to run startup.sh, and at that point loading http://localhost:8080 successfully brought up the Tomcat 5 home page.

Update, 5/1/04

In order to connect to my mySQL db install using JSP, I downloaded Connector/J 3.0 and installed it using these instructions.

Posted at 1:22 PM in: technology
Trackbacks

TrackBack URL for this entry: http://mamamusings.net/mt/liztrack.cgi/758

Listed below are links to weblogs that reference installing tomcat 5 on os x:

Installing JBoss/Tomcat on OS X Panther from Sundown on May 11, 2004 2:48 PM
Excerpt: Panther Server comes with JBoss already installed, but buried in a FAQ on Apple's developer site, is the fact that you can install the same JBoss e...
Tomcat and OS X from UltraNormal on July 31, 2004 3:08 PM
Excerpt: Thank you, Mama Muser, now Tomcat 5 is running great, and I'm a happy guy....
Comments
Comment from weez on April 28, 2004 6:16 PM (Permalink to Comment)

And what is Tomcat (5 or earlier) and will it play nicely with my mouse?


Comment from Janet Tokerud on May 1, 2004 2:33 AM (Permalink to Comment)

Great instructions. I'm running Panther too. Now that I have such wonderful instructions. I would like to know what you are going to do with Tomcat so I can evaluate if that would be something I would want to do too. I have lots of Macs at my home/office. Thanks!


Liz sipping melange at Cafe Central in Vienna