6.4. HTTP ブート用の HTTP サーバーの設定
サーバーがネットワーク上で HTTP ブートリソースを提供できるように、サーバーに httpd サービスをインストールして有効にする必要があります。
前提条件
サーバーのネットワークアドレスがわかっている。
次の例では、サーバーには IPv4 アドレス
192.168.124.2のネットワークカードが搭載されています。
手順
HTTP サーバーをインストールします。
# dnf install httpd/var/www/html/redhatディレクトリーを作成します。# mkdir -p /var/www/html/redhat- RHEL DVD ISO ファイルをダウンロードします。All Red Hat Enterprise Linux Downloads を参照してください。
ISO ファイルのマウントポイントを作成します。
# mkdir -p /var/www/html/redhat/isoISO ファイルをマウントします。
# mount -o loop,ro -t iso9660 path-to-RHEL-DVD.iso /var/www/html/redhat/isoマウントされた ISO ファイルからブートローダー、カーネル、
initramfsを HTML ディレクトリーにコピーします。# cp -r /var/www/html/redhat/iso/images /var/www/html/redhat # cp -r /var/www/html/redhat/iso/EFI /var/www/html/redhatブートローダーの設定を編集可能にし、ブートファイルが httpd サーバー (apache) を実行しているユーザーにより所有されていることを確認します。
# chmod 644 /var/www/html/redhat/EFI/BOOT/grub.cfg # chown -R apache:apache /var/www/html/redhat/EFI/var/www/html/redhat/EFI/BOOT/grub.cfgファイルを編集し、次のように内容を置き換えます。set default="1" function load_video { insmod efi_gop insmod efi_uga insmod video_bochs insmod video_cirrus insmod all_video } load_video set gfxpayload=keep set timeout=60 menuentry 'Install Red Hat Enterprise Linux 10.0' --class fedora --class gnu-linux --class gnu --class os { linuxefi /redhat/images/pxeboot/vmlinuz inst.repo=http://192.168.124.2/redhat/iso quiet initrdefi /redhat/images/pxeboot/initrd.img } submenu 'Troubleshooting -->' { menuentry 'Install Red Hat Enterprise Linux 10.0 in text mode' --class fedora --class gnu-linux --class gnu --class os { linuxefi /redhat/images/pxeboot/vmlinuz inst.repo=http://192.168.124.2/redhat/iso inst.text quiet initrdefi /redhat/images/pxeboot/initrd.img } menuentry 'Rescue a Red Hat Enterprise Linux system' --class fedora --class gnu-linux --class gnu --class os { linuxefi /redhat/images/pxeboot/vmlinuz inst.stage2=http://192.168.124.2/redhat/iso inst.rescue quiet initrdefi /redhat/images/pxeboot/initrd.img } }このファイルで、次の文字列を更新します。
- Install Red Hat Enterprise Linux 10.0
- ダウンロードした RHEL のバージョンと一致するようにバージョン番号を編集します。
- 192.168.124.2
- サーバーの IP アドレスに置き換えます。
ファイアウォールでポートを開いて、HTTP (80)、DHCP (67、68)、および DHCPv6 (546、547) トラフィックを許可します。
# firewall-cmd --zone public \ --add-port={80/tcp,67/udp,68/udp,546/udp,547/udp}このコマンドは、次にサーバーを再起動するまで、一時的にアクセスを有効にします。
-
オプション: 永続的なアクセスを有効にするには、コマンドに
--permanentオプションを追加します。 ファイアウォールルールを再読み込みします。
# firewall-cmd --reloadHTTP サーバーを起動します。
# systemctl enable --now httpdhtmlディレクトリーとそのコンテンツを読み取り可能および実行可能にします。# chmod -cR u=rwX,g=rX,o=rX /var/www/htmlhtmlディレクトリーの SELinux コンテキストを復元します。# restorecon -FvvR /var/www/html