This post deals with installing Tomcat 5.5 on OS X 10.5 Leopard, and a future post will cover Tomcat 6. Why Tomcat 5.5? Well, my main Java based web site is hosted under Tomcat 5.5 and Java 1.5, so my main interest at this stage is in setting up a live-like test environment on my Mac. Later I expect to migrate to Tomcat 6, provided there are benefits to doing so, and that will prompt a post at that time.
To be specific, this installation covers Tomcat 5.5.26, which is the latest release of Tomcat 5.5 at this time, on OS X 10.5.2 Leopard, which right now has has Java 1.5.0_13. You can check this by opening a console window and typing:
java -version
You should see something like this in response:
java version "1.5.0_13"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_13-b05-237)
Java HotSpot(TM) Client VM (build 1.5.0_13-119, mixed mode, sharing)
Next we need the Tomcat download, this can be found at http://tomcat.apache.org - there are download pages for 6.0, 5.5 and 4.1; if you need a particular 5.5 release (e.g. a previous patch level) then archives are available here: http://archive.apache.org/dist/tomcat/tomcat-5
Having downloaded Tomcat you need to decide where to install it, and I'm putting it in /usr/local/apache-tomcat-5.5.26 - this naming convention will allow me to install different Tomcat versions. I don't intend to run Tomcat as a service on my MacBook Pro (although I will cover this in a later post on hosting), my primary use here is to run it from Eclipse. Open a terminal window, change directory to /usr/local and then add a tomcat directory:
cd /usr/local
sudo mkdir apache-tomcat-5.5.26
This is created as root, with read-only for everybody else, so in terminal again, lets change the file permissions to allow us to work with this new directory in Finder:
sudo chmod a+w apache-tomcat-5.5.26
Now open a Finder window, and in the Finder menu choose Go / Go to Folder and in the box that appears type in '/usr/local/apache-tomcat-5.5.26/' (but without the single quotes) and then click Go. Drag your Tomcat tar file into this folder and double-click it. This will unarchive the file and create a directory called apache-tomcat-5.5.26. Going back to the command line, change directory into it and move everything up a level:
cd apache-tomcat-5.5.26
sudo mv * ..
At this stage it should be possible to run Tomcat from Eclipse - follow the instructions in this post. I'll add further posts in the near future, completing the details on how to start and stop Tomcat, and get it running a a service.
0 comments:
Post a Comment