6.4. Configuring the HTTP server for HTTP boot


You must install and enable the httpd service on your server so that the server can provide HTTP boot resources on your network.

Prerequisites

  • Find the network addresses of the server.

    In the following examples, the server has a network card with the 192.168.124.2 IPv4 address.

Procedure

  1. Install the HTTP server:

    # dnf install httpd
  2. Create the /var/www/html/redhat directory:

    # mkdir -p /var/www/html/redhat
  3. Download the RHEL DVD ISO file. See All Red Hat Enterprise Linux Downloads.
  4. Create a mount point for the ISO file:

    # mkdir -p /var/www/html/redhat/iso
  5. Mount the ISO file:

    # mount -o loop,ro -t iso9660 path-to-RHEL-DVD.iso /var/www/html/redhat/iso
  6. Copy the boot loader, kernel, and initramfs from the mounted ISO file into your HTML directory:

    # cp -r /var/www/html/redhat/iso/images /var/www/html/redhat
    # cp -r /var/www/html/redhat/iso/EFI /var/www/html/redhat
  7. Make the boot loader configuration editable and ensure the boot files are owned by the user running httpd server (apache):

    # chmod 644 /var/www/html/redhat/EFI/BOOT/grub.cfg
    # chown -R apache:apache /var/www/html/redhat/EFI
  8. Edit the /var/www/html/redhat/EFI/BOOT/grub.cfg file and replace its content with the following:

    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
        	}
    }

    In this file, update the following strings:

    Install Red Hat Enterprise Linux 10.0
    Edit the version number to match the version of RHEL that you downloaded.
    192.168.124.2
    Replace with the IP address of your server.
  9. Open ports in the firewall to allow HTTP (80), DHCP (67, 68) and DHCPv6 (546, 547) traffic:

    # firewall-cmd --zone public \
                   --add-port={80/tcp,67/udp,68/udp,546/udp,547/udp}

    This command enables temporary access until the next server reboot.

  10. Optional: To enable permanent access, add the --permanent option to the command.
  11. Reload firewall rules:

    # firewall-cmd --reload
  12. Start the HTTP server:

    # systemctl enable --now httpd
  13. Make the html directory and its content readable and executable:

    # chmod -cR u=rwX,g=rX,o=rX /var/www/html
  14. Restore the SELinux context of the html directory:

    # restorecon -FvvR /var/www/html
Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。 了解我们当前的更新.

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

Theme

© 2026 Red Hat
返回顶部