- Tomcat tutorial
- What is Tomcat valve?
- Tomcat security realms
- Log4j project
- Log4j appenders
- Log4j configurators
- How to install Apache & Tomcat server
- Tomcat deployment
- Configure Tomcat
- How to use Tomcat manager
- Jakarta Tomcat server overview
- Jakarta Tomcat server (part 2)
- Persistend sessions
- Embedding Tomcat services
- Find out more about Tomcat architecture
- How to install Tomcat on Windows & Linux
To install and configure Tomcat, first download the packages from the previously locations. You should choose the appropriate downloads based on your operating (We cover the steps involved in installing to both NT/2000 and Linux.)
Manually Installing to Windows XP/2000
The first installation we will be performing is for Windows XP/2000. The first thing you need to do is install the JDK. For this example, I am installing the JDK to drive D:, so therefore my JAVA_HOME directory is D:\jdk1.5.
Now you need to extract the Tomcat server to the directory where you want it to run. Again, I am installing to drive D:, which makes my TOMCAT_HOME directory D:\jakarta-tomcat.
After you have extracted Tomcat, you need to add two environment variables to the XP/2000 system: JAVA_HOME, which is the root directory of your JDK installation, and TOMCAT_HOME, which is the root directory of your Tomcat installation. To do this under XP/2000, perform the following steps:
- Open the XP/2000 control panel.
- Now start the XP/2000 system application and click on the Advanced tab.
- Next, click on the Environment Variables button.
- Now click on the New button on the System Variables section of the Environment Variables dialog box. Add a variable named JAVA_HOME and set its value to the location of your JDK installation.
- Your final step should be to repeat Step 4, but this time using TOMCAT_HOME for the variable name and the location of your Tomcat installation as the value. For my installation, I am setting the value to D:\jakarta-tomcat
Installing to Linux
Please note that Tomcat is pre-installed and comes free with our Linux VPS hosting
A Linux installation is a much simpler process compared to a Windows installation. The first thing you need to do is install the downloaded JDK. It is assumed that the JDK is installed to /user/java/jdk1.5.0_06.
After the JDK has been installed, you need to set the JAVA_HOME environment variable. To do this under Linux, find the shell that you are using in Table 1-3 and type the matching command.
You need to replace /user/java/jdk1.5.0_06 with the root location of your JDK installation.
JAVA_HOME Environment Commands
bash JAVA_HOME=/user/java/jdk1.5.0_06;export JAVA_HOME
tsh setenv JAVA_HOME /user/java/jdk1.5.0_06
You now need to extract the Tomcat server to a directory of your choosing. This directory will become the TOMCAT_HOME directory. For this installation, we assume that Tomcat is installed to /var/tomcat.
The last step is to set the TOMCAT_HOME environment variable. Find the shell that you are using and type the matching command.
You need to replace /var/tomcat with the directory of your Tomcat installation!
TOMCAT_HOME Environment Commands
bash TOMCAT_HOME=/var/tomcat;export TOMCAT_HOME
tsh setenv TOMCAT _HOME /var/tomcat