1

CSC 336Communications and Networking II

Lab: Install Tomcat Web Server & Dynamic Web Page Generation

Themes: Tomcat, HTML, JavaScript

  1. Install Apache Tomcat –the web server

You will receive a file with the name apache-tomcat.7.0.8.zip. (Optionally, you can download it from

  1. Then, you need to set up several environment variables. (To use a startup file, skip steps a - g)
  2. The way to set up the environment variables requires: (1) Click the Start>Control Panel>System (2) Click the Advance Tab (3) Click the Environment Variables at the bottom of the window (4) Choose the top window “User Variables” for your changes (5) Click the JAVA_HOME (if any) and then click the option button “EDIT” or simply click the “New” button to create one.You will see two small windows for setting up the environment variables. You will use the top one labeled as the “User Variables” for the following steps.
  3. Add JAVA_HOME=c:\Program Files\Java\jdk1.6.0_20\
  4. Change the original “Path” to add the following value at the beginning:PATH=.;c:\Program Files\Java\jdk1.6.0_20\bin\;c:\Program Files\Java\jdk1.6.0_20\jre\bin\; (all in one line)
  5. AddCATALINA_HOME=c:\apache-tomcat-7.0.8
  6. Change the original “Classpath” to add the following at the beginning of the following:

CLASSPATH=.;c:\apache-tomcat-7.0.8\lib\servlet-api.jar;

  1. After you complete this, you need to click OK three times to back out.
  2. Open a NEW command prompt window and enter “set” again to view the new setup.
  3. Download the StartUp file from D2L and modify the file to point to the wherever you store the apache-tomcat-7.0.8 folder.
  4. Bring up a Command Prompt window and execute the start up file StartUp. You may need to change it to StartUp.bat and then execute it by entering the name.
  1. To test your installation, you should start Tomcat by opening a command prompt window and enter the command %CATALINA_HOME%\bin\startup (the batch file) and clicking on the icon. Then you should bring up a Web browser and enter . You should see the screen as in Figure 1 to be displayed on your browser window. If you don’t, you need to check the environment variables.

Figure 1 Test your Tomcat installation.

  1. You can now download the html file test.html from the Course Notes of yourD2L account. First, create a folder c:\apache-tomcat-6.0.24\webapps\HTML and store this file as test.html. This file is a web page source file.
  2. Open a Web Browser, a Web client, and enter the web page address:
  3. The client-server architecture is the fundamental base of all web applications running on the Internet. The server programs must be executed prior to the execution of any client programs. For example, an e-mail client requires an e-mail server to be up and running prior to the start of the client; a web client requires a web server to be up and running when the web address is entered.
  4. The purpose to install the Tomcat server on your local machine is to be able to test/learn HTML or Javascript programming without using another machine to run the Web server. That’s the advantage of installing a Tomcat server on your local machine.