Tomcatのダウンロードとインストール方法を備忘録として残しておきます。
※本手順ではJDK11を使用しますので、予めインストールしておいてください。
Tomcatのダウンロード
TomcatはApacheのサイトからダウンロード可能です。
本手順では、Tomcat 9.0.34をダウンロードします。
![](http://itbibo.starfree.jp/wp-content/themes/cocoon-child-master/images/appserver/tomcat/install/TomcatInstall00.png)
本手順では、Windows環境にインストールするため、「32-bit/64-bit Windows Service Installer」をクリックしダウンロードします。
![](http://itbibo.starfree.jp/wp-content/themes/cocoon-child-master/images/appserver/tomcat/install/TomcatInstall01.png)
「apache-tomcat-9.0.34.exe」を任意の場所に保存します。
Tomcatのインストール
ダウンロードした「apache-tomcat-9.0.34.exe」をダブルクリックします。
![](http://itbibo.starfree.jp/wp-content/themes/cocoon-child-master/images/appserver/tomcat/install/TomcatInstall11.png)
画面が表示されたら「Next」ボタンを押します。
![](http://itbibo.starfree.jp/wp-content/themes/cocoon-child-master/images/appserver/tomcat/install/TomcatInstall12.png)
内容を確認し「I Agree」ボタンを押します。
![](http://itbibo.starfree.jp/wp-content/themes/cocoon-child-master/images/appserver/tomcat/install/TomcatInstall13.png)
本手順では、デフォルト状態で「Next」ボタンを押します。
![](http://itbibo.starfree.jp/wp-content/themes/cocoon-child-master/images/appserver/tomcat/install/TomcatInstall14.png)
本手順では、以下の項目を入力してから「Next」ボタンを押します。
Server Shutdown Port : 8004
HTTP/1.1 Connector Port : 8082
Tomcat Administrator Login User Name : <任意のユーザー名>
Tomcat Administrator Login User Password : <任意のパスワード>
※8080ポートは何かと他でも使用しそうなので、使わなそうなポートに変更しています。
※Tomcatの管理者画面にアクセスする手順にしていますので、ユーザー名/パスワードは設定しておいてください。追加し忘れた場合は、インストールディレクトリ配下の「conf/tomcat-users.xml」に手動でユーザー名/パスワードを加えてください。
![](http://itbibo.starfree.jp/wp-content/themes/cocoon-child-master/images/appserver/tomcat/install/TomcatInstall15.png)
JVMがインストールされているフォルダを指定し、「Next」ボタンを押します。
※Java8ではJREのフォルダです。
![](http://itbibo.starfree.jp/wp-content/themes/cocoon-child-master/images/appserver/tomcat/install/TomcatInstall16.png)
本手順では、Tomcatのインストール先フォルダを「C:\app\Tomcat」に変更しています。(パスを短くしたかったので)
変更の必要がなければそのまま「Install」ボタンを押します。
![](http://itbibo.starfree.jp/wp-content/themes/cocoon-child-master/images/appserver/tomcat/install/TomcatInstall17.png)
インストールが終了すると次の画面が表示されます。Readmeは見なくてよければチェックを外します。「Finish」ボタンを押して終了です。
![](http://itbibo.starfree.jp/wp-content/themes/cocoon-child-master/images/appserver/tomcat/install/TomcatInstall18.png)
「Run Apache Tomcat」にチェックを入れている場合、Tomcat起動開始します。
![](http://itbibo.starfree.jp/wp-content/themes/cocoon-child-master/images/appserver/tomcat/install/TomcatInstall19.png)
次は、Tomcat起動している状態で、管理画面を見てみます。
Tomcatの管理者画面
Tomcatの管理者画面にアクセスします。
http://localhost:8082/manager/html
※ポート番号は設定した番号に合わせてください。
![](http://itbibo.starfree.jp/wp-content/themes/cocoon-child-master/images/appserver/tomcat/install/TomcatInstall20-1.png)
ユーザー名 : <Tomcat Administrator Login User Name で指定した任意のユーザー名>
パスワード : <Tomcat Administrator Login User Password で指定した任意のパスワード>
でログインします。
![](http://itbibo.starfree.jp/wp-content/themes/cocoon-child-master/images/appserver/tomcat/install/TomcatInstall20-2.png)
デプロイ
デプロイする場合、作成したwarを以下のようにアップロードします。
![](http://itbibo.starfree.jp/wp-content/themes/cocoon-child-master/images/appserver/tomcat/install/TomcatInstall21.png)
![](http://itbibo.starfree.jp/wp-content/themes/cocoon-child-master/images/appserver/tomcat/install/TomcatInstall22.png)
![](http://itbibo.starfree.jp/wp-content/themes/cocoon-child-master/images/appserver/tomcat/install/TomcatInstall23.png)
![](http://itbibo.starfree.jp/wp-content/themes/cocoon-child-master/images/appserver/tomcat/install/TomcatInstall24.png)
![](http://itbibo.starfree.jp/wp-content/themes/cocoon-child-master/images/appserver/tomcat/install/TomcatInstall25.png)
以上となります。お疲れさまでした。