Greg's Blog

helping me remember what I figure out

Apache: Configuring Tomcat

| Comments

In the following I shall talk you through configuring and installing Tomcat [at the time of writing the latest version was 3.2.1] (a JSP server) to run with your Apache server on your Windows box. Before we get started you will need to get the following files (and I am assuming that you have Apache installed and configured properly):

Once you have downloaded these files, start off with extracting the Tomcat source files and installing the JDK 1.3 files. For simplicities sake extract and install the files into the root of your drive. Once done you will need to edit the wrapper.properties file (usually located in: <drive letter>:\jakarta-tomcat-3.2.1\conf. You will need to specify both your tomcat home directory and your Java directory. Look for the following lines:

#
# wrapper.tomcat_home should point to the location where you
# installed tomcat. This is where you have your conf, webapps and lib
# directories.
#
wrapper.tomcat_home=<put your Tomcat home>

#
# wrapper.java_home should point to your Java installation. Normally
# you should have a bin and lib directories beneath it.
#
wrapper.java_home=<put your Java home>

Modify that section to refelect your installation directories:

#
# wrapper.tomcat_home should point to the location where you
# installed tomcat. This is where you have your conf, webapps and lib
# directories.
#
wrapper.tomcat_home=<drive letter>:\jakarta-tomcat-3.2.1\

#
# wrapper.java_home should point to your Java installation. Normally
# you should have a bin and lib directories beneath it.
#
wrapper.java_home=<drive letter>:\JDK1.3.0_02\

Save the file. Next extract the jk_nt_service file you downloaded into your tomcat home directory, open a command prompt window and change to that directory. Once there type the following command:

jk_nt_service -i Tomcat <Drive Letter>:\jakarta-tomcat-3.2.1\conf\wrapper.properties

Should your install directory include and spaces you will need to put your wrapper.properties path in quotation marks. OK, once done start the service by typing net start Tomcat. It should have started without any problems. Next locate the file called tomcat-apache (usually also located in <drive letter>:\jakarta-tomcat-3.2.1\conf) and open it. Copy and paste the content into your Apache http.conf (located in <drive letter>:\Program Files\Apache Group\Apache\conf\). Save the changes and stop your Apache server (net stop apache). The final step involves copying the ApacheModuleJServ.dll into the modules directory in your Apache install directory and restarting the Apache server.

OK, ready to test your work? Open a web browser and enter the following URL http://localhost/examples/jsp/. You should be presented with a list of examples. Try them out. If you installed everything correctly they should be working. Welcome to the world of JSP.