Wiki source code of Installation de Tomcat 9
Last modified by Aurelie Bertrand on 2026/03/19 11:40
Show last authors
| author | version | line-number | content |
|---|---|---|---|
| 1 | This guide provides installation for Tomcat 9 on Windows. | ||
| 2 | |||
| 3 | ---- | ||
| 4 | |||
| 5 | {{ddtoc/}} | ||
| 6 | |||
| 7 | ---- | ||
| 8 | |||
| 9 | = Installing Tomcat 9{{id name="Tomcat_windows"/}} = | ||
| 10 | |||
| 11 | ((( | ||
| 12 | 1. Download TomCat 9 from [[https:~~/~~/tomcat.apache.org/download-90.cgi>>url:https://tomcat.apache.org/download-90.cgi]] (Binary Distributions - > Core -> 32-bit/64-bit Windows Service Installer). | ||
| 13 | 1. Launch apache-tomcat-9.X.XX.exe. | ||
| 14 | 1. Accept the license agreement. | ||
| 15 | 1. In the **Components** list, select **Tomcat** (**Service Startup** & **Native**) and **Start Menu Item**. | ||
| 16 | (% style="border:none; color:#000000; display:inline-block; font-family:Arial; font-size:11pt; font-style:normal; font-variant:normal; font-weight:400; height:243px; overflow:hidden; text-decoration:none; white-space:pre-wrap; width:312px" %)[[image:Tomcat1||data-xwiki-image-style-alignment="start"]] | ||
| 17 | ))) | ||
| 18 | |||
| 19 | (% start="5" %) | ||
| 20 | 1. Leave the configuration settings at default. | ||
| 21 | |||
| 22 | (% style="line-height: 1.38; margin-left: 48px;" %) | ||
| 23 | (% style="border:none; color:#000000; display:inline-block; font-family:Arial; font-size:11pt; font-style:normal; font-variant:normal; font-weight:400; height:215px; overflow:hidden; text-decoration:none; white-space:pre-wrap; width:315px" %)[[image:Tomcat2.png]] | ||
| 24 | |||
| 25 | (% start="6" %) | ||
| 26 | 1. Enter the path to the installation of the openjdk installed in step 1. | ||
| 27 | |||
| 28 | (% style="line-height: 1.38; margin-left: 48px;" %) | ||
| 29 | (% style="border:none; color:#000000; display:inline-block; font-family:Arial; font-size:11pt; font-style:normal; font-variant:normal; font-weight:400; height:226px; overflow:hidden; text-decoration:none; white-space:pre-wrap; width:350px" %)[[image:Tomcat3.png]] | ||
| 30 | |||
| 31 | (% start="7" %) | ||
| 32 | 1. Set the TomCat 9 installation directory. | ||
| 33 | |||
| 34 | (% style="line-height: 1.38; margin-left: 48px;" %) | ||
| 35 | (% style="border:none; color:#000000; display:inline-block; font-family:Arial; font-size:11pt; font-style:normal; font-variant:normal; font-weight:400; height:265px; overflow:hidden; text-decoration:none; white-space:pre-wrap; width:352px" %)[[image:Tomcat4.png]] | ||
| 36 | |||
| 37 | (% start="8" %) | ||
| 38 | 1. Click **Install **to start TomCat 9 installation. | ||
| 39 | 1. Open page [[http:~~/~~/localhost:8080>>url:http://localhost:8080]] to check TomCat is working properly. | ||
| 40 | 1. Open the TomCat 9 installation directory then the bin directory and launch tomcat9w.exe. | ||
| 41 | 1. ((( | ||
| 42 | Modify the parameters contained in the **Java **tab : | ||
| 43 | [[image:Tomcat5.png]]* | ||
| 44 | |||
| 45 | ((( | ||
| 46 | * Adapt the paths to future digdash directories: | ||
| 47 | Ddigdash.properties.path=E:\digdash\digdash.properties | ||
| 48 | |||
| 49 | ))) | ||
| 50 | |||
| 51 | * To ensure that special characters are taken into account, add the parameter **-Dfile.encoding=UTF-8** to the end of the JAVA_OPTS variable as below: | ||
| 52 | [[image:Dfile.png]] | ||
| 53 | |||
| 54 | * Add the parameters **~-~-add-opens=java.base/java.nio=org.apache.arrow.memory.core,ALL-UNNAMED ~-~-add-opens=java.base/sun.security.ssl=ALL-UNNAMED ~-~-add-opens=java.base/sun.security.util=ALL-UNNAMED** in Java 9 options. | ||
| 55 | |||
| 56 | |||
| 57 | ))) | ||
| 58 | |||
| 59 | (% class="box warningmessage" style="line-height: 1.38;" %) | ||
| 60 | ((( | ||
| 61 | ❗**Important:** Do not forget to increase the tomcat memory | ||
| 62 | Enter the same value in the “Initial memory” and “Maximum memory pool” fields in MB (example: “3000”) | ||
| 63 | ))) | ||
| 64 | |||
| 65 | = Editing the server.xml file = | ||
| 66 | |||
| 67 | 1. Open the server.xml file located in the \Apache Software Foundation\Tomcat 9.0\conf directory. | ||
| 68 | |||
| 69 | {{code language="xml"}} | ||
| 70 | <Connector port="8080" protocol="HTTP/1.1" | ||
| 71 | connectionTimeout="20000" | ||
| 72 | maxConnections="30000" | ||
| 73 | maxCParametersCount="100000" | ||
| 74 | maxThreads="10000" maxPostSize="62914560" | ||
| 75 | redirectPort="8443" compression="on" /> | ||
| 76 | {{/code}} | ||
| 77 | |||
| 78 | (% start="2" %) | ||
| 79 | 1. Change the path of the webapps to deploy. | ||
| 80 | |||
| 81 | {{code language="xml"}} | ||
| 82 | <Host name="localhost" appBase="E:/digdash/webapps/default" | ||
| 83 | unpackWARs="true" autoDeploy="true"> | ||
| 84 | <Alias>digdash.client.com</Alias> | ||
| 85 | {{/code}} | ||
| 86 | |||
| 87 | ((( | ||
| 88 | |||
| 89 | ))) | ||
| 90 | |||
| 91 | (% start="3" %) | ||
| 92 | 1. Add the log valve and then, the securing valve. | ||
| 93 | |||
| 94 | {{code language="xml"}} | ||
| 95 | <Valve className="org.apache.catalina.valves.ErrorReportValve" showReport="false" showServerInfo="false" /> | ||
| 96 | |||
| 97 | |||
| 98 | <Valve className="org.apache.catalina.valves.RemoteIpValve" | ||
| 99 | internalProxies="127\.0\.[0-1]\.1" | ||
| 100 | remoteIpHeader="X-Forwarded-For" | ||
| 101 | requestAttributesEnabled="true" | ||
| 102 | protocolHeader="X-Forwarded-Proto" | ||
| 103 | protocolHeaderHttpsValue="https"/> | ||
| 104 | {{/code}} | ||
| 105 | |||
| 106 | ((( | ||
| 107 | = Editing the context.xml file = | ||
| 108 | ))) | ||
| 109 | |||
| 110 | 1. Open the context.xml file located in the \Apache Software Foundation\Tomcat 9.0\conf directory. | ||
| 111 | 1. Add the following XML tag in the Context section: | ||
| 112 | |||
| 113 | {{code language="xml"}} | ||
| 114 | <Resources cachingAllowed="true" cacheMaxSize="500000"/> | ||
| 115 | {{/code}} | ||
| 116 | |||
| 117 | ((( | ||
| 118 | |||
| 119 | ))) |