事後報告みたいな内容なのですが、実は現サーバでは tomcat10 をインストールして使っていたのですが、諸事情あって tomcat9 に戻しました。
Ubuntu Pro 22.04 の apt リポジトリからインストール出来る tomcat は tomcat9 なので、入れて動かしていた tomcat10 は apache のサイトから tar.gz をダウンロードして、手動インストールしていたものでした。せっかくだし、最新のが良いかな、と。
色々と格闘していたのですが、うまくいかず、結局はこの記事:
を見つけて「JavaEE・JakartaEE問題」が原因であることが分かりました。
本記事には助かりました。感謝です。
あと、「JavaEE・JakartaEE問題」については、これ:
が参考になります。
これまで tomcat をダウングレードしたことがないので問題なく tomcat9 に移行できるか心配ですが、手動インストールなのでそれらをリワインドして、apt で tomcat9 をインストールしました。
$ sudo apt install tomcat9
パッケージリストを読み込んでいます... 完了
依存関係ツリーを作成しています... 完了
状態情報を読み取っています... 完了
以下の追加パッケージがインストールされます:
libeclipse-jdt-core-java libtcnative-1 libtomcat9-java tomcat9-common
提案パッケージ:
tomcat9-admin tomcat9-docs tomcat9-examples tomcat9-user
以下のパッケージが新たにインストールされます:
libeclipse-jdt-core-java libtcnative-1 libtomcat9-java tomcat9 tomcat9-common
アップグレード: 0 個、新規インストール: 5 個、削除: 0 個、保留: 1 個。
12.5 MB のアーカイブを取得する必要があります。
この操作後に追加で 15.8 MB のディスク容量が消費されます。
続行しますか? [Y/n]
取得:1 http://jp.archive.ubuntu.com/ubuntu jammy/universe amd64 libeclipse-jdt-core-java all 3.27.0+eclipse4.21-1 [6,240 kB]
取得:2 http://jp.archive.ubuntu.com/ubuntu jammy-updates/universe amd64 libtomcat9-java all 9.0.58-1ubuntu0.1 [6,047 kB]
取得:3 http://jp.archive.ubuntu.com/ubuntu jammy-updates/universe amd64 tomcat9-common all 9.0.58-1ubuntu0.1 [60.9 kB]
取得:4 http://jp.archive.ubuntu.com/ubuntu jammy-updates/universe amd64 tomcat9 all 9.0.58-1ubuntu0.1 [37.0 kB]
取得:5 http://jp.archive.ubuntu.com/ubuntu jammy/universe amd64 libtcnative-1 amd64 1.2.31-1build1 [95.1 kB]
12.5 MB を 4秒 で取得しました (3,444 kB/s)
以前に未選択のパッケージ libeclipse-jdt-core-java を選択しています。
(データベースを読み込んでいます ... 現在 415976 個のファイルとディレクトリがインストールされています。)
.../libeclipse-jdt-core-java_3.27.0+eclipse4.21-1_all.deb を展開する準備をしています ...
libeclipse-jdt-core-java (3.27.0+eclipse4.21-1) を展開しています...
以前に未選択のパッケージ libtomcat9-java を選択しています。
.../libtomcat9-java_9.0.58-1ubuntu0.1_all.deb を展開する準備をしています ...
libtomcat9-java (9.0.58-1ubuntu0.1) を展開しています...
以前に未選択のパッケージ tomcat9-common を選択しています。
.../tomcat9-common_9.0.58-1ubuntu0.1_all.deb を展開する準備をしています ...
tomcat9-common (9.0.58-1ubuntu0.1) を展開しています...
以前に未選択のパッケージ tomcat9 を選択しています。
.../tomcat9_9.0.58-1ubuntu0.1_all.deb を展開する準備をしています ...
tomcat9 (9.0.58-1ubuntu0.1) を展開しています...
以前に未選択のパッケージ libtcnative-1:amd64 を選択しています。
.../libtcnative-1_1.2.31-1build1_amd64.deb を展開する準備をしています ...
libtcnative-1:amd64 (1.2.31-1build1) を展開しています...
libtcnative-1:amd64 (1.2.31-1build1) を設定しています ...
libeclipse-jdt-core-java (3.27.0+eclipse4.21-1) を設定しています ...
libtomcat9-java (9.0.58-1ubuntu0.1) を設定しています ...
tomcat9-common (9.0.58-1ubuntu0.1) を設定しています ...
tomcat9 (9.0.58-1ubuntu0.1) を設定しています ...
Creating group tomcat with gid 998.
Creating user tomcat (Apache Tomcat) with uid 998 and gid 998.
Creating config file /etc/tomcat9/tomcat-users.xml with new version
Creating config file /etc/tomcat9/web.xml with new version
Creating config file /etc/tomcat9/server.xml with new version
Creating config file /etc/tomcat9/logging.properties with new version
Creating config file /etc/tomcat9/context.xml with new version
Creating config file /etc/tomcat9/catalina.properties with new version
Creating config file /etc/tomcat9/jaspic-providers.xml with new version
Creating config file /etc/logrotate.d/tomcat9 with new version
Creating config file /etc/default/tomcat9 with new version
Created symlink /etc/systemd/system/multi-user.target.wants/tomcat9.service → /lib/systemd/system/tomcat9.service.
rsyslog (8.2112.0-2ubuntu2.2) のトリガを処理しています ...
libc-bin (2.35-0ubuntu3.1) のトリガを処理しています ...
Scanning processes...
Scanning processor microcode...
Scanning linux images...
Running kernel seems to be up-to-date.
The processor microcode seems to be up-to-date.
No services need to be restarted.
No containers need to be restarted.
No user sessions are running outdated binaries.
No VM guests are running outdated hypervisor (qemu) binaries on this host.
その後、マシンを再起動して、ポート 8080 に接続すると、以下が表示されました。
まぁ、とりあえずは起動したっぽいですかね。
サーバ上でのステータスもこんな感じです。
$ sudo systemctl status tomcat9
● tomcat9.service - Apache Tomcat 9 Web Application Server
Loaded: loaded (/lib/systemd/system/tomcat9.service; enabled; vendor preset: enabled)
Active: active (running) since Thu 2023-04-20 23:35:15 JST; 26min ago
Docs: https://tomcat.apache.org/tomcat-9.0-doc/index.html
Process: 3155 ExecStartPre=/usr/libexec/tomcat9/tomcat-update-policy.sh (code=exited, status=0/SUCCESS)
Main PID: 3159 (java)
Tasks: 34 (limit: 9185)
Memory: 198.3M
CPU: 15.210s
CGroup: /system.slice/tomcat9.service
└─3159 /usr/lib/jvm/default-java/bin/java -Djava.util.logging.config.file=/var/lib/tomcat9/conf/l>
4月 20 23:35:16 trserver tomcat9[3159]: OpenSSLは [OpenSSL 3.0.2 15 Mar 2022] を正常に初期化しました
4月 20 23:35:18 trserver tomcat9[3159]: プロトコルハンドラ ["http-nio-8080"] を初期化します。
4月 20 23:35:18 trserver tomcat9[3159]: サーバーの初期化 [2601]ms
4月 20 23:35:18 trserver tomcat9[3159]: サービス [Catalina] を起動します
4月 20 23:35:18 trserver tomcat9[3159]: サーブレットエンジンの起動:[Apache Tomcat/9.0.58 (Ubuntu)]
4月 20 23:35:18 trserver tomcat9[3159]: Webアプリケーションディレクトリ [/var/lib/tomcat9/webapps/ROOT] を配 >
4月 20 23:35:21 trserver tomcat9[3159]: 少なくとも1つのJARが、まだTLDを含んでいないTLDについてスキャンされま >
4月 20 23:35:21 trserver tomcat9[3159]: ディレクトリ [/var/lib/tomcat9/webapps/ROOT] の Web アプリケーション >
4月 20 23:35:21 trserver tomcat9[3159]: プロトコルハンドラー ["http-nio-8080"] を開始しました。
4月 20 23:35:21 trserver tomcat9[3159]: サーバーの起動 [2726]ms
ではこれから、tomcat9の諸々の設定と、GitBucketのインストールを進めていこうかと思います。
コメント
コメントを投稿