Getting Apache Tomcat 5.5 and PostgreSQL 8.1 to Work Together (Tutorial) (1/3)

Date: 2006_0109
Installation Environment: Mac OS 10.4
Installation Packages: Apache Tomcat 5.5.12, PostgreSQL 8.1
Contributor: Orton Huang [/oth]


[warning] This is not an official tutorial or anything. Follow at your own risk!

This installation is something that I've had to do recently from scratch. I don't have much experience with these packages but basically, I just wanted to set up Tomcat and PostgreSQL so that I can have simple JSP's and Servlet's talk to my PostgreSQL database. Given the abundance of confusing and incomplete tutorials out there, I thought this little tutorial might be helpful for other people. I guess it's somewhat of a beginner's tutorial for beginners. This tutorial is still very applicable even if you aren't running Mac OS 10.4. You'll have to figure out the relevant steps for your own platform however.

Also, please do not distribute without my consent :)

Step 1. Installing Java 1.5 on Mac OS 10.4

Tomcat 5.5.12 requires Java 1.5 (Though I believe you can get away with 1.4 somehow, installing 1.5 doesn't hurt) but it doesn't come packaged with OS 10.4. You can download the dmg here. After you've downloaded it, open the dmg file and install the package. This release doesn't automatically replace the current version, so to make the new version you just downloaded the default Java version on Mac OS 10.4 you have to do a couple of extra steps. You can find the steps here.

Here's a quick rundown:
1. type "sudo su root" to get the privileges that you need, then type in your password
2. type "cd /System/Library/Frameworks/JavaVM.framework/Versions" to go the directory where you will change the default version.
3. type "ls" to look inside the directory to make sure that 1.5.0 is installed.
4. type "rm CurrentJDK" to remove old default.
5. type "ln -s 1.5.0 CurrentJDK" to make 1.5.0 your current default

Now, when you type "java -version", 1.5.0_xx should be your current default.

Step 2. Installing Tomcat

If you don't know what Tomcat is, go to http://tomcat.apache.org.

The best directions I found for installing Tomcat were at the Apple Developer Connection's website here.

/unfinished 01/10/06

Home | Next (PostgreSQL)