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.2IPv4 address.
Procedure
Install the HTTP server:
# dnf install httpdCreate the
/var/www/html/redhatdirectory:# mkdir -p /var/www/html/redhat- Download the RHEL DVD ISO file. See All Red Hat Enterprise Linux Downloads.
Create a mount point for the ISO file:
# mkdir -p /var/www/html/redhat/isoMount the ISO file:
# mount -o loop,ro -t iso9660 path-to-RHEL-DVD.iso /var/www/html/redhat/isoCopy the boot loader, kernel, and
initramfsfrom 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/redhatMake 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/EFIEdit the
/var/www/html/redhat/EFI/BOOT/grub.cfgfile 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.
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.
-
Optional: To enable permanent access, add the
--permanentoption to the command. Reload firewall rules:
# firewall-cmd --reloadStart the HTTP server:
# systemctl enable --now httpdMake the
htmldirectory and its content readable and executable:# chmod -cR u=rwX,g=rX,o=rX /var/www/htmlRestore the SELinux context of the
htmldirectory:# restorecon -FvvR /var/www/html