How to install Tomcat 4.0b1 on Mac OS X final:
first draft. corrections welcome.
miles poindexter miles@openly.com
27 March 2001
NOTE: I put double or single quotes around a lot of the commands to type. Don't actually type the quotes, just the txt inside them.
1. download the binary from
http://www.apache.org/. I recommend the tar.gz version. In the jakart-apache ftp list, the file is: jakarta-tomcat-4.0-b1.tar.gz
2. launch your terminal and change directory to where you want to install this file. I installed it into my /Applications folder. but I don't think it matters.
3. In this directory, type:
"tar xvfz /full/path/to/downloaded/file/jakarta-tomcat-4.0-b1.tar.gz" Replace "/full/path/to/downloaded/file/" with the absolute path to your downloaded file! Then type "ls" to see if the installed Tomcat app is there. It should be a folder called: "jakarta-tomcat-4.0-b1"
4. before launching, we need to add some stuff to your csh.cshrc file.
5. First you must be able to log in as ROOT. Type "su" and give your password that you chose when you installed OS X. If it says 'sorry' we need some more steps. (see 6)
6. Do this if you can't log in as ROOT:
A. In the finder, go to Applications/Utilities and launch, "NetInfo Manager"
B. Under the "Domain" menu, there is a submenu called, "Security", select the item there called, "Authenticate..."
C. type your password that you chose when you installed OS X
D. Go to the security menu again and now select "Enable Root User"
E. Type the same password. After this, you will be able to "su" and use the password you specified.
7. OK, now go back to your terminal window. You should now be able to "change user" to root. Type "su" then your password.
8. change directory into your tomcat home directory. The easy way for me is:
"cd /Applications/*1b" since I don't have any other folder ending with "1b"
9. As a root user, type: "pico /etc/csh.cshrc" Use your down arrow key to scroll past this line: 'source /usr/share/init/tcsh/rc' and type this in:
setenv JAVA_HOME /System/Library/Frameworks/JavaVM.framework
setenv TOMCAT_HOME /Applications/jakarta-tomcat-4.0-b1
10. Replace "/Applications/" with the actual path to your Tomcat folder. Now hold down the control key, and hit the x key. Type 'y' to indicate you want to save the changes, and then hit enter. You should be out of pico now and back at the command line.
For this to take effect, you need to log out and back in. Go to your finder and choose log out. Then log in again, launch the terminal app, etc.
11. Now, Tomcat is used to unix systems that store their java tools in a folder called "bin". But OS X stores them in "Commands". So we have to make a symbolic link so Tomcat sees the contents of Commands when it looks in bin. Make sure you're ROOT, and type: "cd /System/Library/Frameworks/JavaVM.framework". Type "ls" to look around. You should see a folder called "Commands" among other things. Type: "ln -s Commands bin" and that should do it.
12. Now we can start Tomcat. type: "cd /Applications/*b1" or whatever to get you to Tomcat's home directory. Then we don't want to be ROOT anymore. So type: "su yourUserName". (where "yourUserName" is your normal login name) and you should be back to your regular harmless user self.
13. To start Tomcat type: "/bin/startup.sh" It starts fairly quickly. To see if its working. Go to your browser and type in this address:
http://127.0.0.1:8080. You should see the friendly tomcat icon and a welcome msg. To stop tomcat, make sure you're in the Tomcat home directory, and type: "/bin/shutdown.sh"
14. Using Tomcat:
A. To run your servlets, compile them into .class files and put them here:
/Applications/jakarta-tomcat-4.0-b1/webapps/ROOT/WEB-INF/classes
If the classes folder isn't there you can make one. (type: mkdir classes) To see your servlet in action, go to your browser and put the address:
http://127.0.0.1:8080/servlet/YourServlet. If your servlet is called YourServlet.class.
B. If you are using jars for your support files, you can put them here:
/Applications/jakarta-tomcat-4.0-b1/lib
and Tomcat will automatically add their contents to its classpath.
C. If your java classes need to read properties files, you can place them in Tomcat's home directory: /Applications/jakarta-tomcat-4.0-b1
- miles