☰ Menu

How to Install Apache Tomcat on a Windows Virtual Machine?


Are you looking to find out the best possible way to install Apache Tomcat for Windows?


Do you want to go through easy and simple installation steps to avoid complications?


In recent years, Java-based software has become established in every industry because Java powers several popular operational components.


Apache Tomcat is an open-source web server for Java that is the foundation behind the rising demand for Java across industries. Its feature-rich web application environment makes it a must-have for all Java programs.


So let’s go through the three simple steps that can help you kickstart working with Java web projects on your Windows system.



3 Steps for Installing Apache Tomcat on Windows

There are two methods that you can choose for installing Apache Tomcat on Windows:


  • Either use a service installer for Windows

  • Or a zip archive

But before you start with the process, there are a few prerequisites that are important for you:


  • You must have an administrator-level user account.

  • Install and configure Java JRE.

Once these requirements are satisfied, you can proceed with the following steps:


  • Get the Windows Version of Apache Tomcat


    You have to start the process by downloading a copy of the Tomcat installation file:


    • Visit the official website of Apache Tomcat, and find the Download section to get the most recent version of the software.


      Apache Tomcat
    • Then scroll down to the binary distributions part of the page.

    Select the download line for the 32- or 64-bit Windows Service Installer or Windows zip file in the Core list.

    Apache Tomcat Installer
  • Set Up the Apache Tomcat Server on Your Windows Machine


    Based on the installation process chosen, you can proceed and install Tomcat using the Windows Service Installer for an automated guided installation process or the zip archive.


    During the setup process, you can configure the Tomcat service to initiate automatically upon system startup.


    Opting for the zip archive is beneficial if you seek a flexible setup. If there's no longer a need for Tomcat, you can simply remove it by erasing its directory or moving it to a different location.


    Approach 1 – Set Up Tomcat Using the Installer for Windows Services


    You can follow a few simple steps to install Tomcat using the Windows Service Installer:


    • Start the installation by running the Windows Service Installer file you've downloaded.

    • Proceed by selecting Next on the welcome screen of the Tomcat Setup.


      Apache Setup
    • Review the License Agreement carefully and choose I Agree if you accept the terms, which allows you to move on to the subsequent step.


      Apache Setup
    • It's advised to choose the Full option from the list of component selection options during the Tomcat installation to ensure that the wizard installs the Tomcat Host Manager, Servlet, JSP example web applications, and other necessary components. If you prefer, you can opt for the Normal option to install the default set of components.

    After making your selection, click Next to proceed to the following step.


    Apache Setup
  • On the configuration screen, you can adjust basic settings like port numbers and the Windows service identifier. You can set up an administrator login for the Tomcat server. While this step is optional, you can choose to bypass it for now and configure these details later.


    Apache Setup
  • In the next screen, input the complete path to the JRE (Java Runtime Environment) directory on your computer. If the Java environment variables are already set up on your system, the installation wizard should automatically detect and fill in the JRE path. After this, click Next to advance to the next phase of the installation.


    Apache Setup
  • You can choose a specific installation location for the Tomcat server, or simply proceed with the default location provided. Once you've made your choice, click on the Install button to start the installation process.


    Apache Setup
  • After the installation completes, you can select Run Apache Tomcat to initiate the service right away once the wizard closes. You should also check the box for Show Readme to view the changelog and stay informed about the latest updates and changes. Click Finish to conclude the installation process and close the wizard.


    Apache Setup
  • If you chose the Run Apache Tomcat option previously, a popup window will appear, signalling that the Tomcat service is initiated. Once the startup process is complete, this window will close automatically.


    Apache Daemons

Following these simple steps, you can install the Apache Tomcat web server successfully.


Approach 2 – Use the Zip Archive to Install Apache Tomcat


Before proceeding with the installation steps, ensure you download the suitable zip archive from the Tomcat Download section.


  • After downloading, based on your Windows version, unzip the 32-bit or 64-bit file. To do this, right-click on the zip file to access the context menu and select the 'Extract All' option.

  • When prompted, decide on the destination for the extracted files. For ease of access, it's recommended to extract the files to the root directory. The location can be changed later for better server management by renaming the installation directory.


    Apache Tomcat Archize
  • Now you have to locate the server.xml file by going to the conf sub-directory in the extracted installation directory.

Please note that you have to create a backup of the.xml configuration files before implementing any changes.


  • You can use a text editor to open the file and spot the following lines in the server.xml file for the modification of the entry for the port (Default connecting port is 8080).

    connection

    Save and exit the editor.

  • Modify the web.xml file found in the conf folder to activate directory listing. It is beneficial for system testing and can assist in resolving a 403 Forbidden error.


    Next, locate and alter the following lines, changing the listing value from false to true:


    Servlet
  • You have to add an auto-reload feature by editing the context.xml file. It can be useful for developers working with the Tomcat server, as it eliminates the need to restart the server after every manual change.

Open the file and spot the following line. Change the value from false to true in each example:


Context
  • Once you implement the changes, you can start the server. Launch the Command Prompt by pressing Win+R.

  • You have to locate the bin directory of the Tomcat server installations on your system. Next, run the “> startup” command to start the server.


    Tomcat Startup
  • Chances are your Windows Defender firewall can raise a security alert, but we recommend setting up a firewall exception for Tomcat by selecting Allow in the alert window:


    Windows Security
  • Once the approval is done, you’ll see a new window for the Tomcat console. It is an important element of working with the Tomcat server, as Java errors and servlets and system.out.println() messages to this location.


    Tomcat Installation cmd
  • Open your preferred web browser to establish an HTTP client connection with the server. Go to http://localhost:8080 to access the Tomcat welcome page.


    Seeing this page confirms that Apache Tomcat is functioning correctly on your system.

You can click on the Developer Quick Start links to begin using and configuring the server which will also offer more insights into server utilization.


Tomcat localhost

To stop the Tomcat server, use the Ctrl+C keyboard shortcut in the Tomcat console window.


Check the Status of the Apache Tomcat Service


When Apache Tomcat is installed using the Windows Service Installer, it's set up as a Windows service that starts automatically when your computer boots up. To verify that Tomcat is running as a Windows service, you can follow these steps:


  • Check the status of the Apache Tomcat service.


    Services
  • The Apache Tomcat service is located in the Services app. The service’s current state is visible in the Status column. You can start or stop the service using the toolbar buttons or by simply selecting Stop or Restart on the left side of the service list.


    Services List
  • You can edit the service setup by clicking on the Tomcat service and choosing Properties.

  • Locate the "Startup type" dropdown menu and choose one of the following options to modify the Tomcat service's startup behavior.

  • Automatic (Delayed Start): The service starts a short while after the system boots up. This delayed start can enhance the overall startup performance of your system and provide additional security benefits.

  • Automatic: The service starts automatically when your system boots up.

  • Manual: The service will start only when you manually initiate it or if it's required by Windows or another service.

  • Disabled: Prevents the Tomcat service from starting, both manually by users and automatically by the system or other services.

Click "OK" to apply the changes you've made.



Takeaway

Apache Tomcat on Windows serves as a robust platform for hosting Java-based web applications. Now that you know how to set up Apache Tomcat on Windows, you can convert information into agile action.


The procedure includes setting the JAVA_HOME environment variable, downloading and unpacking Tomcat files, installing the JDK, and defining users in tomcat-users.xml.


Then initiate the server with startup.bat, access the Tomcat Manager via a browser, and transfer applications to the web apps folder for deployment.


You must check the Apache Tomcat documentation frequently for updates or if you get stuck somewhere. You can also get in touch with experts who can assist you with the complications in the process.

    Facebook   Linkedin

Posted By

   
Admin
15-March-2024

"A dedicated content writer, with a strong emotional intelligence."


Try Our VPS


  •  
  •  
Server Type DataCenter Location
Details: 

Our Prestigious Clients


Oxtrys Clients
Available VPS Datacenter Locations


Card image
Germany

Germany (Europe) Serving the EU countries from our German datacenter gives great benefits of minimum latency and cost-effective solutions.




Card image
USA

USA (United States of America) (Middle – St. Louis (Missouri), East – New York, West - Seattle (Washington DC)) America & Latin America can take advantage of our fast USA datacenter to deploy their applications and websites.

Card image
United Kingdom

Portsmouth, England (United Kingdom) It serves all United Kingdom customers with great satisfaction, very robust infrastructure to handle the high-end traffic.




Card image
Singapore & India

Singapore (Asia) Serving the Asia continent with our Singapore give us immense pleasure to see our customers succeed in their cloud business which runs on Oxtrys platforms.




Card image
Australia

This datacenter is built for Australia and Oceanic country users who wish to have their servers close to their business location so they can avoid the latency and enjoy our world class datacenter services.




Card image
Japan

Japan datacenter is built on high technology which gives its users with fast connectivity and low latency. The hardware used in SSD drives with top notch Xeon processor, must choice if you reside in Japan or close to it.




Available Dedicated Server Datacenter Locations




Our Datacenters Location


Oxtrys DataCenters Map
Recognition