Search icon CANCEL
Subscription
0
Cart icon
Cart
Close icon
You have no products in your basket yet
Save more on your purchases!
Savings automatically calculated. No voucher code required
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Oracle Linux Cookbook

You're reading from  Oracle Linux Cookbook

Product type Book
Published in Jan 2024
Publisher Packt
ISBN-13 9781803249285
Pages 548 pages
Edition 1st Edition
Languages
Authors (3):
Erik Benner Erik Benner
Profile icon Erik Benner
Erik B. Thomsen Erik B. Thomsen
Profile icon Erik B. Thomsen
Jonathan Spindel Jonathan Spindel
Profile icon Jonathan Spindel
View More author details
Toc

Table of Contents (16) Chapters close

Preface 1. Chapter 1: Oracle Linux 8 – Get It? Got It? Good! 2. Chapter 2: Installing with and without Automation Magic 3. Chapter 3: Exploring the Various Boot Options and Kernels in Oracle Linux 4. Chapter 4: Creating and Managing Single-Instance Filesystems 5. Chapter 5: Software Management with DNF 6. Chapter 6: Eliminating All the SPOFs! An Exercise in Redundancy 7. Chapter 7: Oracle Linux 8 – Patching Doesn’t Have to Mean Rebooting 8. Chapter 8: DevOps Automation Tools – Terraform, Ansible, Packer, and More 9. Chapter 9: Keeping the Data Safe – Securing a System 10. Chapter 10: Revisiting Modules and AppStreams 11. Chapter 11: Lions, Tigers, and Containers – Oh My! Podman and Friends 12. Chapter 12: Navigating Ansible Waters 13. Chapter 13: Let’s All Go to the Cloud 14. Index 15. Other Books You May Enjoy

Setting up the web server – HTTPD

The next step for the PXE server is to install a web server. In this example, we will use Apache. Other web servers will also work, but Apache is one of the most common.

Getting ready

To set up an HTTP server, you will need an Oracle Linux 8 VM running in your environment. The server’s IP address should be routable to the subnets the VMs are using, and the firewall ports should allow HTTP/HTTPS traffic. Ideally, you should also have enough space for several ISO files. Normally, 20-30 GB is enough data space.

How to do it…

Starting the install of the Apache HTTPD server is simple; just run yum install -y httpd.

Once the web server is installed, copy the full ISO file to the server into a directory of your choice. In our example, OracleLinux-R8-U5-x86_64-dvd.iso is copied into /root, as seen in Figure 2.9.

Figure 2.9 – Oracle Linux ISO in /root

Figure 2.9 – Oracle Linux ISO in /root

The next step is to mount the ISO file in a directory under docroot. With the standard install of Apache, docroot is in /var/www/html, so a directory named OL8 is created. When the ISO is mounted, it is more efficient to use a loopback mount method. This allows an ISO file to be mounted as a normal filesystem. Next, using a loopback mount, mount the ISO file using /var/www/html/OL8 as the mount point using the following command:

mount -o ro,loop /root/OracleLinux-R8-U5-x86_64-dvd.iso /var/www/html/OL8

Once mounted, a df command will show the mounted filesystem. The entire chain of commands can be seen in the following screenshot, Figure 2.10.

Figure 2.10 – ISO mounted

Figure 2.10 – ISO mounted

Now that the filesystem is mounted, let’s open up ports 80 and 443 in the firewall. This is easily done with firewall-cmd, adding both the http and https ports opened and saved as permanent changes to the firewall. Once the ports are opened, the firewall rules are reloaded. The following three commands are run to perform these tasks:

firewall-cmd --add-service=http --permanent
firewall-cmd --add-service=https --permanent
firewall-cmd --reload

Now that the firewall is opened, Apache is installed, and the ISO is mounted via a loopback, we can start the Apache server with the systemctl start httpd command.

You can verify that all is working as expected by pointing your browser to the server’s IP address and the OL8 directory, as seen in the following screenshot. This will show the contents of the ISO, including the release notes and the RPMs under the BaseOS directory, as seen in Figure 2.11.

Figure 2.11 – ISO file accessible via httpd

Figure 2.11 – ISO file accessible via httpd

You have been reading a chapter from
Oracle Linux Cookbook
Published in: Jan 2024 Publisher: Packt ISBN-13: 9781803249285
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €14.99/month. Cancel anytime}