Installing Apache Tomcat 9 on Windows 2010

(by Brian Wilson and Mike Farace, 8/17/2019)

Click here for older version of this doc for Tomcat 5.5

 

Explanation:

For some of our purposes, we have decided to standardize on Tomcat as our web server.  The modern one is Tomcat 9 (at the time of this writing).

Step #1: Download and install Google Chrome

https://www.google.com/chrome/

 

Step #2: Download tomcat 9, 64 bit

https://tomcat.apache.org/download-90.cgi
Unzip to to your desired location (ex. C:\apache-tomcat-9.0.22)
 

Step #3: Download and install Java JRE 64 bit using Chrome

*Edge will download the 32 bit version of Java and nothing will work correctly*
https://www.java.com/en/download/
 

Step #4: Set JRE_HOME and CATALINA_HOME variables

Step #5: Change Tomcat port from 8080 to 80 (if desired)

Go to CATALINA_HOME\conf and edit server.xml
Look for Connector port="8080" protocol="HTTP/1.1" and change it to 80.
Do not change the Connector Port line that is under the section called <Connector executor="tomcatThreadPool".
 

Step #6: Allow Tomcat through Windows Firewall

In search bar type "firewall" and then click on Windows Defender Firewall
In the left Nav bar, click on "Allow an app through Windows Defender Firewall"
Click "Change Setting" at the top, then click "Allow another app" at the bottom
Click browse, and then go to your CATALINA_HOME\bin directory
Click on tomcat9, then Open, and then Add.
Click OK to exit Windows Firewall and now Tomcat can be accessed from other machines.
 

Step #7: Install Tomcat as a service

In search bar type CMD, then right click and choose "run as administrator"
Go to CATALINA_HOME\bin (ex. cd c:\apache-tomcat-9.0.22\bin)
Then type "service.bat install" which will install a service called "Apache Tomcat 9.0 Tomcat9"
Then type "services.msc" to open the services control panel
Right click on "Apache Tomcat 9.0 Tomcat9", and choose properties.
Change startup type to Automatic
Click on the Recovery tab, and change all 3 Service Failure actions to be "Restart Service"
Click OK to apply and exit
Close services control page
 

Step #8: Set Java memory parameters

Go to CATALINA_HOME\bin
Double click on tomcat9w
Go to the JAVA tab, and the bottom set the memory usage settings.
Then on the General tab, click "Start"
For Whistler2 I did Minimum of 2048 MB and Maximum of 8192 MB (since the system as 16 GB and this is its primary function). This is probably overkill but the resources are there so...

Copy your content to CATALINA_HOME\webapps\"your directory"
Ex. C:\apache-tomcat-9.0.22\webapps\bowl
Test access by going to http://localhost/bowl
 

Step #9: Set Static HTML folder to serv up

In most cases you just want Tomcat 9 to serve up a bunch of static html pages without any Java or JSP. Update to the conf\server.xml file as follows:

(This assumes C:\bowl\index.html is the root web page you want to serv up.)

<Host name="localhost" appBase="webapps"
           unpackWARs="true" autoDeploy="false" deployOnStartup="false">
           <Context displayName="bowl" docBase="c:/bowl" path="" reloadable="true"></Context>
 

 

 

Click Here to return to Ski-Epic Home, and Click Here to return to Random Stuff in Brian's Life