Originally Published: Tuesday, 2 October 2001 Author: Henry Chen
Published to: enhance_articles_sysadmin/Sysadmin Page: 2/6 - [Printable]

Serving Java from Linux

Ever want a server on your box that can serve JSP and Java Servlets but don't want to pay big money for a commercial solution? Then Linux.com has the article for you. Follow author Henry Chen into the land of the sun.

Installation  << Page 2 of 6  >>


I will assume that you have downloaded the above tarballs/RPMs into your home directory.  From here on, I am going to refer to your home directory as ~$username.  You also need root privilege for most of these steps.  You need to do the Java SDK first because Tomcat requires it.

Java SDK

The file that you have downloaded is not actually the RPM.  Sun makes you go through this legal looking documentation, then the file will extract a RPM for you.  Type this in your home directory:

chmod 755 j2sdk-1_3_1-linux-i386-rpm.bin ./j2sdk-1_3_1-linux-i386-rpm.bin

Now, you have to go through the legal looking documentation.  Once you answer "yes", a RPM file will be created.  Now do this:

umask 022
rpm -ivh jdk-1.3.1.i386.rpm
ln -s /usr/java/jdk1.3.1 /usr/java/jdk

That's it.  We now move on to Tomcat.


Some parts of the following I first learned about with the help of Jakarta Project's Tomcat - A Minimalistic User's Guide.   In the following sections you will need to edit some files.  To edit files,  I use vi.  If you hate vi, anytime you see vi, just replace it in your mind with your favorite editor.

vi hint:  hit i for insert, the [ESC] key to end insert, and :x to save and exit.  If you made a mistake, hit [ESC] to stop whatever you are doing and :q! to exit without saving.

The Java SDK RPM installed the Java related files in /usr/java/jdk1.3.1.  So, I decided to put the Tomcat related files in the /usr directory as well.  You are still root, so do this:

cd /usr
tar -xzf ~$username/jakarta-tomcat-3.2.3.tar.gz
ln -s jakarta-tomcat-3.2.3 tomcat

Installation  << Page 2 of 6  >>