Rocky Linux 8の Apacheに HTTP2プロトコル TLS1.3対応の CodeITリポジトリを導入したのでめも。
「 dnf 」コマンドから簡単にHTTP2プロトコル対応の「Apache HTTPサーバー」を構築することができるCodeITリポジトリを導入してみました。
まず「Rocky Linux 8」「Alma Linux 8」用にリポジトリをダウンロードします。
# cd /etc/yum.repos.d && wget https://repo.codeit.guru/codeit.el8.repo
.
もしくは CodeIT Technical Blog から専用リポジトリを「CodeIT.repo」としてコピーして保存します。
vi /etc/yum.repos.d/CodeIT.repo
[CodeIT] name=CodeIT repo baseurl=https://repo.codeit.guru/packages/centos/$releasever/$basearch enabled=1 gpgkey=https://repo.codeit.guru/RPM-GPG-KEY-MasterOfDevon gpgcheck=1
# 現在、以下のリポジトリはエラーになるようでした #[CodeIT-mainline] #name=CodeIT mainline repo
#baseurl=https://repo.codeit.guru/packages/mainline/centos/$releasever/$basearch
#enabled=1
#gpgkey=https://repo.codeit.guru/RPM-GPG-KEY-MasterOfDevon
#gpgcheck=1 # #[CodeIT-testing] #name=CodeIT testing repo
#baseurl=https://repo.codeit.guru/packages/testing/$releasever/$basearch
#enabled=0
#gpgkey=https://repo.codeit.guru/RPM-GPG-KEY-MasterOfDevon
#gpgcheck=1
.
次に通常リポジトリの httpd モジュールをリセットして httpd:codeit モジュールを有効にします。
# dnf module reset httpd
# dnf module enable httpd:codeit
.
Apacheを停止して 「 dnf update 」してWebサーバーを更新します。
# systemctl stop httpd
# dnf -y update
メタデータの期限切れの最終確認: 0:12:17 時間前の 2023年02月16日 14時57分41秒 に実施しました。
依存関係が解決しました。
=============================================================================================================================================================================================================================================
 パッケージ                                                アーキテクチャー                               バージョン                                                                    リポジトリー                                   サイズ
=============================================================================================================================================================================================================================================
アップグレード:
 httpd                                                     x86_64                                         2.4.55-1.module_codeit.codeit.el8                                             CodeIT                                         1.4 M
 httpd-filesystem                                          noarch                                         2.4.55-1.module_codeit.codeit.el8                                             CodeIT                                         8.0 k
 httpd-manual                                              noarch                                         2.4.55-1.module_codeit.codeit.el8                                             CodeIT                                         2.4 M
 httpd-tools                                               x86_64                                         2.4.55-1.module_codeit.codeit.el8                                             CodeIT                                          76 k
 mod_http2                                                 x86_64                                         2.0.12-1.module_codeit.codeit.el8                                             CodeIT                                         158 k
 mod_ssl                                                   x86_64                                         1:2.4.55-1.module_codeit.codeit.el8                                           CodeIT                                         106 k
依存関係のインストール:
 openssl-quic-libs                                         x86_64                                         1.1.1t-1.codeit.el8                                                           CodeIT                                         1.4 M
トランザクションの概要
=============================================================================================================================================================================================================================================
インストール    1 パッケージ
アップグレード  6 パッケージ
ダウンロードサイズの合計: 5.6 M
これでよろしいですか? [y/N]: y
パッケージのダウンロード:
(1/7): httpd-filesystem-2.4.55-1.module_codeit.codeit.el8.noarch.rpm                                                                                                                                          72 kB/s | 8.0 kB     00:00
(2/7): httpd-2.4.55-1.module_codeit.codeit.el8.x86_64.rpm                                                                                                                                                    2.4 MB/s | 1.4 MB     00:00
(3/7): httpd-manual-2.4.55-1.module_codeit.codeit.el8.noarch.rpm                                                                                                                                             3.7 MB/s | 2.4 MB     00:00
(4/7): mod_http2-2.0.12-1.module_codeit.codeit.el8.x86_64.rpm                                                                                                                                                2.9 MB/s | 158 kB     00:00
(5/7): openssl-quic-libs-1.1.1t-1.codeit.el8.x86_64.rpm                                                                                                                                                      1.4 MB/s | 1.4 MB     00:01
(6/7): mod_ssl-2.4.55-1.module_codeit.codeit.el8.x86_64.rpm                                                                                                                                                  354 kB/s | 106 kB     00:00
(7/7): httpd-tools-2.4.55-1.module_codeit.codeit.el8.x86_64.rpm                                                                                                                                              100 kB/s |  76 kB     00:00
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
合計                                                                                                                                                                                                         4.1 MB/s | 5.6 MB     00:01
トランザクションの確認を実行中
トランザクションの確認に成功しました。
トランザクションのテストを実行中
トランザクションのテストに成功しました。
トランザクションを実行中
  準備             :                                                                                                                                                                                                                     1/1
  scriptletの実行中: openssl-quic-libs-1.1.1t-1.codeit.el8.x86_64                                                                                                                                                                        1/1
  インストール中   : openssl-quic-libs-1.1.1t-1.codeit.el8.x86_64                                                                                                                                                                       1/13
  scriptletの実行中: httpd-filesystem-2.4.55-1.module_codeit.codeit.el8.noarch                                                                                                                                                          2/13
  アップグレード中 : httpd-filesystem-2.4.55-1.module_codeit.codeit.el8.noarch                                                                                                                                                          2/13
  アップグレード中 : httpd-tools-2.4.55-1.module_codeit.codeit.el8.x86_64                                                                                                                                                               3/13
  アップグレード中 : httpd-2.4.55-1.module_codeit.codeit.el8.x86_64                                                                                                                                                                     4/13
  scriptletの実行中: httpd-2.4.55-1.module_codeit.codeit.el8.x86_64                                                                                                                                                                     4/13
  アップグレード中 : mod_http2-2.0.12-1.module_codeit.codeit.el8.x86_64                                                                                                                                                                 5/13
  アップグレード中 : httpd-manual-2.4.55-1.module_codeit.codeit.el8.noarch                                                                                                                                                              6/13
  アップグレード中 : mod_ssl-1:2.4.55-1.module_codeit.codeit.el8.x86_64                                                                                                                                                                 7/13
警告: /etc/httpd/conf.d/ssl.conf は /etc/httpd/conf.d/ssl.conf.rpmnew として作成されました。
  整理             : httpd-manual-2.4.37-51.module+el8.7.0+1059+126e9251.noarch                                                                                                                                                         8/13
  整理             : mod_ssl-1:2.4.37-51.module+el8.7.0+1059+126e9251.x86_64                                                                                                                                                            9/13
  scriptletの実行中: httpd-2.4.37-51.module+el8.7.0+1059+126e9251.x86_64                                                                                                                                                               10/13
  整理             : httpd-2.4.37-51.module+el8.7.0+1059+126e9251.x86_64                                                                                                                                                               10/13
  scriptletの実行中: httpd-2.4.37-51.module+el8.7.0+1059+126e9251.x86_64                                                                                                                                                               10/13
  整理             : httpd-filesystem-2.4.37-51.module+el8.7.0+1059+126e9251.noarch                                                                                                                                                    11/13
  整理             : httpd-tools-2.4.37-51.module+el8.7.0+1059+126e9251.x86_64                                                                                                                                                         12/13
  整理             : mod_http2-1.15.7-5.module+el8.6.0+823+f143cee1.x86_64                                                                                                                                                             13/13
  scriptletの実行中: httpd-2.4.55-1.module_codeit.codeit.el8.x86_64                                                                                                                                                                    13/13
  scriptletの実行中: mod_http2-1.15.7-5.module+el8.6.0+823+f143cee1.x86_64                                                                                                                                                             13/13
Failed to copy files to /run/cockpit/inactive.motd: No such file or directory
警告: %transfiletriggerin(systemd-239-68.el8_7.2.x86_64) スクリプトの実行に失敗しました。終了ステータス 73
Error in  scriptlet in rpm package mod_http2
  検証             : openssl-quic-libs-1.1.1t-1.codeit.el8.x86_64                                                                                                                                                                       1/13
  検証             : httpd-2.4.55-1.module_codeit.codeit.el8.x86_64                                                                                                                                                                     2/13
  検証             : httpd-2.4.37-51.module+el8.7.0+1059+126e9251.x86_64                                                                                                                                                                3/13
  検証             : httpd-filesystem-2.4.55-1.module_codeit.codeit.el8.noarch                                                                                                                                                          4/13
  検証             : httpd-filesystem-2.4.37-51.module+el8.7.0+1059+126e9251.noarch                                                                                                                                                     5/13
  検証             : httpd-manual-2.4.55-1.module_codeit.codeit.el8.noarch                                                                                                                                                              6/13
  検証             : httpd-manual-2.4.37-51.module+el8.7.0+1059+126e9251.noarch                                                                                                                                                         7/13
  検証             : httpd-tools-2.4.55-1.module_codeit.codeit.el8.x86_64                                                                                                                                                               8/13
  検証             : httpd-tools-2.4.37-51.module+el8.7.0+1059+126e9251.x86_64                                                                                                                                                          9/13
  検証             : mod_http2-2.0.12-1.module_codeit.codeit.el8.x86_64                                                                                                                                                                10/13
  検証             : mod_http2-1.15.7-5.module+el8.6.0+823+f143cee1.x86_64                                                                                                                                                             11/13
  検証             : mod_ssl-1:2.4.55-1.module_codeit.codeit.el8.x86_64                                                                                                                                                                12/13
  検証             : mod_ssl-1:2.4.37-51.module+el8.7.0+1059+126e9251.x86_64                                                                                                                                                           13/13
アップグレード済み:
  httpd-2.4.55-1.module_codeit.codeit.el8.x86_64          httpd-filesystem-2.4.55-1.module_codeit.codeit.el8.noarch      httpd-manual-2.4.55-1.module_codeit.codeit.el8.noarch      httpd-tools-2.4.55-1.module_codeit.codeit.el8.x86_64
  mod_http2-2.0.12-1.module_codeit.codeit.el8.x86_64      mod_ssl-1:2.4.55-1.module_codeit.codeit.el8.x86_64
インストール済み:
  openssl-quic-libs-1.1.1t-1.codeit.el8.x86_64
完了しました!
SSL の秘密鍵を作成・・・
# cd /etc/pki/tls/private/
# cp localhost.key{,.org}
# openssl rsa -in localhost.key.org -out localhost.key
ssl.conf を編集します。
# vi /etc/httpd/conf.d/ssl.conf
↓(追記) Protocols h2 http/1.1
/etc/httpd/conf/httpd.conf に以下のフィルターを追記。
# vi /etc/httpd/conf/httpd.conf
↓(最下行に追記 <IfModule mime_module> AddOutputFilterByType BROTLI_COMPRESS text/html text/plain text/xml text/css text/javascript application/javascript
</IfModule>
Apacheを再起動します。
# systemctl restart httpd
# SELinux エラーが出るときは以下のコマンドで許可してください
# setsebool -P domain_can_mmap_files 1
.
何もなければFirefoxアドオンの「HTTP Version Indicator」で自サイトのアドレスバーに「稲妻」マークが表示されました。
.
参考URL:CodeIT Technical Blog


