Once you download tomcat, you will need to unzip or untar it. To untar using GNU tar on Linux, use the command below. If you are running Windows and downloaded the zip version, your best bet is to use winzip to expand the zip.
The location in which you expand the package will be known as TOMCAT_HOME. When installing on a Linux system, it is usual to use ~/jakarta-tomcat-3.2.3 as TOMCAT_HOME. On Windows, the normal is C:\jakarta-tomcat-3.2.3. You dont have to use these locations, but if you're not sure where to put things, they're a good place to start. From now on I will simply refer to them as TOMCAT_HOME.
Tomcat requires two environment variables to be set to run properly: TOMCAT_HOME and JAVA_HOME. On Linux Tomcat does an excellent job of guessing these values, and you may well get away without setting them. On Windows you must set JAVA_HOME. You can probably get away without setting TOMCAT_HOME in both cases, but its good practice to do so.
TOMCAT_HOME, as you might have guessed, is simply the location that you expanded the Tomcat distribution into. This is required so Tomcat knows where to find configuration files, web applications, and as a general base point. If you followed my advice above, then on Linux your TOMCAT_HOME will be ~/jakarta-tomcat-3.2.3, on Windows your TOMCAT_HOME will be C:\jakarta-tomcat-3.2.3.
JAVA_HOME is the directory of your JDK install. If you are unsure of where this is, start by finding your java or java.exe file. Assuming you've found the right java then your JAVA_HOME should be the directory one above the directory containing java or java.exe (which incidentially will be inside a bin directory).
So now that you've determined the location of TOMCAT_HOME and JAVA_HOME how do you set them. On Linux, add the following to your .bashrc file:
After saving your changes you will need to load them. Do this by sourcing the .bashrc file:For Windows 98 users, edit your C:\autoexec.bat and add the following lines:
After doing this you will need to reboot the machine.For Windows NT users, do the following:
Right-click on My Computer
Select the properties tab
Add a property named TOMCAT_HOME with a value of C:\jakarta-tomcat-3.2.3
Add a property named JAVA_HOME with a value of C:\jdk1.3.0_02