最近仕事でAmazonLinux2からの移行先としてAmazonLinux2022(以降AL2022)について調査していたので自分用にも改めてまとめました。
※2023年3月現在、AL2022はまだプレビュー版のため正式にリリースされたときには手順が変わるところがあるかもしれない
今回はJava+Tomcatで動作する以下のようなWebアプリケーションの動作環境を構築します。
- webサーバーはApache2.4(httpd)
- MySQL(8.0)サーバーもローカルに構築
また、AL2022(Arm)のプレビュー版を使った場合の手順についても検証しました。
→ AmazonLinux2022(Arm)プレビュー版でJava11→17+Tomcat9+MySQLの動作環境を構築する
インスタンスを起動
以下のような設定でインスタンスを起動
名前 | AL2022_x86 |
---|---|
AMI | ami-0366776cdec913241 |
AMI(名称) | al2022-ami-ecs-hvm-2022.0.20220630-x86_64-ebs |
インスタンスタイプ | t3.medium |
セキュリティグループ | 22(SSH)と80(HTTP)について自分のIPからの接続を許可するようなルールを設定 |
ストレージ | 30GB、gp2(初期値のまま) |
↑マーケットプレースAMIで「Amazon Linux 2022」と検索しx86_64の記載のあるAMIを選択
インスタンスの初期状態確認
__| __| __| _| ( \__ \ Amazon Linux 2022 (ECS Optimized) ____|\___|____/ Preview For documentation, visit http://aws.amazon.com/documentation/ecs Last login: Sun Mar 12 03:13:28 2023 from [自分のip]
↑SSH接続するとこんな感じの表示が出る
$ cat /etc/os-release NAME="Amazon Linux" VERSION="2022" ID="amzn" ID_LIKE="fedora" VERSION_ID="2022" PLATFORM_ID="platform:al2022" PRETTY_NAME="Amazon Linux 2022" ANSI_COLOR="0;33" CPE_NAME="cpe:2.3:o:amazon:amazon_linux:2022" HOME_URL="https://amazonlinux.com/" $ cat /etc/system-release Amazon Linux release 2022 (Amazon Linux) $ uname -a Linux ip-172-31-18-165.ap-northeast-1.compute.internal 5.15.43-20.123.amzn2022.x86_64 #1 SMP Thu May 26 17:03:30 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux $ id uid=1000(ec2-user) gid=1000(ec2-user) groups=1000(ec2-user),4(adm),10(wheel),190(systemd-journal),993(docker) context=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 $ date Sun Mar 12 03:30:28 AM UTC 2023 $ echo $LANG en_US.UTF-8 $ echo $PATH /home/ec2-user/.local/bin:/home/ec2-user/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin $ getenforce Enforcing $ ll /etc/yum.repos.d/ total 4 -rw-r--r--. 1 root root 968 May 27 2022 amazonlinux.repo
↑SELinuxが有効化(Enforcing)されていることを確認
インスタンスの初期設定(SELinux無効化)
# vi /etc/selinux/config # grubby --update-kernel ALL --args selinux=0 # reboot
# This file controls the state of SELinux on the system. # SELINUX= can take one of these three values: # enforcing - SELinux security policy is enforced. # permissive - SELinux prints warnings instead of enforcing. # disabled - No SELinux policy is loaded. # See also: # https://docs.fedoraproject.org/en-US/quick-docs/getting-started-with-selinux/#getting-started-with-selinux-selinux-states-and-modes # # NOTE: In earlier Fedora kernel builds, SELINUX=disabled would also # fully disable SELinux during boot. If you need a system with SELinux # fully disabled instead of SELinux running with no policy loaded, you # need to pass selinux=0 to the kernel command line. You can use grubby # to persistently set the bootloader to boot with selinux=0: # # grubby --update-kernel ALL --args selinux=0 # # To revert back to SELinux enabled: # # grubby --update-kernel ALL --remove-args selinux # -SELINUX=enforcing +SELINUX=disabled # SELINUXTYPE= can take one of these three values: # targeted - Targeted processes are protected, # minimum - Modification of targeted policy. Only selected processes are protected. # mls - Multi Level Security protection. SELINUXTYPE=targeted
# getenforce Disabled
↑再起動後SELinuxが無効化されてることを確認
インスタンスの初期設定(UTC→JST)
# date Sun Mar 12 03:42:53 AM UTC 2023 # ln -sf /usr/share/zoneinfo/Asia/Tokyo /etc/localtime # date Sun Mar 12 12:43:20 PM JST 2023
インスタンスの初期設定(パッケージ更新)
# dnf update Last metadata expiration check: 0:07:29 ago on Sun 12 Mar 2023 12:37:21 PM JST. Dependencies resolved. Nothing to do. Complete!
インスタンスを起動した時期によるかもしれないですが今回は特にアップデートすることはありませんでした。
パッケージマネージャはyumではなくdnfを使う(yumも使える)
Java11をインストール
# dnf search Corretto Last metadata expiration check: 0:09:41 ago on Sun 12 Mar 2023 12:37:21 PM JST. No matches found. # dnf search openjdk Last metadata expiration check: 0:09:56 ago on Sun 12 Mar 2023 12:37:21 PM JST. ======================================================================== Name & Summary Matched: openjdk ========================================================================= java-11-openjdk.x86_64 : OpenJDK 11 Runtime Environment java-11-openjdk-demo.x86_64 : OpenJDK 11 Demos java-11-openjdk-demo-fastdebug.x86_64 : OpenJDK 11 Demos optimised with full debugging on java-11-openjdk-demo-slowdebug.x86_64 : OpenJDK 11 Demos unoptimised with full debugging on java-11-openjdk-devel.x86_64 : OpenJDK 11 Development Environment java-11-openjdk-devel-fastdebug.x86_64 : OpenJDK 11 Development Environment optimised with full debugging on java-11-openjdk-devel-slowdebug.x86_64 : OpenJDK 11 Development Environment unoptimised with full debugging on java-11-openjdk-fastdebug.x86_64 : OpenJDK 11 Runtime Environment optimised with full debugging on java-11-openjdk-headless.x86_64 : OpenJDK 11 Headless Runtime Environment java-11-openjdk-headless-fastdebug.x86_64 : OpenJDK 11 Runtime Environment optimised with full debugging on java-11-openjdk-headless-slowdebug.x86_64 : OpenJDK 11 Runtime Environment unoptimised with full debugging on java-11-openjdk-javadoc.x86_64 : OpenJDK 11 API documentation java-11-openjdk-javadoc-zip.x86_64 : OpenJDK 11 API documentation compressed in a single archive java-11-openjdk-jmods.x86_64 : JMods for OpenJDK 11 java-11-openjdk-jmods-fastdebug.x86_64 : JMods for OpenJDK 11 optimised with full debugging on java-11-openjdk-jmods-slowdebug.x86_64 : JMods for OpenJDK 11 unoptimised with full debugging on java-11-openjdk-slowdebug.x86_64 : OpenJDK 11 Runtime Environment unoptimised with full debugging on java-11-openjdk-src.x86_64 : OpenJDK 11 Source Bundle java-11-openjdk-src-fastdebug.x86_64 : OpenJDK 11 Source Bundle for packages with debugging on and optimisation java-11-openjdk-src-slowdebug.x86_64 : OpenJDK 11 Source Bundle for packages with debugging on and no optimisation java-11-openjdk-static-libs.x86_64 : OpenJDK 11 libraries for static linking java-11-openjdk-static-libs-fastdebug.x86_64 : OpenJDK 11 libraries for static linking optimised with full debugging on java-11-openjdk-static-libs-slowdebug.x86_64 : OpenJDK 11 libraries for static linking unoptimised with full debugging on java-latest-openjdk.x86_64 : OpenJDK 17 Runtime Environment java-latest-openjdk-demo.x86_64 : OpenJDK 17 Demos java-latest-openjdk-demo-fastdebug.x86_64 : OpenJDK 17 Demos optimised with full debugging on java-latest-openjdk-demo-slowdebug.x86_64 : OpenJDK 17 Demos unoptimised with full debugging on java-latest-openjdk-devel.x86_64 : OpenJDK 17 Development Environment java-latest-openjdk-devel-fastdebug.x86_64 : OpenJDK 17 Development Environment optimised with full debugging on java-latest-openjdk-devel-slowdebug.x86_64 : OpenJDK 17 Development Environment unoptimised with full debugging on java-latest-openjdk-fastdebug.x86_64 : OpenJDK 17 Runtime Environment optimised with full debugging on java-latest-openjdk-headless.x86_64 : OpenJDK 17 Headless Runtime Environment java-latest-openjdk-headless-fastdebug.x86_64 : OpenJDK 17 Runtime Environment optimised with full debugging on java-latest-openjdk-headless-slowdebug.x86_64 : OpenJDK 17 Runtime Environment unoptimised with full debugging on java-latest-openjdk-javadoc.x86_64 : OpenJDK 17 API documentation java-latest-openjdk-javadoc-zip.x86_64 : OpenJDK 17 API documentation compressed in a single archive java-latest-openjdk-jmods.x86_64 : JMods for OpenJDK 17 java-latest-openjdk-jmods-fastdebug.x86_64 : JMods for OpenJDK 17 optimised with full debugging on java-latest-openjdk-jmods-slowdebug.x86_64 : JMods for OpenJDK 17 unoptimised with full debugging on java-latest-openjdk-slowdebug.x86_64 : OpenJDK 17 Runtime Environment unoptimised with full debugging on java-latest-openjdk-src.x86_64 : OpenJDK 17 Source Bundle java-latest-openjdk-src-fastdebug.x86_64 : OpenJDK 17 Source Bundle for packages with debugging on and optimisation java-latest-openjdk-src-slowdebug.x86_64 : OpenJDK 17 Source Bundle for packages with debugging on and no optimisation java-latest-openjdk-static-libs.x86_64 : OpenJDK 17 libraries for static linking java-latest-openjdk-static-libs-fastdebug.x86_64 : OpenJDK 17 libraries for static linking optimised with full debugging on java-latest-openjdk-static-libs-slowdebug.x86_64 : OpenJDK 17 libraries for static linking unoptimised with full debugging on
↑openjdk11と17がインストール可能なことを確認、Amazon Correttoは標準ではインストールできないことを確認
# dnf install java-11-openjdk-devel Last metadata expiration check: 0:11:31 ago on Sun 12 Mar 2023 12:37:21 PM JST. Dependencies resolved. ================================================================================================================================================================================== Package Architecture Version Repository Size ================================================================================================================================================================================== Installing: java-11-openjdk-devel x86_64 1:11.0.14.1.1-5.amzn2022 amazonlinux 3.3 M Installing dependencies: alsa-lib x86_64 1.2.5.1-2.amzn2022 amazonlinux 505 k avahi-libs x86_64 0.8-14.amzn2022.0.4 amazonlinux 68 k copy-jdk-configs noarch 4.0-1.amzn2022 amazonlinux 28 k crypto-policies-scripts noarch 20210213-1.git5c710c0.amzn2022 amazonlinux 67 k cups-libs x86_64 1:2.3.3op2-10.amzn2022 amazonlinux 270 k fontconfig x86_64 2.13.94-2.amzn2022 amazonlinux 275 k fonts-filesystem noarch 1:2.0.5-5.amzn2022 amazonlinux 10 k freetype x86_64 2.11.0-3.amzn2022 amazonlinux 411 k giflib x86_64 5.2.1-7.amzn2022 amazonlinux 50 k google-noto-fonts-common noarch 20201206-2.amzn2022 amazonlinux 16 k google-noto-sans-vf-fonts noarch 20201206-2.amzn2022 amazonlinux 493 k graphite2 x86_64 1.3.14-7.amzn2022 amazonlinux 99 k harfbuzz x86_64 2.9.1-1.amzn2022 amazonlinux 691 k java-11-openjdk x86_64 1:11.0.14.1.1-5.amzn2022 amazonlinux 255 k java-11-openjdk-headless x86_64 1:11.0.14.1.1-5.amzn2022 amazonlinux 38 M javapackages-filesystem noarch 5.3.0-15.amzn2022 amazonlinux 12 k langpacks-core-font-en noarch 3.0-21.amzn2022.0.1 amazonlinux 11 k lcms2 x86_64 2.12-1.amzn2022 amazonlinux 179 k libX11 x86_64 1.7.2-3.amzn2022 amazonlinux 657 k libX11-common noarch 1.7.2-3.amzn2022 amazonlinux 153 k libXau x86_64 1.0.9-6.amzn2022 amazonlinux 32 k libXcomposite x86_64 0.4.5-5.amzn2022 amazonlinux 25 k libXext x86_64 1.3.4-6.amzn2022 amazonlinux 42 k libXi x86_64 1.7.10-6.amzn2022 amazonlinux 41 k libXrender x86_64 0.9.10-14.amzn2022 amazonlinux 29 k libXtst x86_64 1.2.3-14.amzn2022 amazonlinux 22 k libfontenc x86_64 1.1.3-15.amzn2022 amazonlinux 32 k libjpeg-turbo x86_64 2.0.90-3.amzn2022 amazonlinux 188 k libpng x86_64 2:1.6.37-10.amzn2022 amazonlinux 129 k libxcb x86_64 1.13.1-7.amzn2022 amazonlinux 235 k lksctp-tools x86_64 1.0.18-9.amzn2022 amazonlinux 93 k lua x86_64 5.4.4-1.amzn2022 amazonlinux 190 k lua-posix x86_64 35.0-3.amzn2022 amazonlinux 133 k mkfontscale x86_64 1.2.1-2.amzn2022 amazonlinux 33 k nspr x86_64 4.32.0-2.amzn2022.0.1 amazonlinux 140 k nss x86_64 3.71.0-2.amzn2022.0.1 amazonlinux 700 k nss-softokn x86_64 3.71.0-2.amzn2022.0.1 amazonlinux 383 k nss-softokn-freebl x86_64 3.71.0-2.amzn2022.0.1 amazonlinux 329 k nss-sysinit x86_64 3.71.0-2.amzn2022.0.1 amazonlinux 21 k nss-util x86_64 3.71.0-2.amzn2022.0.1 amazonlinux 90 k ttmkfdir x86_64 3.0.9-63.amzn2022 amazonlinux 54 k tzdata-java noarch 2022a-1.amzn2022 amazonlinux 157 k xml-common noarch 0.6.3-56.amzn2022 amazonlinux 32 k xorg-x11-fonts-Type1 noarch 7.5-31.amzn2022 amazonlinux 504 k Transaction Summary ================================================================================================================================================================================== Install 45 Packages Total download size: 49 M Installed size: 198 M Is this ok [y/N]: y Downloading Packages: (1/45): libXext-1.3.4-6.amzn2022.x86_64.rpm 177 kB/s | 42 kB 00:00 (2/45): java-11-openjdk-11.0.14.1.1-5.amzn2022.x86_64.rpm 948 kB/s | 255 kB 00:00 (3/45): libXtst-1.2.3-14.amzn2022.x86_64.rpm 443 kB/s | 22 kB 00:00 (4/45): harfbuzz-2.9.1-1.amzn2022.x86_64.rpm 2.1 MB/s | 691 kB 00:00 (5/45): libjpeg-turbo-2.0.90-3.amzn2022.x86_64.rpm 2.8 MB/s | 188 kB 00:00 (6/45): mkfontscale-1.2.1-2.amzn2022.x86_64.rpm 576 kB/s | 33 kB 00:00 (7/45): libfontenc-1.1.3-15.amzn2022.x86_64.rpm 815 kB/s | 32 kB 00:00 (8/45): giflib-5.2.1-7.amzn2022.x86_64.rpm 1.3 MB/s | 50 kB 00:00 (9/45): nspr-4.32.0-2.amzn2022.0.1.x86_64.rpm 2.0 MB/s | 140 kB 00:00 (10/45): libXau-1.0.9-6.amzn2022.x86_64.rpm 980 kB/s | 32 kB 00:00 (11/45): lcms2-2.12-1.amzn2022.x86_64.rpm 2.1 MB/s | 179 kB 00:00 (12/45): cups-libs-2.3.3op2-10.amzn2022.x86_64.rpm 2.5 MB/s | 270 kB 00:00 (13/45): fontconfig-2.13.94-2.amzn2022.x86_64.rpm 3.0 MB/s | 275 kB 00:00 (14/45): nss-3.71.0-2.amzn2022.0.1.x86_64.rpm 6.5 MB/s | 700 kB 00:00 (15/45): libxcb-1.13.1-7.amzn2022.x86_64.rpm 2.7 MB/s | 235 kB 00:00 (16/45): lua-5.4.4-1.amzn2022.x86_64.rpm 2.4 MB/s | 190 kB 00:00 (17/45): lua-posix-35.0-3.amzn2022.x86_64.rpm 1.8 MB/s | 133 kB 00:00 (18/45): libX11-1.7.2-3.amzn2022.x86_64.rpm 7.6 MB/s | 657 kB 00:00 (19/45): graphite2-1.3.14-7.amzn2022.x86_64.rpm 1.1 MB/s | 99 kB 00:00 (20/45): nss-util-3.71.0-2.amzn2022.0.1.x86_64.rpm 888 kB/s | 90 kB 00:00 (21/45): java-11-openjdk-devel-11.0.14.1.1-5.amzn2022.x86_64.rpm 14 MB/s | 3.3 MB 00:00 (22/45): alsa-lib-1.2.5.1-2.amzn2022.x86_64.rpm 6.1 MB/s | 505 kB 00:00 (23/45): ttmkfdir-3.0.9-63.amzn2022.x86_64.rpm 1.1 MB/s | 54 kB 00:00 (24/45): libXrender-0.9.10-14.amzn2022.x86_64.rpm 740 kB/s | 29 kB 00:00 (25/45): avahi-libs-0.8-14.amzn2022.0.4.x86_64.rpm 1.3 MB/s | 68 kB 00:00 (26/45): libXcomposite-0.4.5-5.amzn2022.x86_64.rpm 581 kB/s | 25 kB 00:00 (27/45): lksctp-tools-1.0.18-9.amzn2022.x86_64.rpm 1.7 MB/s | 93 kB 00:00 (28/45): nss-softokn-freebl-3.71.0-2.amzn2022.0.1.x86_64.rpm 3.5 MB/s | 329 kB 00:00 (29/45): nss-sysinit-3.71.0-2.amzn2022.0.1.x86_64.rpm 465 kB/s | 21 kB 00:00 (30/45): libXi-1.7.10-6.amzn2022.x86_64.rpm 961 kB/s | 41 kB 00:00 (31/45): libpng-1.6.37-10.amzn2022.x86_64.rpm 1.2 MB/s | 129 kB 00:00 (32/45): java-11-openjdk-headless-11.0.14.1.1-5.amzn2022.x86_64.rpm 47 MB/s | 38 MB 00:00 (33/45): nss-softokn-3.71.0-2.amzn2022.0.1.x86_64.rpm 1.6 MB/s | 383 kB 00:00 (34/45): freetype-2.11.0-3.amzn2022.x86_64.rpm 1.7 MB/s | 411 kB 00:00 (35/45): crypto-policies-scripts-20210213-1.git5c710c0.amzn2022.noarch.rpm 1.3 MB/s | 67 kB 00:00 (36/45): libX11-common-1.7.2-3.amzn2022.noarch.rpm 2.5 MB/s | 153 kB 00:00 (37/45): google-noto-sans-vf-fonts-20201206-2.amzn2022.noarch.rpm 5.8 MB/s | 493 kB 00:00 (38/45): fonts-filesystem-2.0.5-5.amzn2022.noarch.rpm 271 kB/s | 10 kB 00:00 (39/45): langpacks-core-font-en-3.0-21.amzn2022.0.1.noarch.rpm 227 kB/s | 11 kB 00:00 (40/45): tzdata-java-2022a-1.amzn2022.noarch.rpm 2.1 MB/s | 157 kB 00:00 (41/45): xml-common-0.6.3-56.amzn2022.noarch.rpm 704 kB/s | 32 kB 00:00 (42/45): google-noto-fonts-common-20201206-2.amzn2022.noarch.rpm 359 kB/s | 16 kB 00:00 (43/45): xorg-x11-fonts-Type1-7.5-31.amzn2022.noarch.rpm 6.2 MB/s | 504 kB 00:00 (44/45): javapackages-filesystem-5.3.0-15.amzn2022.noarch.rpm 249 kB/s | 12 kB 00:00 (45/45): copy-jdk-configs-4.0-1.amzn2022.noarch.rpm 541 kB/s | 28 kB 00:00 ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Total 28 MB/s | 49 MB 00:01 Running transaction check Transaction check succeeded. Running transaction test Transaction test succeeded. Running transaction Running scriptlet: copy-jdk-configs-4.0-1.amzn2022.noarch 1/1 Running scriptlet: java-11-openjdk-headless-1:11.0.14.1.1-5.amzn2022.x86_64 1/1 Preparing : 1/1 Installing : nspr-4.32.0-2.amzn2022.0.1.x86_64 1/45 Installing : nss-util-3.71.0-2.amzn2022.0.1.x86_64 2/45 Installing : fonts-filesystem-1:2.0.5-5.amzn2022.noarch 3/45 Installing : libpng-2:1.6.37-10.amzn2022.x86_64 4/45 Installing : libjpeg-turbo-2.0.90-3.amzn2022.x86_64 5/45 Installing : nss-softokn-freebl-3.71.0-2.amzn2022.0.1.x86_64 6/45 Installing : nss-softokn-3.71.0-2.amzn2022.0.1.x86_64 7/45 Installing : javapackages-filesystem-5.3.0-15.amzn2022.noarch 8/45 Installing : google-noto-fonts-common-20201206-2.amzn2022.noarch 9/45 Installing : google-noto-sans-vf-fonts-20201206-2.amzn2022.noarch 10/45 Installing : langpacks-core-font-en-3.0-21.amzn2022.0.1.noarch 11/45 Running scriptlet: xml-common-0.6.3-56.amzn2022.noarch 12/45 Installing : xml-common-0.6.3-56.amzn2022.noarch 12/45 Installing : tzdata-java-2022a-1.amzn2022.noarch 13/45 Installing : libX11-common-1.7.2-3.amzn2022.noarch 14/45 Installing : crypto-policies-scripts-20210213-1.git5c710c0.amzn2022.noarch 15/45 Installing : nss-sysinit-3.71.0-2.amzn2022.0.1.x86_64 16/45 Installing : nss-3.71.0-2.amzn2022.0.1.x86_64 17/45 Running scriptlet: nss-3.71.0-2.amzn2022.0.1.x86_64 17/45 Installing : lksctp-tools-1.0.18-9.amzn2022.x86_64 18/45 Installing : avahi-libs-0.8-14.amzn2022.0.4.x86_64 19/45 Installing : cups-libs-1:2.3.3op2-10.amzn2022.x86_64 20/45 Installing : alsa-lib-1.2.5.1-2.amzn2022.x86_64 21/45 Installing : graphite2-1.3.14-7.amzn2022.x86_64 22/45 Installing : freetype-2.11.0-3.amzn2022.x86_64 23/45 Installing : harfbuzz-2.9.1-1.amzn2022.x86_64 24/45 Installing : fontconfig-2.13.94-2.amzn2022.x86_64 25/45 Running scriptlet: fontconfig-2.13.94-2.amzn2022.x86_64 25/45 Installing : ttmkfdir-3.0.9-63.amzn2022.x86_64 26/45 Installing : lua-posix-35.0-3.amzn2022.x86_64 27/45 Installing : lua-5.4.4-1.amzn2022.x86_64 28/45 Installing : copy-jdk-configs-4.0-1.amzn2022.noarch 29/45 Installing : lcms2-2.12-1.amzn2022.x86_64 30/45 Installing : java-11-openjdk-headless-1:11.0.14.1.1-5.amzn2022.x86_64 31/45 Running scriptlet: java-11-openjdk-headless-1:11.0.14.1.1-5.amzn2022.x86_64 31/45 Installing : libXau-1.0.9-6.amzn2022.x86_64 32/45 Installing : libxcb-1.13.1-7.amzn2022.x86_64 33/45 Installing : libX11-1.7.2-3.amzn2022.x86_64 34/45 Installing : libXext-1.3.4-6.amzn2022.x86_64 35/45 Installing : libXi-1.7.10-6.amzn2022.x86_64 36/45 Installing : libXtst-1.2.3-14.amzn2022.x86_64 37/45 Installing : libXrender-0.9.10-14.amzn2022.x86_64 38/45 Installing : libXcomposite-0.4.5-5.amzn2022.x86_64 39/45 Installing : giflib-5.2.1-7.amzn2022.x86_64 40/45 Installing : libfontenc-1.1.3-15.amzn2022.x86_64 41/45 Installing : mkfontscale-1.2.1-2.amzn2022.x86_64 42/45 Installing : xorg-x11-fonts-Type1-7.5-31.amzn2022.noarch 43/45 Running scriptlet: xorg-x11-fonts-Type1-7.5-31.amzn2022.noarch 43/45 Installing : java-11-openjdk-1:11.0.14.1.1-5.amzn2022.x86_64 44/45 Running scriptlet: java-11-openjdk-1:11.0.14.1.1-5.amzn2022.x86_64 44/45 Installing : java-11-openjdk-devel-1:11.0.14.1.1-5.amzn2022.x86_64 45/45 Running scriptlet: java-11-openjdk-devel-1:11.0.14.1.1-5.amzn2022.x86_64 45/45 Running scriptlet: crypto-policies-scripts-20210213-1.git5c710c0.amzn2022.noarch 45/45 Running scriptlet: nss-3.71.0-2.amzn2022.0.1.x86_64 45/45 Running scriptlet: fontconfig-2.13.94-2.amzn2022.x86_64 45/45 Running scriptlet: copy-jdk-configs-4.0-1.amzn2022.noarch 45/45 Running scriptlet: java-11-openjdk-headless-1:11.0.14.1.1-5.amzn2022.x86_64 45/45 Running scriptlet: java-11-openjdk-1:11.0.14.1.1-5.amzn2022.x86_64 45/45 Running scriptlet: java-11-openjdk-devel-1:11.0.14.1.1-5.amzn2022.x86_64 45/45 Verifying : harfbuzz-2.9.1-1.amzn2022.x86_64 1/45 Verifying : java-11-openjdk-1:11.0.14.1.1-5.amzn2022.x86_64 2/45 Verifying : libXext-1.3.4-6.amzn2022.x86_64 3/45 Verifying : libXtst-1.2.3-14.amzn2022.x86_64 4/45 Verifying : libjpeg-turbo-2.0.90-3.amzn2022.x86_64 5/45 Verifying : mkfontscale-1.2.1-2.amzn2022.x86_64 6/45 Verifying : nspr-4.32.0-2.amzn2022.0.1.x86_64 7/45 Verifying : libfontenc-1.1.3-15.amzn2022.x86_64 8/45 Verifying : giflib-5.2.1-7.amzn2022.x86_64 9/45 Verifying : libXau-1.0.9-6.amzn2022.x86_64 10/45 Verifying : lcms2-2.12-1.amzn2022.x86_64 11/45 Verifying : cups-libs-1:2.3.3op2-10.amzn2022.x86_64 12/45 Verifying : fontconfig-2.13.94-2.amzn2022.x86_64 13/45 Verifying : nss-3.71.0-2.amzn2022.0.1.x86_64 14/45 Verifying : libxcb-1.13.1-7.amzn2022.x86_64 15/45 Verifying : lua-5.4.4-1.amzn2022.x86_64 16/45 Verifying : libX11-1.7.2-3.amzn2022.x86_64 17/45 Verifying : lua-posix-35.0-3.amzn2022.x86_64 18/45 Verifying : java-11-openjdk-headless-1:11.0.14.1.1-5.amzn2022.x86_64 19/45 Verifying : java-11-openjdk-devel-1:11.0.14.1.1-5.amzn2022.x86_64 20/45 Verifying : graphite2-1.3.14-7.amzn2022.x86_64 21/45 Verifying : nss-util-3.71.0-2.amzn2022.0.1.x86_64 22/45 Verifying : alsa-lib-1.2.5.1-2.amzn2022.x86_64 23/45 Verifying : ttmkfdir-3.0.9-63.amzn2022.x86_64 24/45 Verifying : libXrender-0.9.10-14.amzn2022.x86_64 25/45 Verifying : avahi-libs-0.8-14.amzn2022.0.4.x86_64 26/45 Verifying : libXcomposite-0.4.5-5.amzn2022.x86_64 27/45 Verifying : nss-softokn-freebl-3.71.0-2.amzn2022.0.1.x86_64 28/45 Verifying : lksctp-tools-1.0.18-9.amzn2022.x86_64 29/45 Verifying : libpng-2:1.6.37-10.amzn2022.x86_64 30/45 Verifying : nss-sysinit-3.71.0-2.amzn2022.0.1.x86_64 31/45 Verifying : libXi-1.7.10-6.amzn2022.x86_64 32/45 Verifying : nss-softokn-3.71.0-2.amzn2022.0.1.x86_64 33/45 Verifying : freetype-2.11.0-3.amzn2022.x86_64 34/45 Verifying : google-noto-sans-vf-fonts-20201206-2.amzn2022.noarch 35/45 Verifying : crypto-policies-scripts-20210213-1.git5c710c0.amzn2022.noarch 36/45 Verifying : libX11-common-1.7.2-3.amzn2022.noarch 37/45 Verifying : tzdata-java-2022a-1.amzn2022.noarch 38/45 Verifying : langpacks-core-font-en-3.0-21.amzn2022.0.1.noarch 39/45 Verifying : fonts-filesystem-1:2.0.5-5.amzn2022.noarch 40/45 Verifying : xorg-x11-fonts-Type1-7.5-31.amzn2022.noarch 41/45 Verifying : xml-common-0.6.3-56.amzn2022.noarch 42/45 Verifying : google-noto-fonts-common-20201206-2.amzn2022.noarch 43/45 Verifying : javapackages-filesystem-5.3.0-15.amzn2022.noarch 44/45 Verifying : copy-jdk-configs-4.0-1.amzn2022.noarch 45/45 ================================================================================================================================================================================== WARNING: A newer release of "Amazon Linux" is available. Available Versions: Version 2022.0.20230118: Run the following command to update to 2022.0.20230118: dnf update --releasever=2022.0.20230118 Release notes: https://docs.aws.amazon.com/linux/al2022/release-notes/relnotes.html ================================================================================================================================================================================== Installed: alsa-lib-1.2.5.1-2.amzn2022.x86_64 avahi-libs-0.8-14.amzn2022.0.4.x86_64 copy-jdk-configs-4.0-1.amzn2022.noarch crypto-policies-scripts-20210213-1.git5c710c0.amzn2022.noarch cups-libs-1:2.3.3op2-10.amzn2022.x86_64 fontconfig-2.13.94-2.amzn2022.x86_64 fonts-filesystem-1:2.0.5-5.amzn2022.noarch freetype-2.11.0-3.amzn2022.x86_64 giflib-5.2.1-7.amzn2022.x86_64 google-noto-fonts-common-20201206-2.amzn2022.noarch google-noto-sans-vf-fonts-20201206-2.amzn2022.noarch graphite2-1.3.14-7.amzn2022.x86_64 harfbuzz-2.9.1-1.amzn2022.x86_64 java-11-openjdk-1:11.0.14.1.1-5.amzn2022.x86_64 java-11-openjdk-devel-1:11.0.14.1.1-5.amzn2022.x86_64 java-11-openjdk-headless-1:11.0.14.1.1-5.amzn2022.x86_64 javapackages-filesystem-5.3.0-15.amzn2022.noarch langpacks-core-font-en-3.0-21.amzn2022.0.1.noarch lcms2-2.12-1.amzn2022.x86_64 libX11-1.7.2-3.amzn2022.x86_64 libX11-common-1.7.2-3.amzn2022.noarch libXau-1.0.9-6.amzn2022.x86_64 libXcomposite-0.4.5-5.amzn2022.x86_64 libXext-1.3.4-6.amzn2022.x86_64 libXi-1.7.10-6.amzn2022.x86_64 libXrender-0.9.10-14.amzn2022.x86_64 libXtst-1.2.3-14.amzn2022.x86_64 libfontenc-1.1.3-15.amzn2022.x86_64 libjpeg-turbo-2.0.90-3.amzn2022.x86_64 libpng-2:1.6.37-10.amzn2022.x86_64 libxcb-1.13.1-7.amzn2022.x86_64 lksctp-tools-1.0.18-9.amzn2022.x86_64 lua-5.4.4-1.amzn2022.x86_64 lua-posix-35.0-3.amzn2022.x86_64 mkfontscale-1.2.1-2.amzn2022.x86_64 nspr-4.32.0-2.amzn2022.0.1.x86_64 nss-3.71.0-2.amzn2022.0.1.x86_64 nss-softokn-3.71.0-2.amzn2022.0.1.x86_64 nss-softokn-freebl-3.71.0-2.amzn2022.0.1.x86_64 nss-sysinit-3.71.0-2.amzn2022.0.1.x86_64 nss-util-3.71.0-2.amzn2022.0.1.x86_64 ttmkfdir-3.0.9-63.amzn2022.x86_64 tzdata-java-2022a-1.amzn2022.noarch xml-common-0.6.3-56.amzn2022.noarch xorg-x11-fonts-Type1-7.5-31.amzn2022.noarch Complete!
↑openjdk11をインストール
# java -version openjdk version "11.0.14.1" 2022-02-08 OpenJDK Runtime Environment 18.9 (build 11.0.14.1+1) OpenJDK 64-Bit Server VM 18.9 (build 11.0.14.1+1, mixed mode, sharing)
httpdをインストール
Tomcatへのajpによるリクエスト転送を行うためにhttpdをインストール
# dnf install httpd Last metadata expiration check: 0:14:00 ago on Sun 12 Mar 2023 12:37:21 PM JST. Dependencies resolved. ================================================================================================================================================================================== Package Architecture Version Repository Size ================================================================================================================================================================================== Installing: httpd x86_64 2.4.53-3.amzn2022.0.1 amazonlinux 47 k Installing dependencies: apr x86_64 1.7.0-9.amzn2022 amazonlinux 121 k apr-util x86_64 1.6.1-16.amzn2022.0.1 amazonlinux 97 k generic-logos-httpd noarch 18.0.0-12.amzn2022 amazonlinux 19 k httpd-core x86_64 2.4.53-3.amzn2022.0.1 amazonlinux 1.4 M httpd-filesystem noarch 2.4.53-3.amzn2022.0.1 amazonlinux 14 k httpd-tools x86_64 2.4.53-3.amzn2022.0.1 amazonlinux 82 k mailcap noarch 2.1.49-3.amzn2022 amazonlinux 34 k Transaction Summary ================================================================================================================================================================================== Install 8 Packages Total download size: 1.8 M Installed size: 5.5 M Is this ok [y/N]: y Downloading Packages: (1/8): apr-util-1.6.1-16.amzn2022.0.1.x86_64.rpm 389 kB/s | 97 kB 00:00 (2/8): httpd-tools-2.4.53-3.amzn2022.0.1.x86_64.rpm 302 kB/s | 82 kB 00:00 (3/8): apr-1.7.0-9.amzn2022.x86_64.rpm 414 kB/s | 121 kB 00:00 (4/8): httpd-2.4.53-3.amzn2022.0.1.x86_64.rpm 1.0 MB/s | 47 kB 00:00 (5/8): mailcap-2.1.49-3.amzn2022.noarch.rpm 1.0 MB/s | 34 kB 00:00 (6/8): httpd-filesystem-2.4.53-3.amzn2022.0.1.noarch.rpm 448 kB/s | 14 kB 00:00 (7/8): generic-logos-httpd-18.0.0-12.amzn2022.noarch.rpm 388 kB/s | 19 kB 00:00 (8/8): httpd-core-2.4.53-3.amzn2022.0.1.x86_64.rpm 9.9 MB/s | 1.4 MB 00:00 ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Total 3.7 MB/s | 1.8 MB 00:00 Running transaction check Transaction check succeeded. Running transaction test Transaction test succeeded. Running transaction Preparing : 1/1 Installing : apr-1.7.0-9.amzn2022.x86_64 1/8 Installing : apr-util-1.6.1-16.amzn2022.0.1.x86_64 2/8 Installing : mailcap-2.1.49-3.amzn2022.noarch 3/8 Installing : httpd-tools-2.4.53-3.amzn2022.0.1.x86_64 4/8 Installing : generic-logos-httpd-18.0.0-12.amzn2022.noarch 5/8 Running scriptlet: httpd-filesystem-2.4.53-3.amzn2022.0.1.noarch 6/8 Installing : httpd-filesystem-2.4.53-3.amzn2022.0.1.noarch 6/8 Installing : httpd-core-2.4.53-3.amzn2022.0.1.x86_64 7/8 Installing : httpd-2.4.53-3.amzn2022.0.1.x86_64 8/8 Running scriptlet: httpd-2.4.53-3.amzn2022.0.1.x86_64 8/8 Verifying : httpd-tools-2.4.53-3.amzn2022.0.1.x86_64 1/8 Verifying : apr-util-1.6.1-16.amzn2022.0.1.x86_64 2/8 Verifying : apr-1.7.0-9.amzn2022.x86_64 3/8 Verifying : httpd-core-2.4.53-3.amzn2022.0.1.x86_64 4/8 Verifying : httpd-2.4.53-3.amzn2022.0.1.x86_64 5/8 Verifying : mailcap-2.1.49-3.amzn2022.noarch 6/8 Verifying : httpd-filesystem-2.4.53-3.amzn2022.0.1.noarch 7/8 Verifying : generic-logos-httpd-18.0.0-12.amzn2022.noarch 8/8 ================================================================================================================================================================================== WARNING: A newer release of "Amazon Linux" is available. Available Versions: Version 2022.0.20230118: Run the following command to update to 2022.0.20230118: dnf update --releasever=2022.0.20230118 Release notes: https://docs.aws.amazon.com/linux/al2022/release-notes/relnotes.html ================================================================================================================================================================================== Installed: apr-1.7.0-9.amzn2022.x86_64 apr-util-1.6.1-16.amzn2022.0.1.x86_64 generic-logos-httpd-18.0.0-12.amzn2022.noarch httpd-2.4.53-3.amzn2022.0.1.x86_64 httpd-core-2.4.53-3.amzn2022.0.1.x86_64 httpd-filesystem-2.4.53-3.amzn2022.0.1.noarch httpd-tools-2.4.53-3.amzn2022.0.1.x86_64 mailcap-2.1.49-3.amzn2022.noarch Complete!
↑2.4系がインストールできる
# httpd -v Server version: Apache/2.4.53 (Amazon Linux) Server built: Apr 7 2022 00:00:00 # systemctl is-enabled httpd disabled # systemctl enable httpd Created symlink /etc/systemd/system/multi-user.target.wants/httpd.service → /usr/lib/systemd/system/httpd.service. # systemctl start httpd
↑バージョン確認、自動起動設定、いったん起動
↑ブラウザでパブリックIPにアクセスして「It works!」の表示を確認
Tomcat9をインストール
# dnf list | grep tomcat tomcat.noarch 1:9.0.59-1.amzn2022 amazonlinux tomcat-admin-webapps.noarch 1:9.0.59-1.amzn2022 amazonlinux tomcat-docs-webapp.noarch 1:9.0.59-1.amzn2022 amazonlinux tomcat-el-3.0-api.noarch 1:9.0.59-1.amzn2022 amazonlinux tomcat-jsp-2.3-api.noarch 1:9.0.59-1.amzn2022 amazonlinux tomcat-jsvc.noarch 1:9.0.59-1.amzn2022 amazonlinux tomcat-lib.noarch 1:9.0.59-1.amzn2022 amazonlinux tomcat-servlet-4.0-api.noarch 1:9.0.59-1.amzn2022 amazonlinux tomcat-taglibs-parent.noarch 3-14.amzn2022 amazonlinux tomcat-taglibs-standard.noarch 1.2.5-13.amzn2022 amazonlinux tomcat-taglibs-standard-javadoc.noarch 1.2.5-13.amzn2022 amazonlinux tomcat-webapps.noarch 1:9.0.59-1.amzn2022 amazonlinux
↑パッケージマネージャからTomcat9がインストールできること、パッケージ名がtomcatであることを確認
# dnf install tomcat tomcat-webapps Last metadata expiration check: 0:21:55 ago on Sun 12 Mar 2023 12:37:21 PM JST. Dependencies resolved. ================================================================================================================================================================================== Package Architecture Version Repository Size ================================================================================================================================================================================== Installing: tomcat noarch 1:9.0.59-1.amzn2022 amazonlinux 90 k tomcat-webapps noarch 1:9.0.59-1.amzn2022 amazonlinux 307 k Installing dependencies: apache-commons-daemon x86_64 1.2.4-1.amzn2022 amazonlinux 56 k ecj noarch 1:4.19-1.amzn2022 amazonlinux 2.8 M javapackages-tools noarch 5.3.0-15.amzn2022 amazonlinux 33 k tomcat-el-3.0-api noarch 1:9.0.59-1.amzn2022 amazonlinux 104 k tomcat-jsp-2.3-api noarch 1:9.0.59-1.amzn2022 amazonlinux 64 k tomcat-lib noarch 1:9.0.59-1.amzn2022 amazonlinux 5.4 M tomcat-servlet-4.0-api noarch 1:9.0.59-1.amzn2022 amazonlinux 282 k tomcat-taglibs-standard noarch 1.2.5-13.amzn2022 amazonlinux 410 k Transaction Summary ================================================================================================================================================================================== Install 10 Packages Total download size: 9.5 M Installed size: 12 M Is this ok [y/N]: y Downloading Packages: (1/10): apache-commons-daemon-1.2.4-1.amzn2022.x86_64.rpm 256 kB/s | 56 kB 00:00 (2/10): tomcat-jsp-2.3-api-9.0.59-1.amzn2022.noarch.rpm 283 kB/s | 64 kB 00:00 (3/10): javapackages-tools-5.3.0-15.amzn2022.noarch.rpm 959 kB/s | 33 kB 00:00 (4/10): tomcat-servlet-4.0-api-9.0.59-1.amzn2022.noarch.rpm 1.0 MB/s | 282 kB 00:00 (5/10): tomcat-webapps-9.0.59-1.amzn2022.noarch.rpm 3.1 MB/s | 307 kB 00:00 (6/10): tomcat-taglibs-standard-1.2.5-13.amzn2022.noarch.rpm 5.8 MB/s | 410 kB 00:00 (7/10): tomcat-9.0.59-1.amzn2022.noarch.rpm 1.4 MB/s | 90 kB 00:00 (8/10): tomcat-el-3.0-api-9.0.59-1.amzn2022.noarch.rpm 1.5 MB/s | 104 kB 00:00 (9/10): tomcat-lib-9.0.59-1.amzn2022.noarch.rpm 25 MB/s | 5.4 MB 00:00 (10/10): ecj-4.19-1.amzn2022.noarch.rpm 13 MB/s | 2.8 MB 00:00 ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Total 14 MB/s | 9.5 MB 00:00 Running transaction check Transaction check succeeded. Running transaction test Transaction test succeeded. Running transaction Preparing : 1/1 Installing : tomcat-el-3.0-api-1:9.0.59-1.amzn2022.noarch 1/10 Running scriptlet: tomcat-el-3.0-api-1:9.0.59-1.amzn2022.noarch 1/10 Installing : tomcat-servlet-4.0-api-1:9.0.59-1.amzn2022.noarch 2/10 Running scriptlet: tomcat-servlet-4.0-api-1:9.0.59-1.amzn2022.noarch 2/10 Installing : tomcat-jsp-2.3-api-1:9.0.59-1.amzn2022.noarch 3/10 Running scriptlet: tomcat-jsp-2.3-api-1:9.0.59-1.amzn2022.noarch 3/10 Installing : ecj-1:4.19-1.amzn2022.noarch 4/10 Installing : tomcat-lib-1:9.0.59-1.amzn2022.noarch 5/10 Installing : tomcat-taglibs-standard-1.2.5-13.amzn2022.noarch 6/10 Installing : javapackages-tools-5.3.0-15.amzn2022.noarch 7/10 Installing : apache-commons-daemon-1.2.4-1.amzn2022.x86_64 8/10 Running scriptlet: tomcat-1:9.0.59-1.amzn2022.noarch 9/10 Installing : tomcat-1:9.0.59-1.amzn2022.noarch 9/10 Running scriptlet: tomcat-1:9.0.59-1.amzn2022.noarch 9/10 Installing : tomcat-webapps-1:9.0.59-1.amzn2022.noarch 10/10 Running scriptlet: tomcat-webapps-1:9.0.59-1.amzn2022.noarch 10/10 Verifying : apache-commons-daemon-1.2.4-1.amzn2022.x86_64 1/10 Verifying : tomcat-servlet-4.0-api-1:9.0.59-1.amzn2022.noarch 2/10 Verifying : tomcat-jsp-2.3-api-1:9.0.59-1.amzn2022.noarch 3/10 Verifying : tomcat-webapps-1:9.0.59-1.amzn2022.noarch 4/10 Verifying : javapackages-tools-5.3.0-15.amzn2022.noarch 5/10 Verifying : tomcat-taglibs-standard-1.2.5-13.amzn2022.noarch 6/10 Verifying : tomcat-1:9.0.59-1.amzn2022.noarch 7/10 Verifying : tomcat-lib-1:9.0.59-1.amzn2022.noarch 8/10 Verifying : tomcat-el-3.0-api-1:9.0.59-1.amzn2022.noarch 9/10 Verifying : ecj-1:4.19-1.amzn2022.noarch 10/10 ================================================================================================================================================================================== WARNING: A newer release of "Amazon Linux" is available. Available Versions: Version 2022.0.20230118: Run the following command to update to 2022.0.20230118: dnf update --releasever=2022.0.20230118 Release notes: https://docs.aws.amazon.com/linux/al2022/release-notes/relnotes.html ================================================================================================================================================================================== Installed: apache-commons-daemon-1.2.4-1.amzn2022.x86_64 ecj-1:4.19-1.amzn2022.noarch javapackages-tools-5.3.0-15.amzn2022.noarch tomcat-1:9.0.59-1.amzn2022.noarch tomcat-el-3.0-api-1:9.0.59-1.amzn2022.noarch tomcat-jsp-2.3-api-1:9.0.59-1.amzn2022.noarch tomcat-lib-1:9.0.59-1.amzn2022.noarch tomcat-servlet-4.0-api-1:9.0.59-1.amzn2022.noarch tomcat-taglibs-standard-1.2.5-13.amzn2022.noarch tomcat-webapps-1:9.0.59-1.amzn2022.noarch Complete!
↑tomcatとtomcat-webappsをインストール(tomcat-webappsは動作確認用にインストールしています。本番では不要)
# tomcat version Server version: Apache Tomcat/9.0.59 Server built: Jan 14 1970 23:12:05 UTC Server number: 9.0.59.0 OS Name: Linux OS Version: 5.15.43-20.123.amzn2022.x86_64 Architecture: amd64 JVM Version: 11.0.14.1+1 JVM Vendor: Red Hat, Inc.
↑tomcat versionより各種バージョン情報を確認
# vi /etc/tomcat/server.xml
<?xml version="1.0" encoding="UTF-8"?> <!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> <!-- Note: A "Server" is not itself a "Container", so you may not define subcomponents such as "Valves" at this level. Documentation at /docs/config/server.html --> <Server port="8005" shutdown="SHUTDOWN"> <Listener className="org.apache.catalina.startup.VersionLoggerListener" /> <!-- Security listener. Documentation at /docs/config/listeners.html <Listener className="org.apache.catalina.security.SecurityListener" /> --> <!-- APR library loader. Documentation at /docs/apr.html --> <Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on" /> <!-- Prevent memory leaks due to use of particular java/javax APIs--> <Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener" /> <Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" /> <Listener className="org.apache.catalina.core.ThreadLocalLeakPreventionListener" /> <!-- Global JNDI resources Documentation at /docs/jndi-resources-howto.html --> <GlobalNamingResources> <!-- Editable user database that can also be used by UserDatabaseRealm to authenticate users --> <Resource name="UserDatabase" auth="Container" type="org.apache.catalina.UserDatabase" description="User database that can be updated and saved" factory="org.apache.catalina.users.MemoryUserDatabaseFactory" pathname="conf/tomcat-users.xml" /> </GlobalNamingResources> <!-- A "Service" is a collection of one or more "Connectors" that share a single "Container" Note: A "Service" is not itself a "Container", so you may not define subcomponents such as "Valves" at this level. Documentation at /docs/config/service.html --> <Service name="Catalina"> <!--The connectors can use a shared executor, you can define one or more named thread pools--> <!-- <Executor name="tomcatThreadPool" namePrefix="catalina-exec-" maxThreads="150" minSpareThreads="4"/> --> <!-- A "Connector" represents an endpoint by which requests are received and responses are returned. Documentation at : Java HTTP Connector: /docs/config/http.html Java AJP Connector: /docs/config/ajp.html APR (HTTP/AJP) Connector: /docs/apr.html Define a non-SSL/TLS HTTP/1.1 Connector on port 8080 --> <Connector port="8080" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" /> <!-- A "Connector" using the shared thread pool--> <!-- <Connector executor="tomcatThreadPool" port="8080" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" /> --> <!-- Define an SSL/TLS HTTP/1.1 Connector on port 8443 This connector uses the NIO implementation. The default SSLImplementation will depend on the presence of the APR/native library and the useOpenSSL attribute of the AprLifecycleListener. Either JSSE or OpenSSL style configuration may be used regardless of the SSLImplementation selected. JSSE style configuration is used below. --> <!-- <Connector port="8443" protocol="org.apache.coyote.http11.Http11NioProtocol" maxThreads="150" SSLEnabled="true"> <SSLHostConfig> <Certificate certificateKeystoreFile="conf/localhost-rsa.jks" type="RSA" /> </SSLHostConfig> </Connector> --> <!-- Define an SSL/TLS HTTP/1.1 Connector on port 8443 with HTTP/2 This connector uses the APR/native implementation which always uses OpenSSL for TLS. Either JSSE or OpenSSL style configuration may be used. OpenSSL style configuration is used below. --> <!-- <Connector port="8443" protocol="org.apache.coyote.http11.Http11AprProtocol" maxThreads="150" SSLEnabled="true" > <UpgradeProtocol className="org.apache.coyote.http2.Http2Protocol" /> <SSLHostConfig> <Certificate certificateKeyFile="conf/localhost-rsa-key.pem" certificateFile="conf/localhost-rsa-cert.pem" certificateChainFile="conf/localhost-rsa-chain.pem" type="RSA" /> </SSLHostConfig> </Connector> --> <!-- Define an AJP 1.3 Connector on port 8009 --> - <!-- <Connector protocol="AJP/1.3" - address="::1" port="8009" + secretRequired="false" + useBodyEncodingForURI="true" redirectPort="8443" /> - --> <!-- An Engine represents the entry point (within Catalina) that processes every request. The Engine implementation for Tomcat stand alone analyzes the HTTP headers included with the request, and passes them on to the appropriate Host (virtual host). Documentation at /docs/config/engine.html --> <!-- You should set jvmRoute to support load-balancing via AJP ie : <Engine name="Catalina" defaultHost="localhost" jvmRoute="jvm1"> --> <Engine name="Catalina" defaultHost="localhost"> <!--For clustering, please take a look at documentation at: /docs/cluster-howto.html (simple how to) /docs/config/cluster.html (reference documentation) --> <!-- <Cluster className="org.apache.catalina.ha.tcp.SimpleTcpCluster"/> --> <!-- Use the LockOutRealm to prevent attempts to guess user passwords via a brute-force attack --> <Realm className="org.apache.catalina.realm.LockOutRealm"> <!-- This Realm uses the UserDatabase configured in the global JNDI resources under the key "UserDatabase". Any edits that are performed against this UserDatabase are immediately available for use by the Realm. --> <Realm className="org.apache.catalina.realm.UserDatabaseRealm" resourceName="UserDatabase"/> </Realm> <Host name="localhost" appBase="webapps" unpackWARs="true" autoDeploy="true"> <!-- SingleSignOn valve, share authentication between web applications Documentation at: /docs/config/valve.html --> <!-- <Valve className="org.apache.catalina.authenticator.SingleSignOn" /> --> <!-- Access log processes all example. Documentation at: /docs/config/valve.html Note: The pattern used is equivalent to using pattern="common" --> <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs" prefix="localhost_access_log" suffix=".txt" pattern="%h %l %u %t "%r" %s %b" /> </Host> </Engine> </Service> </Server>
↑コメントアウトされているajpのコネクタについて修正
# pwd /var/lib/tomcat # ll total 0 drwxrwxr-x 5 root tomcat 48 Mar 12 12:59 webapps # ll webapps/ total 0 drwxr-xr-x 7 tomcat tomcat 99 Mar 12 12:59 examples drwxr-xr-x 3 tomcat tomcat 223 Mar 12 12:59 ROOT drwxr-xr-x 5 tomcat tomcat 86 Mar 12 12:59 sample
↑AL2022(x86)においてパッケージマネージャからインストールしたtomcatのROOTディレクトリは/var/lib/tomcat配下に存在する
# vi /etc/httpd/conf.d/httpd-ajp.conf # systemctl reload httpd
ProxyRequests Off ProxyPass / ajp://localhost:8009/ ProxyPassReverse / ajp://localhost:8009/
↑httpdのconf.dディレクトリに新規でajp連携のための設定ファイルを作成。
すべてのリクエストをlocalhostの8009番(tomcatが待ち受けてるポート)に向ける設定を行う。
設定作成後、httpdの設定についてリロード
# systemctl is-enabled tomcat disabled # systemctl enable tomcat Created symlink /etc/systemd/system/multi-user.target.wants/tomcat.service → /usr/lib/systemd/system/tomcat.service. # systemctl start tomcat # ps -ax | grep [t]omcat 24210 ? Ssl 0:05 /usr/lib/jvm/jre/bin/java -Djavax.sql.DataSource.Factory=org.apache.commons.dbcp.BasicDataSourceFactory -classpath /usr/share/tomcat/bin/bootstrap.jar:/usr/share/tomcat/bin/tomcat-juli.jar:/usr/lib/java/commons-daemon.jar -Dcatalina.base=/usr/share/tomcat -Dcatalina.home=/usr/share/tomcat -Djava.endorsed.dirs= -Djava.io.tmpdir=/var/cache/tomcat/temp -Djava.util.logging.config.file=/usr/share/tomcat/conf/logging.properties -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager org.apache.catalina.startup.Bootstrap start
↑tomcatについて自動起動設定を行い、起動
↑tomcat起動後、ブラウザでパブリックIPにアクセスしてTomcatのホーム画面が表示されることを確認。
MySQL8.0をインストール
- MySQLはamazonlinux.repo標準ではサポートされていないためMySQL Communityのリポジトリを追加する
- 追加するリポジトリはopensslのバージョンとの兼ね合いで変わるので注意が必要
- 2023年3月現在、x86のAL2022にはopensslのバージョン3系(3.0.3)が入っているためRHEL9用のリポジトリを追加する必要がありそう
x86のAL2022ではopenssl1.1が依存解決によりインストールされるためRHEL8もインストール可能であることがわかりました。。
# dnf search mysql Last metadata expiration check: 0:48:03 ago on Sun 12 Mar 2023 12:37:21 PM JST. ========================================================================= Name & Summary Matched: mysql ========================================================================== apr-util-mysql.x86_64 : APR utility library MySQL DBD driver bind-dlz-mysql.x86_64 : BIND server mysql and mysqldyn DLZ modules mysql-selinux.noarch : SELinux policy modules for MySQL and MariaDB packages pcp-pmda-mysql.x86_64 : Performance Co-Pilot (PCP) metrics for MySQL perl-DBD-MySQL.x86_64 : A MySQL interface for Perl perl-DateTime-Format-MySQL.noarch : Parse and format MySQL dates and times perl-Time-Piece-MySQL.noarch : MySQL-specific methods for Time::Piece php-mysqlnd.x86_64 : A module for PHP applications that use MySQL databases postfix-mysql.x86_64 : Postfix MySQL map support qt5-qtbase-mysql.x86_64 : MySQL driver for Qt5's SQL classes rsyslog-mysql.x86_64 : MySQL support for rsyslog ============================================================================= Summary Matched: mysql ============================================================================= mariadb105-devel.x86_64 : Files for development of MariaDB/MySQL applications mariadb105-server-utils.x86_64 : Non-essential server utilities for MariaDB/MySQL applications
↑リポジトリ追加前、標準でインストール可能なMySQL関連のパッケージ。
mariadb10.5のパッケージが存在する(サーバーではない)。
# dnf localinstall https://dev.mysql.com/get/mysql80-community-release-el9-1.noarch.rpm Last metadata expiration check: 0:49:41 ago on Sun 12 Mar 2023 12:37:21 PM JST. mysql80-community-release-el9-1.noarch.rpm 29 kB/s | 10 kB 00:00 Dependencies resolved. ================================================================================================================================================================================== Package Architecture Version Repository Size ================================================================================================================================================================================== Installing: mysql80-community-release noarch el9-1 @commandline 10 k Transaction Summary ================================================================================================================================================================================== Install 1 Package Total size: 10 k Installed size: 5.7 k Is this ok [y/N]: y Downloading Packages: Running transaction check Transaction check succeeded. Running transaction test Transaction test succeeded. Running transaction Preparing : 1/1 Installing : mysql80-community-release-el9-1.noarch 1/1 Verifying : mysql80-community-release-el9-1.noarch 1/1 ================================================================================================================================================================================== WARNING: A newer release of "Amazon Linux" is available. Available Versions: Version 2022.0.20230118: Run the following command to update to 2022.0.20230118: dnf update --releasever=2022.0.20230118 Release notes: https://docs.aws.amazon.com/linux/al2022/release-notes/relnotes.html ================================================================================================================================================================================== Installed: mysql80-community-release-el9-1.noarch Complete!
↑RHEL9用のリポジトリを追加
# ll /etc/yum.repos.d/ total 16 -rw-r--r--. 1 root root 968 May 27 2022 amazonlinux.repo -rw-r--r-- 1 root root 951 Jul 6 2022 mysql-community-debuginfo.repo -rw-r--r-- 1 root root 827 Jul 6 2022 mysql-community.repo -rw-r--r-- 1 root root 871 Jul 6 2022 mysql-community-source.repo # cat /etc/yum.repos.d/mysql-community.repo [mysql80-community] name=MySQL 8.0 Community Server baseurl=http://repo.mysql.com/yum/mysql-8.0-community/el/9/$basearch/ enabled=1 gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql-2022 [mysql-connectors-community] name=MySQL Connectors Community baseurl=http://repo.mysql.com/yum/mysql-connectors-community/el/9/$basearch/ enabled=1 gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql-2022 [mysql-tools-community] name=MySQL Tools Community baseurl=http://repo.mysql.com/yum/mysql-tools-community/el/9/$basearch/ enabled=1 gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql-2022 [mysql-cluster-8.0-community] name=MySQL Cluster 8.0 Community baseurl=http://repo.mysql.com/yum/mysql-cluster-8.0-community/el/9/$basearch/ enabled=0 gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql-2022
↑mysql-communityについてデフォルトで有効化されてることを確認
# dnf search mysql Last metadata expiration check: 0:02:12 ago on Sun 12 Mar 2023 01:29:52 PM JST. ========================================================================= Name & Summary Matched: mysql ========================================================================== apr-util-mysql.x86_64 : APR utility library MySQL DBD driver bind-dlz-mysql.x86_64 : BIND server mysql and mysqldyn DLZ modules mysql-community-client.x86_64 : MySQL database client applications and tools mysql-community-client-plugins.x86_64 : Shared plugins for MySQL client applications mysql-community-common.x86_64 : MySQL database common files for server and client libs mysql-community-debugsource.x86_64 : Debug sources for package mysql-community mysql-community-devel.x86_64 : Development header files and libraries for MySQL database client applications mysql-community-icu-data-files.x86_64 : MySQL packaging of ICU data files mysql-community-libs.x86_64 : Shared libraries for MySQL database client applications mysql-community-server-debug.x86_64 : The debug version of MySQL server mysql-community-test.x86_64 : Test suite for the MySQL database server mysql-connector-c++.x86_64 : MySQL database connector for C++ mysql-connector-c++-debugsource.x86_64 : Debug sources for package mysql-connector-c++ mysql-connector-c++-devel.x86_64 : Development header files and libraries for MySQL C++ client applications mysql-connector-c++-jdbc.x86_64 : MySQL Driver for C++ which mimics the JDBC 4.0 API mysql-connector-j.noarch : Standardized MySQL database driver for Java mysql-connector-odbc.x86_64 : An ODBC 8.0 driver for MySQL - driver package mysql-connector-odbc-debugsource.x86_64 : Debug sources for package mysql-connector-odbc mysql-connector-odbc-setup.x86_64 : An ODBC 8.0 driver for MySQL - setup library mysql-connector-python3.x86_64 : Standardized MySQL database driver for Python 3 mysql-ref-manual-8.0-en-html-chapter.noarch : The MySQL Reference Manual (HTML, English) mysql-ref-manual-8.0-en-pdf.noarch : The MySQL Reference Manual (PDF, English) mysql-router-community.x86_64 : MySQL Router mysql-selinux.noarch : SELinux policy modules for MySQL and MariaDB packages mysql-shell.x86_64 : Command line shell and scripting environment for MySQL mysql-shell-debugsource.x86_64 : Debug sources for package mysql-shell mysql-workbench-community.x86_64 : A MySQL visual database modeling, administration, development and migration tool mysql80-community-release.noarch : MySQL repository configuration for yum pcp-pmda-mysql.x86_64 : Performance Co-Pilot (PCP) metrics for MySQL perl-DBD-MySQL.x86_64 : A MySQL interface for Perl perl-DateTime-Format-MySQL.noarch : Parse and format MySQL dates and times perl-Time-Piece-MySQL.noarch : MySQL-specific methods for Time::Piece php-mysqlnd.x86_64 : A module for PHP applications that use MySQL databases postfix-mysql.x86_64 : Postfix MySQL map support qt5-qtbase-mysql.x86_64 : MySQL driver for Qt5's SQL classes rsyslog-mysql.x86_64 : MySQL support for rsyslog ============================================================================== Name Matched: mysql =============================================================================== mysql-community-server.x86_64 : A very fast and reliable SQL database server ============================================================================= Summary Matched: mysql ============================================================================= mariadb105-devel.x86_64 : Files for development of MariaDB/MySQL applications mariadb105-server-utils.x86_64 : Non-essential server utilities for MariaDB/MySQL applications
↑リポジトリ追加前と比べてmysql-community-serverなどのパッケージが追加されたことを確認
# dnf install mysql-community-server Last metadata expiration check: 0:05:15 ago on Sun 12 Mar 2023 01:29:52 PM JST. Dependencies resolved. ================================================================================================================================================================================== Package Architecture Version Repository Size ================================================================================================================================================================================== Installing: mysql-community-server x86_64 8.0.32-1.el9 mysql80-community 49 M Installing dependencies: libaio x86_64 0.3.111-11.amzn2022 amazonlinux 25 k mysql-community-client x86_64 8.0.32-1.el9 mysql80-community 3.9 M mysql-community-client-plugins x86_64 8.0.32-1.el9 mysql80-community 1.4 M mysql-community-common x86_64 8.0.32-1.el9 mysql80-community 544 k mysql-community-icu-data-files x86_64 8.0.32-1.el9 mysql80-community 2.2 M mysql-community-libs x86_64 8.0.32-1.el9 mysql80-community 1.5 M perl-Carp noarch 1.50-458.amzn2022 amazonlinux 30 k perl-Class-Struct noarch 0.66-477.amzn2022 amazonlinux 34 k perl-DynaLoader x86_64 1.47-477.amzn2022 amazonlinux 38 k perl-Encode x86_64 4:3.15-462.amzn2022 amazonlinux 1.7 M perl-Errno x86_64 1.30-477.amzn2022 amazonlinux 26 k perl-Exporter noarch 5.74-459.amzn2022 amazonlinux 33 k perl-Fcntl x86_64 1.13-477.amzn2022 amazonlinux 32 k perl-File-Basename noarch 2.85-477.amzn2022 amazonlinux 29 k perl-File-Path noarch 2.18-2.amzn2022 amazonlinux 37 k perl-File-Temp noarch 1:0.231.100-2.amzn2022 amazonlinux 62 k perl-File-stat noarch 1.09-477.amzn2022 amazonlinux 29 k perl-Getopt-Long noarch 1:2.52-2.amzn2022 amazonlinux 62 k perl-Getopt-Std noarch 1.12-477.amzn2022 amazonlinux 27 k perl-HTTP-Tiny noarch 0.078-1.amzn2022 amazonlinux 56 k perl-IO x86_64 1.43-477.amzn2022 amazonlinux 99 k perl-IPC-Open3 noarch 1.21-477.amzn2022 amazonlinux 34 k perl-MIME-Base64 x86_64 3.16-2.amzn2022 amazonlinux 32 k perl-POSIX x86_64 1.94-477.amzn2022 amazonlinux 110 k perl-PathTools x86_64 3.78-459.amzn2022 amazonlinux 87 k perl-Pod-Escapes noarch 1:1.07-458.amzn2022 amazonlinux 21 k perl-Pod-Perldoc noarch 3.28.01-459.amzn2022 amazonlinux 86 k perl-Pod-Simple noarch 1:3.42-2.amzn2022 amazonlinux 217 k perl-Pod-Usage noarch 4:2.01-2.amzn2022 amazonlinux 42 k perl-Scalar-List-Utils x86_64 4:1.56-459.amzn2022 amazonlinux 73 k perl-SelectSaver noarch 1.02-477.amzn2022 amazonlinux 23 k perl-Socket x86_64 4:2.032-1.amzn2022 amazonlinux 56 k perl-Storable x86_64 1:3.21-458.amzn2022 amazonlinux 98 k perl-Symbol noarch 1.08-477.amzn2022 amazonlinux 26 k perl-Term-ANSIColor noarch 5.01-459.amzn2022 amazonlinux 50 k perl-Term-Cap noarch 1.17-458.amzn2022 amazonlinux 23 k perl-Text-ParseWords noarch 3.30-458.amzn2022 amazonlinux 17 k perl-Text-Tabs+Wrap noarch 2021.0726-1.amzn2022 amazonlinux 23 k perl-Time-Local noarch 2:1.300-5.amzn2022 amazonlinux 35 k perl-constant noarch 1.33-459.amzn2022 amazonlinux 24 k perl-if noarch 0.60.800-477.amzn2022 amazonlinux 25 k perl-interpreter x86_64 4:5.32.1-477.amzn2022 amazonlinux 83 k perl-libs x86_64 4:5.32.1-477.amzn2022 amazonlinux 2.1 M perl-mro x86_64 1.23-477.amzn2022 amazonlinux 40 k perl-overload noarch 1.31-477.amzn2022 amazonlinux 57 k perl-overloading noarch 0.02-477.amzn2022 amazonlinux 24 k perl-parent noarch 1:0.238-458.amzn2022 amazonlinux 16 k perl-podlators noarch 1:4.14-458.amzn2022 amazonlinux 114 k perl-subs noarch 1.03-477.amzn2022 amazonlinux 23 k perl-vars noarch 1.05-477.amzn2022 amazonlinux 24 k Transaction Summary ================================================================================================================================================================================== Install 51 Packages Total download size: 64 M Installed size: 357 M Is this ok [y/N]: y Downloading Packages: (1/51): perl-Fcntl-1.13-477.amzn2022.x86_64.rpm 75 kB/s | 32 kB 00:00 (2/51): perl-IO-1.43-477.amzn2022.x86_64.rpm 213 kB/s | 99 kB 00:00 (3/51): perl-Errno-1.30-477.amzn2022.x86_64.rpm 522 kB/s | 26 kB 00:00 (4/51): perl-Scalar-List-Utils-1.56-459.amzn2022.x86_64.rpm 1.0 MB/s | 73 kB 00:00 (5/51): perl-libs-5.32.1-477.amzn2022.x86_64.rpm 3.8 MB/s | 2.1 MB 00:00 (6/51): perl-Storable-3.21-458.amzn2022.x86_64.rpm 1.2 MB/s | 98 kB 00:00 (7/51): perl-MIME-Base64-3.16-2.amzn2022.x86_64.rpm 475 kB/s | 32 kB 00:00 (8/51): perl-PathTools-3.78-459.amzn2022.x86_64.rpm 1.6 MB/s | 87 kB 00:00 (9/51): perl-interpreter-5.32.1-477.amzn2022.x86_64.rpm 1.3 MB/s | 83 kB 00:00 (10/51): perl-mro-1.23-477.amzn2022.x86_64.rpm 1.0 MB/s | 40 kB 00:00 (11/51): perl-Socket-2.032-1.amzn2022.x86_64.rpm 1.2 MB/s | 56 kB 00:00 (12/51): perl-Encode-3.15-462.amzn2022.x86_64.rpm 19 MB/s | 1.7 MB 00:00 (13/51): perl-POSIX-1.94-477.amzn2022.x86_64.rpm 1.5 MB/s | 110 kB 00:00 (14/51): perl-DynaLoader-1.47-477.amzn2022.x86_64.rpm 429 kB/s | 38 kB 00:00 (15/51): perl-File-Basename-2.85-477.amzn2022.noarch.rpm 918 kB/s | 29 kB 00:00 (16/51): libaio-0.3.111-11.amzn2022.x86_64.rpm 356 kB/s | 25 kB 00:00 (17/51): perl-Text-Tabs+Wrap-2021.0726-1.amzn2022.noarch.rpm 457 kB/s | 23 kB 00:00 (18/51): perl-Carp-1.50-458.amzn2022.noarch.rpm 544 kB/s | 30 kB 00:00 (19/51): perl-overload-1.31-477.amzn2022.noarch.rpm 1.4 MB/s | 57 kB 00:00 (20/51): perl-vars-1.05-477.amzn2022.noarch.rpm 386 kB/s | 24 kB 00:00 (21/51): perl-podlators-4.14-458.amzn2022.noarch.rpm 1.0 MB/s | 114 kB 00:00 (22/51): perl-Pod-Usage-2.01-2.amzn2022.noarch.rpm 734 kB/s | 42 kB 00:00 (23/51): perl-parent-0.238-458.amzn2022.noarch.rpm 375 kB/s | 16 kB 00:00 (24/51): perl-File-stat-1.09-477.amzn2022.noarch.rpm 787 kB/s | 29 kB 00:00 (25/51): perl-Getopt-Long-2.52-2.amzn2022.noarch.rpm 1.1 MB/s | 62 kB 00:00 (26/51): perl-SelectSaver-1.02-477.amzn2022.noarch.rpm 492 kB/s | 23 kB 00:00 (27/51): perl-Symbol-1.08-477.amzn2022.noarch.rpm 776 kB/s | 26 kB 00:00 (28/51): perl-File-Temp-0.231.100-2.amzn2022.noarch.rpm 1.8 MB/s | 62 kB 00:00 (29/51): perl-Pod-Perldoc-3.28.01-459.amzn2022.noarch.rpm 1.2 MB/s | 86 kB 00:00 (30/51): perl-Pod-Simple-3.42-2.amzn2022.noarch.rpm 3.3 MB/s | 217 kB 00:00 (31/51): perl-File-Path-2.18-2.amzn2022.noarch.rpm 1.3 MB/s | 37 kB 00:00 (32/51): perl-overloading-0.02-477.amzn2022.noarch.rpm 522 kB/s | 24 kB 00:00 (33/51): perl-Time-Local-1.300-5.amzn2022.noarch.rpm 688 kB/s | 35 kB 00:00 (34/51): perl-Text-ParseWords-3.30-458.amzn2022.noarch.rpm 375 kB/s | 17 kB 00:00 (35/51): perl-HTTP-Tiny-0.078-1.amzn2022.noarch.rpm 1.4 MB/s | 56 kB 00:00 (36/51): perl-constant-1.33-459.amzn2022.noarch.rpm 554 kB/s | 24 kB 00:00 (37/51): perl-Exporter-5.74-459.amzn2022.noarch.rpm 747 kB/s | 33 kB 00:00 (38/51): perl-subs-1.03-477.amzn2022.noarch.rpm 365 kB/s | 23 kB 00:00 (39/51): perl-IPC-Open3-1.21-477.amzn2022.noarch.rpm 929 kB/s | 34 kB 00:00 (40/51): perl-Term-ANSIColor-5.01-459.amzn2022.noarch.rpm 1.3 MB/s | 50 kB 00:00 (41/51): perl-if-0.60.800-477.amzn2022.noarch.rpm 689 kB/s | 25 kB 00:00 (42/51): perl-Class-Struct-0.66-477.amzn2022.noarch.rpm 902 kB/s | 34 kB 00:00 (43/51): perl-Getopt-Std-1.12-477.amzn2022.noarch.rpm 649 kB/s | 27 kB 00:00 (44/51): perl-Pod-Escapes-1.07-458.amzn2022.noarch.rpm 466 kB/s | 21 kB 00:00 (45/51): perl-Term-Cap-1.17-458.amzn2022.noarch.rpm 655 kB/s | 23 kB 00:00 (46/51): mysql-community-client-8.0.32-1.el9.x86_64.rpm 48 MB/s | 3.9 MB 00:00 (47/51): mysql-community-client-plugins-8.0.32-1.el9.x86_64.rpm 16 MB/s | 1.4 MB 00:00 (48/51): mysql-community-common-8.0.32-1.el9.x86_64.rpm 8.6 MB/s | 544 kB 00:00 (49/51): mysql-community-icu-data-files-8.0.32-1.el9.x86_64.rpm 67 MB/s | 2.2 MB 00:00 (50/51): mysql-community-libs-8.0.32-1.el9.x86_64.rpm 30 MB/s | 1.5 MB 00:00 (51/51): mysql-community-server-8.0.32-1.el9.x86_64.rpm 117 MB/s | 49 MB 00:00 ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Total 35 MB/s | 64 MB 00:01 MySQL 8.0 Community Server 1.5 MB/s | 3.1 kB 00:00 Importing GPG key 0x3A79BD29: Userid : "MySQL Release Engineering <mysql-build@oss.oracle.com>" Fingerprint: 859B E8D7 C586 F538 430B 19C2 467B 942D 3A79 BD29 From : /etc/pki/rpm-gpg/RPM-GPG-KEY-mysql-2022 Is this ok [y/N]: y Key imported successfully Running transaction check Transaction check succeeded. Running transaction test Transaction test succeeded. Running transaction Preparing : 1/1 Installing : perl-Text-Tabs+Wrap-2021.0726-1.amzn2022.noarch 1/51 Installing : perl-File-Path-2.18-2.amzn2022.noarch 2/51 Installing : perl-Time-Local-2:1.300-5.amzn2022.noarch 3/51 Installing : perl-if-0.60.800-477.amzn2022.noarch 4/51 Installing : perl-Pod-Escapes-1:1.07-458.amzn2022.noarch 5/51 Installing : perl-subs-1.03-477.amzn2022.noarch 6/51 Installing : perl-POSIX-1.94-477.amzn2022.x86_64 7/51 Installing : perl-Term-ANSIColor-5.01-459.amzn2022.noarch 8/51 Installing : perl-File-Temp-1:0.231.100-2.amzn2022.noarch 9/51 Installing : perl-HTTP-Tiny-0.078-1.amzn2022.noarch 10/51 Installing : perl-Class-Struct-0.66-477.amzn2022.noarch 11/51 Installing : perl-Term-Cap-1.17-458.amzn2022.noarch 12/51 Installing : perl-Pod-Simple-1:3.42-2.amzn2022.noarch 13/51 Installing : perl-IPC-Open3-1.21-477.amzn2022.noarch 14/51 Installing : perl-Socket-4:2.032-1.amzn2022.x86_64 15/51 Installing : perl-SelectSaver-1.02-477.amzn2022.noarch 16/51 Installing : perl-Symbol-1.08-477.amzn2022.noarch 17/51 Installing : perl-File-stat-1.09-477.amzn2022.noarch 18/51 Installing : perl-podlators-1:4.14-458.amzn2022.noarch 19/51 Installing : perl-Pod-Perldoc-3.28.01-459.amzn2022.noarch 20/51 Installing : perl-mro-1.23-477.amzn2022.x86_64 21/51 Installing : perl-overloading-0.02-477.amzn2022.noarch 22/51 Installing : perl-Text-ParseWords-3.30-458.amzn2022.noarch 23/51 Installing : perl-IO-1.43-477.amzn2022.x86_64 24/51 Installing : perl-Pod-Usage-4:2.01-2.amzn2022.noarch 25/51 Installing : perl-Fcntl-1.13-477.amzn2022.x86_64 26/51 Installing : perl-parent-1:0.238-458.amzn2022.noarch 27/51 Installing : perl-MIME-Base64-3.16-2.amzn2022.x86_64 28/51 Installing : perl-Errno-1.30-477.amzn2022.x86_64 29/51 Installing : perl-Scalar-List-Utils-4:1.56-459.amzn2022.x86_64 30/51 Installing : perl-File-Basename-2.85-477.amzn2022.noarch 31/51 Installing : perl-vars-1.05-477.amzn2022.noarch 32/51 Installing : perl-overload-1.31-477.amzn2022.noarch 33/51 Installing : perl-constant-1.33-459.amzn2022.noarch 34/51 Installing : perl-Getopt-Std-1.12-477.amzn2022.noarch 35/51 Installing : perl-Storable-1:3.21-458.amzn2022.x86_64 36/51 Installing : perl-Getopt-Long-1:2.52-2.amzn2022.noarch 37/51 Installing : perl-DynaLoader-1.47-477.amzn2022.x86_64 38/51 Installing : perl-PathTools-3.78-459.amzn2022.x86_64 39/51 Installing : perl-Carp-1.50-458.amzn2022.noarch 40/51 Installing : perl-Exporter-5.74-459.amzn2022.noarch 41/51 Installing : perl-Encode-4:3.15-462.amzn2022.x86_64 42/51 Installing : perl-libs-4:5.32.1-477.amzn2022.x86_64 43/51 Installing : perl-interpreter-4:5.32.1-477.amzn2022.x86_64 44/51 Installing : mysql-community-common-8.0.32-1.el9.x86_64 45/51 Installing : mysql-community-client-plugins-8.0.32-1.el9.x86_64 46/51 Installing : mysql-community-libs-8.0.32-1.el9.x86_64 47/51 Running scriptlet: mysql-community-libs-8.0.32-1.el9.x86_64 47/51 Installing : mysql-community-client-8.0.32-1.el9.x86_64 48/51 Installing : mysql-community-icu-data-files-8.0.32-1.el9.x86_64 49/51 Installing : libaio-0.3.111-11.amzn2022.x86_64 50/51 Running scriptlet: mysql-community-server-8.0.32-1.el9.x86_64 51/51 Installing : mysql-community-server-8.0.32-1.el9.x86_64 51/51 Running scriptlet: mysql-community-server-8.0.32-1.el9.x86_64 51/51 Verifying : perl-Fcntl-1.13-477.amzn2022.x86_64 1/51 Verifying : perl-IO-1.43-477.amzn2022.x86_64 2/51 Verifying : perl-libs-4:5.32.1-477.amzn2022.x86_64 3/51 Verifying : perl-Errno-1.30-477.amzn2022.x86_64 4/51 Verifying : perl-Scalar-List-Utils-4:1.56-459.amzn2022.x86_64 5/51 Verifying : perl-Storable-1:3.21-458.amzn2022.x86_64 6/51 Verifying : perl-MIME-Base64-3.16-2.amzn2022.x86_64 7/51 Verifying : perl-interpreter-4:5.32.1-477.amzn2022.x86_64 8/51 Verifying : perl-PathTools-3.78-459.amzn2022.x86_64 9/51 Verifying : perl-mro-1.23-477.amzn2022.x86_64 10/51 Verifying : perl-Socket-4:2.032-1.amzn2022.x86_64 11/51 Verifying : perl-Encode-4:3.15-462.amzn2022.x86_64 12/51 Verifying : perl-POSIX-1.94-477.amzn2022.x86_64 13/51 Verifying : perl-DynaLoader-1.47-477.amzn2022.x86_64 14/51 Verifying : libaio-0.3.111-11.amzn2022.x86_64 15/51 Verifying : perl-File-Basename-2.85-477.amzn2022.noarch 16/51 Verifying : perl-Carp-1.50-458.amzn2022.noarch 17/51 Verifying : perl-Text-Tabs+Wrap-2021.0726-1.amzn2022.noarch 18/51 Verifying : perl-podlators-1:4.14-458.amzn2022.noarch 19/51 Verifying : perl-overload-1.31-477.amzn2022.noarch 20/51 Verifying : perl-vars-1.05-477.amzn2022.noarch 21/51 Verifying : perl-Pod-Usage-4:2.01-2.amzn2022.noarch 22/51 Verifying : perl-parent-1:0.238-458.amzn2022.noarch 23/51 Verifying : perl-Getopt-Long-1:2.52-2.amzn2022.noarch 24/51 Verifying : perl-File-stat-1.09-477.amzn2022.noarch 25/51 Verifying : perl-SelectSaver-1.02-477.amzn2022.noarch 26/51 Verifying : perl-Symbol-1.08-477.amzn2022.noarch 27/51 Verifying : perl-Pod-Perldoc-3.28.01-459.amzn2022.noarch 28/51 Verifying : perl-Pod-Simple-1:3.42-2.amzn2022.noarch 29/51 Verifying : perl-File-Temp-1:0.231.100-2.amzn2022.noarch 30/51 Verifying : perl-overloading-0.02-477.amzn2022.noarch 31/51 Verifying : perl-File-Path-2.18-2.amzn2022.noarch 32/51 Verifying : perl-Time-Local-2:1.300-5.amzn2022.noarch 33/51 Verifying : perl-Text-ParseWords-3.30-458.amzn2022.noarch 34/51 Verifying : perl-HTTP-Tiny-0.078-1.amzn2022.noarch 35/51 Verifying : perl-subs-1.03-477.amzn2022.noarch 36/51 Verifying : perl-constant-1.33-459.amzn2022.noarch 37/51 Verifying : perl-Exporter-5.74-459.amzn2022.noarch 38/51 Verifying : perl-IPC-Open3-1.21-477.amzn2022.noarch 39/51 Verifying : perl-Term-ANSIColor-5.01-459.amzn2022.noarch 40/51 Verifying : perl-if-0.60.800-477.amzn2022.noarch 41/51 Verifying : perl-Getopt-Std-1.12-477.amzn2022.noarch 42/51 Verifying : perl-Class-Struct-0.66-477.amzn2022.noarch 43/51 Verifying : perl-Pod-Escapes-1:1.07-458.amzn2022.noarch 44/51 Verifying : perl-Term-Cap-1.17-458.amzn2022.noarch 45/51 Verifying : mysql-community-client-8.0.32-1.el9.x86_64 46/51 Verifying : mysql-community-client-plugins-8.0.32-1.el9.x86_64 47/51 Verifying : mysql-community-common-8.0.32-1.el9.x86_64 48/51 Verifying : mysql-community-icu-data-files-8.0.32-1.el9.x86_64 49/51 Verifying : mysql-community-libs-8.0.32-1.el9.x86_64 50/51 Verifying : mysql-community-server-8.0.32-1.el9.x86_64 51/51 ================================================================================================================================================================================== WARNING: A newer release of "Amazon Linux" is available. Available Versions: Version 2022.0.20230118: Run the following command to update to 2022.0.20230118: dnf update --releasever=2022.0.20230118 Release notes: https://docs.aws.amazon.com/linux/al2022/release-notes/relnotes.html ================================================================================================================================================================================== Installed: libaio-0.3.111-11.amzn2022.x86_64 mysql-community-client-8.0.32-1.el9.x86_64 mysql-community-client-plugins-8.0.32-1.el9.x86_64 mysql-community-common-8.0.32-1.el9.x86_64 mysql-community-icu-data-files-8.0.32-1.el9.x86_64 mysql-community-libs-8.0.32-1.el9.x86_64 mysql-community-server-8.0.32-1.el9.x86_64 perl-Carp-1.50-458.amzn2022.noarch perl-Class-Struct-0.66-477.amzn2022.noarch perl-DynaLoader-1.47-477.amzn2022.x86_64 perl-Encode-4:3.15-462.amzn2022.x86_64 perl-Errno-1.30-477.amzn2022.x86_64 perl-Exporter-5.74-459.amzn2022.noarch perl-Fcntl-1.13-477.amzn2022.x86_64 perl-File-Basename-2.85-477.amzn2022.noarch perl-File-Path-2.18-2.amzn2022.noarch perl-File-Temp-1:0.231.100-2.amzn2022.noarch perl-File-stat-1.09-477.amzn2022.noarch perl-Getopt-Long-1:2.52-2.amzn2022.noarch perl-Getopt-Std-1.12-477.amzn2022.noarch perl-HTTP-Tiny-0.078-1.amzn2022.noarch perl-IO-1.43-477.amzn2022.x86_64 perl-IPC-Open3-1.21-477.amzn2022.noarch perl-MIME-Base64-3.16-2.amzn2022.x86_64 perl-POSIX-1.94-477.amzn2022.x86_64 perl-PathTools-3.78-459.amzn2022.x86_64 perl-Pod-Escapes-1:1.07-458.amzn2022.noarch perl-Pod-Perldoc-3.28.01-459.amzn2022.noarch perl-Pod-Simple-1:3.42-2.amzn2022.noarch perl-Pod-Usage-4:2.01-2.amzn2022.noarch perl-Scalar-List-Utils-4:1.56-459.amzn2022.x86_64 perl-SelectSaver-1.02-477.amzn2022.noarch perl-Socket-4:2.032-1.amzn2022.x86_64 perl-Storable-1:3.21-458.amzn2022.x86_64 perl-Symbol-1.08-477.amzn2022.noarch perl-Term-ANSIColor-5.01-459.amzn2022.noarch perl-Term-Cap-1.17-458.amzn2022.noarch perl-Text-ParseWords-3.30-458.amzn2022.noarch perl-Text-Tabs+Wrap-2021.0726-1.amzn2022.noarch perl-Time-Local-2:1.300-5.amzn2022.noarch perl-constant-1.33-459.amzn2022.noarch perl-if-0.60.800-477.amzn2022.noarch perl-interpreter-4:5.32.1-477.amzn2022.x86_64 perl-libs-4:5.32.1-477.amzn2022.x86_64 perl-mro-1.23-477.amzn2022.x86_64 perl-overload-1.31-477.amzn2022.noarch perl-overloading-0.02-477.amzn2022.noarch perl-parent-1:0.238-458.amzn2022.noarch perl-podlators-1:4.14-458.amzn2022.noarch perl-subs-1.03-477.amzn2022.noarch perl-vars-1.05-477.amzn2022.noarch Complete!
↑MySQLサーバーをインストール(なんかAL2022についてアップデートできる的な表示が含まれてた)
# mysql --version mysql Ver 8.0.32 for Linux on x86_64 (MySQL Community Server - GPL) # systemctl is-enabled mysqld enabled # systemctl start mysqld
↑バージョン確認
自動起動の設定はインストール直後の状態でされていたためそのまま起動
# cat /var/log/mysqld.log | grep root 2023-03-12T04:36:22.998380Z 6 [Note] [MY-010454] [Server] A temporary password is generated for root@localhost: @@@@@@@@@@@@
↑初回起動時のrootユーザーのパスワードを確認
# mysql_secure_installation Securing the MySQL server deployment. Enter password for user root: ←ここで初回起動時のrootユーザーのパスワードを入力 The existing password for the user account root has expired. Please set a new password. New password: ←半角英数字+記号+8桁以上のパスワードを入力 Re-enter new password: ←半角英数字+記号+8桁以上のパスワードを入力 The 'validate_password' component is installed on the server. The subsequent steps will run with the existing configuration of the component. Using existing password for root. Estimated strength of the password: 100 Change the password for root ? ((Press y|Y for Yes, any other key for No) : N ... skipping. By default, a MySQL installation has an anonymous user, allowing anyone to log into MySQL without having to have a user account created for them. This is intended only for testing, and to make the installation go a bit smoother. You should remove them before moving into a production environment. Remove anonymous users? (Press y|Y for Yes, any other key for No) : Y Success. Normally, root should only be allowed to connect from 'localhost'. This ensures that someone cannot guess at the root password from the network. Disallow root login remotely? (Press y|Y for Yes, any other key for No) : Y Success. By default, MySQL comes with a database named 'test' that anyone can access. This is also intended only for testing, and should be removed before moving into a production environment. Remove test database and access to it? (Press y|Y for Yes, any other key for No) : Y - Dropping test database... Success. - Removing privileges on test database... Success. Reloading the privilege tables will ensure that all changes made so far will take effect immediately. Reload privilege tables now? (Press y|Y for Yes, any other key for No) : Y Success. All done!
↑mysql_secure_installationで初期設定
# mysql -u root -p Enter password: ←mysql_secure_installationで設定したrootパスワードを入力 Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 12 Server version: 8.0.32 MySQL Community Server - GPL Copyright (c) 2000, 2023, Oracle and/or its affiliates. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> show databases; +--------------------+ | Database | +--------------------+ | information_schema | | mysql | | performance_schema | | sys | +--------------------+ 4 rows in set (0.00 sec) mysql> show variables like '%char%'; +--------------------------------------+--------------------------------+ | Variable_name | Value | +--------------------------------------+--------------------------------+ | character_set_client | utf8mb4 | | character_set_connection | utf8mb4 | | character_set_database | utf8mb4 | | character_set_filesystem | binary | | character_set_results | utf8mb4 | | character_set_server | utf8mb4 | | character_set_system | utf8mb3 | | character_sets_dir | /usr/share/mysql-8.0/charsets/ | | validate_password.special_char_count | 1 | +--------------------------------------+--------------------------------+ 9 rows in set (0.00 sec) mysql> show variables like 'validate_password%'; +--------------------------------------+--------+ | Variable_name | Value | +--------------------------------------+--------+ | validate_password.check_user_name | ON | | validate_password.dictionary_file | | | validate_password.length | 8 | | validate_password.mixed_case_count | 1 | | validate_password.number_count | 1 | | validate_password.policy | MEDIUM | | validate_password.special_char_count | 1 | +--------------------------------------+--------+ 7 rows in set (0.01 sec) mysql> select Host, User, plugin from mysql.user; +-----------+------------------+-----------------------+ | Host | User | plugin | +-----------+------------------+-----------------------+ | localhost | mysql.infoschema | caching_sha2_password | | localhost | mysql.session | caching_sha2_password | | localhost | mysql.sys | caching_sha2_password | | localhost | root | caching_sha2_password | +-----------+------------------+-----------------------+ 4 rows in set (0.00 sec)
↑MySQLサーバーに接続していろいろ確認
まとめ
今回インストールしたものバージョンについて以下の通りとなりました。
Java | openjdk version “11.0.14.1” 2022-02-08 |
---|---|
httpd | Apache/2.4.53 (Amazon Linux) |
tomcat | Apache Tomcat/9.0.59 |
MySQL | mysql Ver 8.0.32 for Linux on x86_64 (MySQL Community Server – GPL) |
openssl | OpenSSL 3.0.3 3 May 2022 (Library: OpenSSL 3.0.3 3 May 2022) |
※opensslはインストールしたわけではないけど重要なので記載
- Javaはopenjdk11,17がインストールできる
- httpdは2.4がインストールできる
- tomcatは9がインストールできる
- MySQLはRHEL8,9用のリポジトリを追加することでインストールできる
- OpenSSLのバージョンは3.0.3
※(追記)OpenSSLとの依存解決が取れないMySQLリポジトリを追加した場合
一通りの検証が済んだので、RHEL9のリポジトリを削除してRHEL8用のリポジトリを追加してMySQLサーバーをインストールしてみる。
# dnf remove mysql ~~~省略~~~ # rm -rf /var/lib/mysql/ # rpm -qa | grep -i mysql mysql80-community-release-el9-1.noarch # rpm -e mysql80-community-release-el9-1.noarch
↑まずはインストール済みのMySQLサーバーを削除
/var/lib/mysql配下のデータは残るので手動で削除
# dnf localinstall https://dev.mysql.com/get/mysql80-community-release-el8-4.noarch.rpm Last metadata expiration check: 1:32:21 ago on Sun 12 Mar 2023 12:37:21 PM JST. mysql80-community-release-el8-4.noarch.rpm 42 kB/s | 14 kB 00:00 Dependencies resolved. ================================================================================================================================================================================== Package Architecture Version Repository Size ================================================================================================================================================================================== Installing: mysql80-community-release noarch el8-4 @commandline 14 k Transaction Summary ================================================================================================================================================================================== Install 1 Package Total size: 14 k Installed size: 8.6 k Is this ok [y/N]: y Downloading Packages: Running transaction check Transaction check succeeded. Running transaction test Transaction test succeeded. Running transaction Preparing : 1/1 Installing : mysql80-community-release-el8-4.noarch 1/1 Verifying : mysql80-community-release-el8-4.noarch 1/1 ================================================================================================================================================================================== WARNING: A newer release of "Amazon Linux" is available. Available Versions: Version 2022.0.20230118: Run the following command to update to 2022.0.20230118: dnf update --releasever=2022.0.20230118 Release notes: https://docs.aws.amazon.com/linux/al2022/release-notes/relnotes.html ================================================================================================================================================================================== Installed: mysql80-community-release-el8-4.noarch Complete!
↑RHEL8用のリポジトリを追加
# dnf install mysql-community-server Last metadata expiration check: 0:00:15 ago on Sun 12 Mar 2023 02:11:09 PM JST. Dependencies resolved. ================================================================================================================================================================================== Package Architecture Version Repository Size ================================================================================================================================================================================== Installing: mysql-community-server x86_64 8.0.32-1.el8 mysql80-community 64 M Installing dependencies: libaio x86_64 0.3.111-11.amzn2022 amazonlinux 25 k mysql-community-client x86_64 8.0.32-1.el8 mysql80-community 16 M mysql-community-client-plugins x86_64 8.0.32-1.el8 mysql80-community 2.5 M mysql-community-common x86_64 8.0.32-1.el8 mysql80-community 656 k mysql-community-icu-data-files x86_64 8.0.32-1.el8 mysql80-community 2.1 M mysql-community-libs x86_64 8.0.32-1.el8 mysql80-community 1.5 M openssl1.1 x86_64 1:1.1.1l-2.amzn2022.0.2 amazonlinux 1.5 M perl-Carp noarch 1.50-458.amzn2022 amazonlinux 30 k perl-Class-Struct noarch 0.66-477.amzn2022 amazonlinux 34 k perl-DynaLoader x86_64 1.47-477.amzn2022 amazonlinux 38 k perl-Encode x86_64 4:3.15-462.amzn2022 amazonlinux 1.7 M perl-Errno x86_64 1.30-477.amzn2022 amazonlinux 26 k perl-Exporter noarch 5.74-459.amzn2022 amazonlinux 33 k perl-Fcntl x86_64 1.13-477.amzn2022 amazonlinux 32 k perl-File-Basename noarch 2.85-477.amzn2022 amazonlinux 29 k perl-File-Path noarch 2.18-2.amzn2022 amazonlinux 37 k perl-File-Temp noarch 1:0.231.100-2.amzn2022 amazonlinux 62 k perl-File-stat noarch 1.09-477.amzn2022 amazonlinux 29 k perl-Getopt-Long noarch 1:2.52-2.amzn2022 amazonlinux 62 k perl-Getopt-Std noarch 1.12-477.amzn2022 amazonlinux 27 k perl-HTTP-Tiny noarch 0.078-1.amzn2022 amazonlinux 56 k perl-IO x86_64 1.43-477.amzn2022 amazonlinux 99 k perl-IPC-Open3 noarch 1.21-477.amzn2022 amazonlinux 34 k perl-MIME-Base64 x86_64 3.16-2.amzn2022 amazonlinux 32 k perl-POSIX x86_64 1.94-477.amzn2022 amazonlinux 110 k perl-PathTools x86_64 3.78-459.amzn2022 amazonlinux 87 k perl-Pod-Escapes noarch 1:1.07-458.amzn2022 amazonlinux 21 k perl-Pod-Perldoc noarch 3.28.01-459.amzn2022 amazonlinux 86 k perl-Pod-Simple noarch 1:3.42-2.amzn2022 amazonlinux 217 k perl-Pod-Usage noarch 4:2.01-2.amzn2022 amazonlinux 42 k perl-Scalar-List-Utils x86_64 4:1.56-459.amzn2022 amazonlinux 73 k perl-SelectSaver noarch 1.02-477.amzn2022 amazonlinux 23 k perl-Socket x86_64 4:2.032-1.amzn2022 amazonlinux 56 k perl-Storable x86_64 1:3.21-458.amzn2022 amazonlinux 98 k perl-Symbol noarch 1.08-477.amzn2022 amazonlinux 26 k perl-Term-ANSIColor noarch 5.01-459.amzn2022 amazonlinux 50 k perl-Term-Cap noarch 1.17-458.amzn2022 amazonlinux 23 k perl-Text-ParseWords noarch 3.30-458.amzn2022 amazonlinux 17 k perl-Text-Tabs+Wrap noarch 2021.0726-1.amzn2022 amazonlinux 23 k perl-Time-Local noarch 2:1.300-5.amzn2022 amazonlinux 35 k perl-constant noarch 1.33-459.amzn2022 amazonlinux 24 k perl-if noarch 0.60.800-477.amzn2022 amazonlinux 25 k perl-interpreter x86_64 4:5.32.1-477.amzn2022 amazonlinux 83 k perl-libs x86_64 4:5.32.1-477.amzn2022 amazonlinux 2.1 M perl-mro x86_64 1.23-477.amzn2022 amazonlinux 40 k perl-overload noarch 1.31-477.amzn2022 amazonlinux 57 k perl-overloading noarch 0.02-477.amzn2022 amazonlinux 24 k perl-parent noarch 1:0.238-458.amzn2022 amazonlinux 16 k perl-podlators noarch 1:4.14-458.amzn2022 amazonlinux 114 k perl-subs noarch 1.03-477.amzn2022 amazonlinux 23 k perl-vars noarch 1.05-477.amzn2022 amazonlinux 24 k Transaction Summary ================================================================================================================================================================================== Install 52 Packages Total download size: 94 M Installed size: 435 M Is this ok [y/N]: y Downloading Packages: (1/52): perl-Fcntl-1.13-477.amzn2022.x86_64.rpm 88 kB/s | 32 kB 00:00 (2/52): perl-Errno-1.30-477.amzn2022.x86_64.rpm 610 kB/s | 26 kB 00:00 (3/52): perl-IO-1.43-477.amzn2022.x86_64.rpm 237 kB/s | 99 kB 00:00 (4/52): perl-libs-5.32.1-477.amzn2022.x86_64.rpm 4.4 MB/s | 2.1 MB 00:00 (5/52): perl-Storable-3.21-458.amzn2022.x86_64.rpm 1.4 MB/s | 98 kB 00:00 (6/52): perl-Scalar-List-Utils-1.56-459.amzn2022.x86_64.rpm 854 kB/s | 73 kB 00:00 (7/52): perl-MIME-Base64-3.16-2.amzn2022.x86_64.rpm 857 kB/s | 32 kB 00:00 (8/52): perl-interpreter-5.32.1-477.amzn2022.x86_64.rpm 1.4 MB/s | 83 kB 00:00 (9/52): openssl1.1-1.1.1l-2.amzn2022.0.2.x86_64.rpm 12 MB/s | 1.5 MB 00:00 (10/52): perl-PathTools-3.78-459.amzn2022.x86_64.rpm 1.0 MB/s | 87 kB 00:00 (11/52): perl-mro-1.23-477.amzn2022.x86_64.rpm 809 kB/s | 40 kB 00:00 (12/52): perl-Socket-2.032-1.amzn2022.x86_64.rpm 1.8 MB/s | 56 kB 00:00 (13/52): perl-POSIX-1.94-477.amzn2022.x86_64.rpm 1.7 MB/s | 110 kB 00:00 (14/52): perl-DynaLoader-1.47-477.amzn2022.x86_64.rpm 613 kB/s | 38 kB 00:00 (15/52): libaio-0.3.111-11.amzn2022.x86_64.rpm 857 kB/s | 25 kB 00:00 (16/52): perl-Encode-3.15-462.amzn2022.x86_64.rpm 13 MB/s | 1.7 MB 00:00 (17/52): perl-File-Basename-2.85-477.amzn2022.noarch.rpm 697 kB/s | 29 kB 00:00 (18/52): perl-Carp-1.50-458.amzn2022.noarch.rpm 783 kB/s | 30 kB 00:00 (19/52): perl-Text-Tabs+Wrap-2021.0726-1.amzn2022.noarch.rpm 849 kB/s | 23 kB 00:00 (20/52): perl-overload-1.31-477.amzn2022.noarch.rpm 1.9 MB/s | 57 kB 00:00 (21/52): perl-Pod-Usage-2.01-2.amzn2022.noarch.rpm 1.4 MB/s | 42 kB 00:00 (22/52): perl-podlators-4.14-458.amzn2022.noarch.rpm 1.6 MB/s | 114 kB 00:00 (23/52): perl-vars-1.05-477.amzn2022.noarch.rpm 451 kB/s | 24 kB 00:00 (24/52): perl-parent-0.238-458.amzn2022.noarch.rpm 756 kB/s | 16 kB 00:00 (25/52): perl-Getopt-Long-2.52-2.amzn2022.noarch.rpm 1.6 MB/s | 62 kB 00:00 (26/52): perl-SelectSaver-1.02-477.amzn2022.noarch.rpm 472 kB/s | 23 kB 00:00 (27/52): perl-File-stat-1.09-477.amzn2022.noarch.rpm 527 kB/s | 29 kB 00:00 (28/52): perl-Symbol-1.08-477.amzn2022.noarch.rpm 935 kB/s | 26 kB 00:00 (29/52): perl-File-Temp-0.231.100-2.amzn2022.noarch.rpm 1.7 MB/s | 62 kB 00:00 (30/52): perl-Pod-Simple-3.42-2.amzn2022.noarch.rpm 3.6 MB/s | 217 kB 00:00 (31/52): perl-Pod-Perldoc-3.28.01-459.amzn2022.noarch.rpm 1.3 MB/s | 86 kB 00:00 (32/52): perl-overloading-0.02-477.amzn2022.noarch.rpm 654 kB/s | 24 kB 00:00 (33/52): perl-Time-Local-1.300-5.amzn2022.noarch.rpm 1.3 MB/s | 35 kB 00:00 (34/52): perl-File-Path-2.18-2.amzn2022.noarch.rpm 1.0 MB/s | 37 kB 00:00 (35/52): perl-HTTP-Tiny-0.078-1.amzn2022.noarch.rpm 1.5 MB/s | 56 kB 00:00 (36/52): perl-Text-ParseWords-3.30-458.amzn2022.noarch.rpm 310 kB/s | 17 kB 00:00 (37/52): perl-subs-1.03-477.amzn2022.noarch.rpm 561 kB/s | 23 kB 00:00 (38/52): perl-constant-1.33-459.amzn2022.noarch.rpm 767 kB/s | 24 kB 00:00 (39/52): perl-IPC-Open3-1.21-477.amzn2022.noarch.rpm 1.2 MB/s | 34 kB 00:00 (40/52): perl-Exporter-5.74-459.amzn2022.noarch.rpm 865 kB/s | 33 kB 00:00 (41/52): perl-Term-ANSIColor-5.01-459.amzn2022.noarch.rpm 2.0 MB/s | 50 kB 00:00 (42/52): perl-Getopt-Std-1.12-477.amzn2022.noarch.rpm 964 kB/s | 27 kB 00:00 (43/52): perl-if-0.60.800-477.amzn2022.noarch.rpm 664 kB/s | 25 kB 00:00 (44/52): perl-Class-Struct-0.66-477.amzn2022.noarch.rpm 956 kB/s | 34 kB 00:00 (45/52): perl-Term-Cap-1.17-458.amzn2022.noarch.rpm 783 kB/s | 23 kB 00:00 (46/52): perl-Pod-Escapes-1.07-458.amzn2022.noarch.rpm 598 kB/s | 21 kB 00:00 (47/52): mysql-community-common-8.0.32-1.el8.x86_64.rpm 18 MB/s | 656 kB 00:00 (48/52): mysql-community-client-plugins-8.0.32-1.el8.x86_64.rpm 30 MB/s | 2.5 MB 00:00 (49/52): mysql-community-icu-data-files-8.0.32-1.el8.x86_64.rpm 25 MB/s | 2.1 MB 00:00 (50/52): mysql-community-libs-8.0.32-1.el8.x86_64.rpm 25 MB/s | 1.5 MB 00:00 (51/52): mysql-community-client-8.0.32-1.el8.x86_64.rpm 48 MB/s | 16 MB 00:00 (52/52): mysql-community-server-8.0.32-1.el8.x86_64.rpm 94 MB/s | 64 MB 00:00 ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Total 45 MB/s | 94 MB 00:02 Running transaction check Transaction check succeeded. Running transaction test Transaction test succeeded. Running transaction Preparing : 1/1 Installing : perl-Text-Tabs+Wrap-2021.0726-1.amzn2022.noarch 1/52 Installing : perl-File-Path-2.18-2.amzn2022.noarch 2/52 Installing : perl-Time-Local-2:1.300-5.amzn2022.noarch 3/52 Installing : perl-if-0.60.800-477.amzn2022.noarch 4/52 Installing : perl-Pod-Escapes-1:1.07-458.amzn2022.noarch 5/52 Installing : perl-subs-1.03-477.amzn2022.noarch 6/52 Installing : perl-POSIX-1.94-477.amzn2022.x86_64 7/52 Installing : perl-Term-ANSIColor-5.01-459.amzn2022.noarch 8/52 Installing : perl-File-Temp-1:0.231.100-2.amzn2022.noarch 9/52 Installing : perl-HTTP-Tiny-0.078-1.amzn2022.noarch 10/52 Installing : perl-Class-Struct-0.66-477.amzn2022.noarch 11/52 Installing : perl-Term-Cap-1.17-458.amzn2022.noarch 12/52 Installing : perl-Pod-Simple-1:3.42-2.amzn2022.noarch 13/52 Installing : perl-IPC-Open3-1.21-477.amzn2022.noarch 14/52 Installing : perl-Socket-4:2.032-1.amzn2022.x86_64 15/52 Installing : perl-SelectSaver-1.02-477.amzn2022.noarch 16/52 Installing : perl-Symbol-1.08-477.amzn2022.noarch 17/52 Installing : perl-File-stat-1.09-477.amzn2022.noarch 18/52 Installing : perl-podlators-1:4.14-458.amzn2022.noarch 19/52 Installing : perl-Pod-Perldoc-3.28.01-459.amzn2022.noarch 20/52 Installing : perl-mro-1.23-477.amzn2022.x86_64 21/52 Installing : perl-overloading-0.02-477.amzn2022.noarch 22/52 Installing : perl-Text-ParseWords-3.30-458.amzn2022.noarch 23/52 Installing : perl-IO-1.43-477.amzn2022.x86_64 24/52 Installing : perl-Pod-Usage-4:2.01-2.amzn2022.noarch 25/52 Installing : perl-Fcntl-1.13-477.amzn2022.x86_64 26/52 Installing : perl-parent-1:0.238-458.amzn2022.noarch 27/52 Installing : perl-MIME-Base64-3.16-2.amzn2022.x86_64 28/52 Installing : perl-Errno-1.30-477.amzn2022.x86_64 29/52 Installing : perl-Scalar-List-Utils-4:1.56-459.amzn2022.x86_64 30/52 Installing : perl-File-Basename-2.85-477.amzn2022.noarch 31/52 Installing : perl-vars-1.05-477.amzn2022.noarch 32/52 Installing : perl-overload-1.31-477.amzn2022.noarch 33/52 Installing : perl-constant-1.33-459.amzn2022.noarch 34/52 Installing : perl-Getopt-Std-1.12-477.amzn2022.noarch 35/52 Installing : perl-Storable-1:3.21-458.amzn2022.x86_64 36/52 Installing : perl-Getopt-Long-1:2.52-2.amzn2022.noarch 37/52 Installing : perl-DynaLoader-1.47-477.amzn2022.x86_64 38/52 Installing : perl-PathTools-3.78-459.amzn2022.x86_64 39/52 Installing : perl-Carp-1.50-458.amzn2022.noarch 40/52 Installing : perl-Exporter-5.74-459.amzn2022.noarch 41/52 Installing : perl-Encode-4:3.15-462.amzn2022.x86_64 42/52 Installing : perl-libs-4:5.32.1-477.amzn2022.x86_64 43/52 Installing : perl-interpreter-4:5.32.1-477.amzn2022.x86_64 44/52 Installing : openssl1.1-1:1.1.1l-2.amzn2022.0.2.x86_64 45/52 Installing : mysql-community-client-plugins-8.0.32-1.el8.x86_64 46/52 Installing : mysql-community-common-8.0.32-1.el8.x86_64 47/52 Installing : mysql-community-libs-8.0.32-1.el8.x86_64 48/52 Running scriptlet: mysql-community-libs-8.0.32-1.el8.x86_64 48/52 Installing : mysql-community-client-8.0.32-1.el8.x86_64 49/52 Installing : mysql-community-icu-data-files-8.0.32-1.el8.x86_64 50/52 Installing : libaio-0.3.111-11.amzn2022.x86_64 51/52 Running scriptlet: mysql-community-server-8.0.32-1.el8.x86_64 52/52 Installing : mysql-community-server-8.0.32-1.el8.x86_64 52/52 Running scriptlet: mysql-community-server-8.0.32-1.el8.x86_64 52/52 Verifying : perl-Fcntl-1.13-477.amzn2022.x86_64 1/52 Verifying : perl-IO-1.43-477.amzn2022.x86_64 2/52 Verifying : perl-libs-4:5.32.1-477.amzn2022.x86_64 3/52 Verifying : perl-Errno-1.30-477.amzn2022.x86_64 4/52 Verifying : perl-Scalar-List-Utils-4:1.56-459.amzn2022.x86_64 5/52 Verifying : perl-Storable-1:3.21-458.amzn2022.x86_64 6/52 Verifying : openssl1.1-1:1.1.1l-2.amzn2022.0.2.x86_64 7/52 Verifying : perl-MIME-Base64-3.16-2.amzn2022.x86_64 8/52 Verifying : perl-interpreter-4:5.32.1-477.amzn2022.x86_64 9/52 Verifying : perl-PathTools-3.78-459.amzn2022.x86_64 10/52 Verifying : perl-mro-1.23-477.amzn2022.x86_64 11/52 Verifying : perl-Socket-4:2.032-1.amzn2022.x86_64 12/52 Verifying : perl-Encode-4:3.15-462.amzn2022.x86_64 13/52 Verifying : perl-POSIX-1.94-477.amzn2022.x86_64 14/52 Verifying : perl-DynaLoader-1.47-477.amzn2022.x86_64 15/52 Verifying : libaio-0.3.111-11.amzn2022.x86_64 16/52 Verifying : perl-File-Basename-2.85-477.amzn2022.noarch 17/52 Verifying : perl-Carp-1.50-458.amzn2022.noarch 18/52 Verifying : perl-Text-Tabs+Wrap-2021.0726-1.amzn2022.noarch 19/52 Verifying : perl-podlators-1:4.14-458.amzn2022.noarch 20/52 Verifying : perl-overload-1.31-477.amzn2022.noarch 21/52 Verifying : perl-vars-1.05-477.amzn2022.noarch 22/52 Verifying : perl-Pod-Usage-4:2.01-2.amzn2022.noarch 23/52 Verifying : perl-parent-1:0.238-458.amzn2022.noarch 24/52 Verifying : perl-Getopt-Long-1:2.52-2.amzn2022.noarch 25/52 Verifying : perl-File-stat-1.09-477.amzn2022.noarch 26/52 Verifying : perl-SelectSaver-1.02-477.amzn2022.noarch 27/52 Verifying : perl-Symbol-1.08-477.amzn2022.noarch 28/52 Verifying : perl-Pod-Perldoc-3.28.01-459.amzn2022.noarch 29/52 Verifying : perl-Pod-Simple-1:3.42-2.amzn2022.noarch 30/52 Verifying : perl-File-Temp-1:0.231.100-2.amzn2022.noarch 31/52 Verifying : perl-overloading-0.02-477.amzn2022.noarch 32/52 Verifying : perl-File-Path-2.18-2.amzn2022.noarch 33/52 Verifying : perl-Time-Local-2:1.300-5.amzn2022.noarch 34/52 Verifying : perl-Text-ParseWords-3.30-458.amzn2022.noarch 35/52 Verifying : perl-HTTP-Tiny-0.078-1.amzn2022.noarch 36/52 Verifying : perl-subs-1.03-477.amzn2022.noarch 37/52 Verifying : perl-constant-1.33-459.amzn2022.noarch 38/52 Verifying : perl-Exporter-5.74-459.amzn2022.noarch 39/52 Verifying : perl-IPC-Open3-1.21-477.amzn2022.noarch 40/52 Verifying : perl-Term-ANSIColor-5.01-459.amzn2022.noarch 41/52 Verifying : perl-if-0.60.800-477.amzn2022.noarch 42/52 Verifying : perl-Getopt-Std-1.12-477.amzn2022.noarch 43/52 Verifying : perl-Class-Struct-0.66-477.amzn2022.noarch 44/52 Verifying : perl-Pod-Escapes-1:1.07-458.amzn2022.noarch 45/52 Verifying : perl-Term-Cap-1.17-458.amzn2022.noarch 46/52 Verifying : mysql-community-client-8.0.32-1.el8.x86_64 47/52 Verifying : mysql-community-client-plugins-8.0.32-1.el8.x86_64 48/52 Verifying : mysql-community-common-8.0.32-1.el8.x86_64 49/52 Verifying : mysql-community-icu-data-files-8.0.32-1.el8.x86_64 50/52 Verifying : mysql-community-libs-8.0.32-1.el8.x86_64 51/52 Verifying : mysql-community-server-8.0.32-1.el8.x86_64 52/52 ================================================================================================================================================================================== WARNING: A newer release of "Amazon Linux" is available. Available Versions: Version 2022.0.20230118: Run the following command to update to 2022.0.20230118: dnf update --releasever=2022.0.20230118 Release notes: https://docs.aws.amazon.com/linux/al2022/release-notes/relnotes.html ================================================================================================================================================================================== Installed: libaio-0.3.111-11.amzn2022.x86_64 mysql-community-client-8.0.32-1.el8.x86_64 mysql-community-client-plugins-8.0.32-1.el8.x86_64 mysql-community-common-8.0.32-1.el8.x86_64 mysql-community-icu-data-files-8.0.32-1.el8.x86_64 mysql-community-libs-8.0.32-1.el8.x86_64 mysql-community-server-8.0.32-1.el8.x86_64 openssl1.1-1:1.1.1l-2.amzn2022.0.2.x86_64 perl-Carp-1.50-458.amzn2022.noarch perl-Class-Struct-0.66-477.amzn2022.noarch perl-DynaLoader-1.47-477.amzn2022.x86_64 perl-Encode-4:3.15-462.amzn2022.x86_64 perl-Errno-1.30-477.amzn2022.x86_64 perl-Exporter-5.74-459.amzn2022.noarch perl-Fcntl-1.13-477.amzn2022.x86_64 perl-File-Basename-2.85-477.amzn2022.noarch perl-File-Path-2.18-2.amzn2022.noarch perl-File-Temp-1:0.231.100-2.amzn2022.noarch perl-File-stat-1.09-477.amzn2022.noarch perl-Getopt-Long-1:2.52-2.amzn2022.noarch perl-Getopt-Std-1.12-477.amzn2022.noarch perl-HTTP-Tiny-0.078-1.amzn2022.noarch perl-IO-1.43-477.amzn2022.x86_64 perl-IPC-Open3-1.21-477.amzn2022.noarch perl-MIME-Base64-3.16-2.amzn2022.x86_64 perl-POSIX-1.94-477.amzn2022.x86_64 perl-PathTools-3.78-459.amzn2022.x86_64 perl-Pod-Escapes-1:1.07-458.amzn2022.noarch perl-Pod-Perldoc-3.28.01-459.amzn2022.noarch perl-Pod-Simple-1:3.42-2.amzn2022.noarch perl-Pod-Usage-4:2.01-2.amzn2022.noarch perl-Scalar-List-Utils-4:1.56-459.amzn2022.x86_64 perl-SelectSaver-1.02-477.amzn2022.noarch perl-Socket-4:2.032-1.amzn2022.x86_64 perl-Storable-1:3.21-458.amzn2022.x86_64 perl-Symbol-1.08-477.amzn2022.noarch perl-Term-ANSIColor-5.01-459.amzn2022.noarch perl-Term-Cap-1.17-458.amzn2022.noarch perl-Text-ParseWords-3.30-458.amzn2022.noarch perl-Text-Tabs+Wrap-2021.0726-1.amzn2022.noarch perl-Time-Local-2:1.300-5.amzn2022.noarch perl-constant-1.33-459.amzn2022.noarch perl-if-0.60.800-477.amzn2022.noarch perl-interpreter-4:5.32.1-477.amzn2022.x86_64 perl-libs-4:5.32.1-477.amzn2022.x86_64 perl-mro-1.23-477.amzn2022.x86_64 perl-overload-1.31-477.amzn2022.noarch perl-overloading-0.02-477.amzn2022.noarch perl-parent-1:0.238-458.amzn2022.noarch perl-podlators-1:4.14-458.amzn2022.noarch perl-subs-1.03-477.amzn2022.noarch perl-vars-1.05-477.amzn2022.noarch Complete!
↑あれ??RHEL8用のリポジトリからもMySQLサーバーがインストールできた。??????
↑よくよく見るとopenssl1.1をamazonlinuxリポジトリからインストールすることで依存解決が行えてる模様。
# ll /usr/lib64/libssl* -rwxr-xr-x 1 root root 426696 Dec 2 2021 /usr/lib64/libssl3.so lrwxrwxrwx 1 root root 16 Jun 4 2022 /usr/lib64/libssl.so.1.1 -> libssl.so.1.1.1l -rwxr-xr-x 1 root root 653616 Jun 4 2022 /usr/lib64/libssl.so.1.1.1l lrwxrwxrwx. 1 root root 15 Jun 4 2022 /usr/lib64/libssl.so.3 -> libssl.so.3.0.3 -rwxr-xr-x. 1 root root 689784 Jun 4 2022 /usr/lib64/libssl.so.3.0.3 # ll /usr/lib64/libcrypto* lrwxrwxrwx 1 root root 19 Jun 4 2022 /usr/lib64/libcrypto.so.1.1 -> libcrypto.so.1.1.1l -rwxr-xr-x 1 root root 3140456 Jun 4 2022 /usr/lib64/libcrypto.so.1.1.1l lrwxrwxrwx. 1 root root 18 Jun 4 2022 /usr/lib64/libcrypto.so.3 -> libcrypto.so.3.0.3 -rwxr-xr-x. 1 root root 4483856 Jun 4 2022 /usr/lib64/libcrypto.so.3.0.3 # openssl version OpenSSL 3.0.3 3 May 2022 (Library: OpenSSL 3.0.3 3 May 2022)
↑openssl1.1系のlibが含まれてることを確認、opensslコマンドのバージョン自体は3系のままなのを確認
参考リンク
- MySQL :: MySQL Community Downloads
- MySQL Communityのダウンロードページ。
- AL2022はパッケージマネージャとしてdnf(yumの後継)を使ってるのでMySQL Yum Repositoryのリポジトリをインストールする方針としました。
- EC2(Amazon Linux 2022)にターミナルソフトからSSH接続できない場合の対処方法 | DevelopersIO
- いろいろ設定した後、SSHで再接続しようとしたらできなくなった!って時に参考にさせていただきました。
- 記事の通りRLoginの接続プロトコルをSHA1→SHA2-512にすることで接続できました。