[日本語]
This is a note that summarizes what I learned from workplace and self-study.
-
Apache Tomcat
Prof. Wiki: Apache Tomcat(also referred to as Tomcat Server) implements several Java EE specifications including Java Servlet, JavaServer Pages(JSP), Java EL, and WebSocket, and provides a “pure Java” HTTP web server environment in which Java code can run.
-
Download
1) Access the following URL.
※The latest version may exist, but the procedure is similar.
2) Click “32-bit/64-bit Windows Service Installer” to download.

-
Installation
1) Double-click the downloaded “32-bit/64-bit Windows Service Installer”.
2) Click “Next>”.

3) Press “I Agree”.

4) Select the following contents.
– Tomcat
– Start Menu Items
– Documentation
– Manager
– Examples
5) Click “Next>”.

6) Click “Next>”.

7) Enter the following information and click “Next>”.
C:\Java\jdk-12.0.2
※Enter the Java installation path. JRE path is displayed as default, but specify JDK path.

8) Enter the following information and click “Install”.
C:\Tomcat9

9) Installation starts.

10) When installation is complete, uncheck the following and click “Finish”.
– Run Apache Tomcat
– Show Readme

11) Set environment variables with the following contents.
Enter the following as new:
Variable name:
CATALINA_HOME
Variable value:
C:\Tomcat9
※Enter the Tomcat installation path.
Add the following to “Path”.
C:\Tomcat9\bin
※ Add the path of Tomcat’s bin folder.
Click HERE for how to set environment variables.
12) Execute the following command at the command prompt. If the version is displayed, it means installation was successfully completed.
cd C:\Tomcat9\bin
※ Move to the Tomcat bin folder.
version.bat

-
Start Apache Tomcat
1) Run “C:\Tomcat9\bin\Tomcat9w.exe” as an administrator.

2) Press “Start”.

3) Launch the browser and access the following URL. If the following page is displayed, the launch is successful.

4) Press “Stop” to stop.

-
How to change character code
※ Implement if necessary.
1) If characters are garbled when executing the following files, modify “C:\tomcat9\conf\logging.properties”. (About line 51)
Following file:
“C:\Tomcat9\bin\start-up.bat”
“C:\Tomcat9\bin\shutdown.bat”
Files to edit:
“C:\tomcat9\conf\logging.properties”
Edited content: (about line 51)
java.util.logging.ConsoleHandler.encoding = UTF-8
↓
java.util.logging.ConsoleHandler.encoding = SJIS
Before changing:

After changing:

-
If you want to access http://localhost:8080/manager/html
※ Implement if necessary.
Example:
- user name: “admin”
- password: “pass”
1) Add the following to “C:\tomcat9\conf\tomcat-users.xml”. (About 18th line)
<role rolename="manager-gui"/> <user username="admin" password="pass" roles="manager-gui"/>
Example:
<tomcat-users xmlns="http://tomcat.apache.org/xml"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://tomcat.apache.org/xml tomcat-users.xsd"
version="1.0">
↓
<tomcat-users xmlns="http://tomcat.apache.org/xml"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://tomcat.apache.org/xml tomcat-users.xsd"
version="1.0">
<role rolename="manager-gui"/>
<user username="admin" password="pass" roles="manager-gui"/>
2) Modify “C:\tomcat9\conf\tomcat-users.xml” as follows. (About line 40)
※ Change “must-be-changed” to “pass”.
Example:
<role rolename="tomcat"/> <role rolename="role1"/> <user username="tomcat" password="<must-be-changed>" roles="tomcat"/> <user username="both" password="<must-be-changed>" roles="tomcat,role1"/> <user username="role1" password="<must-be-changed>" roles="role1"/>
↓
<role rolename="tomcat"/> <role rolename="role1"/> <user username="tomcat" password="pass" roles="tomcat"/> <user username="both" password="pass" roles="tomcat,role1"/> <user username="role1" password="pass" roles="role1"/>
-
Development Environment Setup(Java Web App.)
– Work environment:
Windows 10 Home(64bit)
– Settings Contents for each step:
- Java installation
- Apache Tomcat installation
- PostgreSQL pgAdmin 4 installation
- Eclipse installation
- First launch / setting of Eclipse(Java Web App.)
– Common setting method:
20190726
9 thoughts on “Apache Tomcat Installation”