Windows 10 Pro に tomcat をインストールしてみる

Windows 10 Pro に tomcat をインストールしてみる

以下のサイトから

Tomcat 8 Software Downloads

apache-tomcat-8.5.28-windows-x64.zip をDLする

解凍して 適当なフォルダに配置する(tomcat85 にリネームして使用)

以下RUNNING.txt より

ユーザー環境変数に CATALINA_HOME に /path/to/tomcat85 を登録する

ユーザー環境変数JAVA_HOME に /path/to/jdk を登録する(自分はOpenJDK9を使用)

Windows 10 Pro + OpenJDKを試してみる

/path/to/tomcat85\conf\tomcat-users.xml を修正する

22行目より

NOTE: By default, no user is included in the "manager-gui" role required

to operate the "/manager/html" web application. If you wish to use this app,

you must define such a user - the username and password are arbitrary. It is

strongly recommended that you do NOT use one of the users in the commented out

section below since they are intended for use with the examples web

application.

なので、以下を追加する

<role rolename="manager-gui"/>

<user username="admin" password="admin" roles="manager-gui"/>

/path/to/tomcat85\bin\startup.bat で起動する

/path/to/tomcat85\bin\shutdown.bat で停止する

8080ポートがすでに使用されている場合

重大 [main] org.apache.catalina.core.StandardService.initInternal Failed to initialize connector [Connector[HTTP/1.1-8080?

のエラーログが発生する

どのアプリケーションが使用しているかを確認するには以下を参考に

Windowsでどのポートが何のアプリケーションで使用されているか確認する

> netstat -nao | grep 8080 

TCP 0.0.0.0:8080 0.0.0.0:0 LISTENING 4928

TCP [::]:8080 [::]:0 LISTENING 4928

タスクマネージャー詳細で 4928 を確認すると TNSLSNR.EXEが該当する

原因はこれ Windows10に OracleXE11R2 をインスールしてみる

grepNative Win32 ports of some GNU utilitiesをDL

解消するために

/path/to/tomcat85\conf\server.xml を修正する

75行目 port="8080" protocol="HTTP/1.1"

修正後 port="8082" protocol="HTTP/1.1" #空いているポートに修正