How to Install Tomcat on Windows 7

Apache Tomcat is a web server, or application server (HTTP), which has the ability to provide an environment to run Java code. It comes with multiple features like sophisticated management, configuration tools, and XML configuration files....

Part 1 of 4:

Downloading the Tomcat Installer

  1. Picture 1 of How to Install Tomcat on Windows 7
    Access the Tomcat Download page. Open a new browser tab or window and enter 'Apache Tomcat 7 download' in the address bar. Hit the Enter key to view the search results. Select the first link in the results from the official Apache Tomcat page.
    1. Tomcat 7 is the latest version, though you can select earlier versions from the left menu panel on the download page.
  2. Picture 2 of How to Install Tomcat on Windows 7
    Download the installer zip file. Go down the page to find the 'Binary distribution' folder under the '7.0.62' heading. In the folder, locate 'Binary Distribution/Core' heading and click the 'Zip' link to download the installer. #* The unitary file size of the zip package is around 8MB.
  3. Picture 3 of How to Install Tomcat on Windows 7
    Unzip the installer. Go to the 'Download' folder of your computer and unzip the file with WinZip or WinRAR, or whatever unzipping program you have. Avoid unzipping the folder to the desktop, as you will find the path of the software files hard to locate later. The best option will be to unzip to 'E:myserver.' The unzipped directory will be 'E:myservertomcat-.0.62.'
Part 2 of 4:

Installing Tomcat

  1. Picture 4 of How to Install Tomcat on Windows 7
    Check the installation directory. Check the installed directory to ensure it contains all the sub folders (bin, logs, webapps, work, temp, conf, and lib). These are the required subfolders for installing the server. If any of the folder is missing, download the zip file again.
  2. Picture 5 of How to Install Tomcat on Windows 7
    Create JAVA_HOME. After checking the directory, you should create an environment variable called 'JAVA_HOME.' To do this, go to Start >> Control Panel >> System >> Advanced System Settings. After reaching it, click the 'Advanced' tab, then click Environment Variables >> System Variables.
    1. Select the 'New' button in the System Variables menu. In the 'Variable name' field, enter 'JAVA_HOME.' Enter 'c:Program FilesJavajdk1.7.0_{xx}' in the 'Variable value' field. (Variable value is nothing but the JDK directory, you can always find this in program files.)
  3. Picture 6 of How to Install Tomcat on Windows 7
    Ensure its workability. To make sure that it's working correctly, start a command shell and issue: set JAVA_HOME. To open the command shell, click the 'Start' button and then 'All Programs'. Type the following in the command prompt, 'set JAVA_HOME = C:Program FilesJavajdk1.6.0_06' and press enter. The JAVA_HOME is set. Type the following in the command prompt, 'set JAVA_HOME = C:Program FilesJavajdk1.6.0_06' and press enter. The JAVA_HOME is set.
  4. Picture 7 of How to Install Tomcat on Windows 7
    Create JRE_HOME. At times, you may need to set JRE_HOME instead of JAVA_HOME, like errors when using Java. If this is the case, JRE should be used. Create JRE_HOME the same way you created Java, but remember that the JRE installed directory will be different (C:Program FilesJavajre7).
Part 3 of 4:

Configuring Tomcat

  1. Picture 8 of How to Install Tomcat on Windows 7
    Locate the configuration files. Locate the four configuration XML files of Tomcat in the 'conf' sub-directory of the Tomcat directory (E:myservertomcat7.0.40conf). The four files should be context.xml, tomcat-users.xml, server.xml, and web.xml file.
  2. Picture 9 of How to Install Tomcat on Windows 7
    Create a backup. Before proceeding, make a backup of the configuration files. Because of file permissions with your backup/restore, you don't want to restore the server with different file permissions than what was there originally.
    1. To do this, go to Internet router >> Prompt, issue the Enable command by entering 'Enable,' and provide the required password when prompted. A page will be displayed with your router settings. Entering 'Enable' will change the prompt to Router#, which indicates that the router is now in privileged mode. Copy the running configuration file to the TFTP server.
    2. Afterwards, open the configuration file with a text editor, like Textpad or Notepad. Search for and remove any line that starts with 'AAA.' Copy the configuration file from the TFTP server to a new router in privileged (enable) mode, which has a basic configuration.
  3. Picture 10 of How to Install Tomcat on Windows 7
    Enable directory listing. Open the configuration file 'web.xml' in a text editor, and change the directory listing by changing 'listings' from 'false' to 'true' for the 'default' servlet.
  4. Picture 11 of How to Install Tomcat on Windows 7
    Set the TCP Port Number. Open the configuration file 'server.xml' in a text editor. The default port number of Tomcat is 8080. Now you need to change this, since the same port number can be used by other servers like SQL Server. You may choose any number between 1024 and 65535.
  5. Picture 12 of How to Install Tomcat on Windows 7
    Enable automatic reload. Open the configuration file 'context.xml' in a text editor. Here, set reloadable='true' to the element to enable automatic reload after the code changes.
Part 4 of 4:

Starting Tomcat

  1. Picture 13 of How to Install Tomcat on Windows 7
    Run the startup. Launch the command prompt in Windows 7. Once launched, set the current directory to 'bin'. For example, E:myservertomcat7.0.40bin, and run 'startup.bat'.
    1. When you first start the command prompt, you will be located in your personal directory. This is typically C:Usersusername. With the basic navigation commands, you can set the directory as specified in the above step.
  2. Picture 14 of How to Install Tomcat on Windows 7
    Start the server. This will direct you to a new console window of the server. Read the messages that appear on the console. Look out for the Tomcat's port number and double-check.
  3. Picture 15 of How to Install Tomcat on Windows 7
    Access Tomcat. Open any web browser on your Windows and then enter the URL 'http://localhost:9999'. This will direct you to the Tomcat server's welcome page. Once you are directed to the server page, you are almost done. Now try the URL 'http://localhost:9999/examples' to view JSP and servlet examples.
  4. Close Tomcat when you're done. To do this, press Ctrl + C in the Tomcat console.
Picture 16 of How to Install Tomcat on Windows 7
Update 04 March 2020
Category

System

Mac OS X

Hardware

Game

Tech info

Technology

Science

Life

Application

Electric

Program

Mobile