🔧 Exploring Red Hat Linux for DevOps: Hands-On Guide 🖥️

🔧 Exploring Red Hat Linux for DevOps: Hands-On Guide 🖥️

What is an Operating System?

An operating system (OS) is software that manages computer hardware and software resources and provides common services for computer programs. Examples include Nokia OS, Samsung's proprietary OS, Windows OS, and Linux, which is known for its robustness and versatility.

Linux Features

  • Multi-user & Multi-tasking

  • Open-source: Imagine working in a production environment and a large Windows update appears or Windows crashes.

  • Security: With Windows, you often need to install antivirus software.

Flavours of Linux

  • CentOS

  • Ubuntu

  • Fedora

  • Red Hat

  • AWS Linux

  • Kali Linux

Q: Now the question is, why are there so many distributions of Linux?

A: When Linus Torvalds created Linux, he made the code open source. This allowed various developers and organizations to modify and distribute their own versions, leading to the creation of many different Linux distributions.

Hands-on

You can use RHEL in different environments:

  • AWS EC2 (RHEL)

  • Red Hat interactive lab

  • VirtualBox

  • docker run -it redhat/ubi8

  • Vagrant

First, we will take hands-on on Red Hat interactive-labs

Step 1: Click here [Red Hat interactive-labs] and then click on the arrow →

Step 2: Click on the Launch Button

Step 3: Click on the Start button

Step 4: Congratulations, you are on the Red Hat terminal

Now it’s time on AWS

Step 1: Open your AWS account, log in, and click on EC2

Step 2: Click on Launch instance

Step 3: Give a name to your instance (Example: Red-hat)

Step 4: Select the Red Hat OS image

Step 5: Select instance type (t2.micro free tier)

Step 6: Now create a key pair (You can connect your EC2 via machine using this key)

Step 7: Select the created key

Step 8: Now click on launch instance

Step 9: Congratulations, you created an EC2 instance of Red Hat. Select the instance and click on connect

Step 10: Connect to the EC2 instance

Step 11: Oh no, we got an error. Don’t worry, this error appeared because you successfully followed the steps. Now we will solve our first error. Let’s first read the error (Explanation: Failed because AWS doesn’t have the library to run Red Hat on EC2)

Step 12: So we will connect EC2 with our local machine via SSH (private and public key)

Step 13: Use CMD or MobaXterm for Windows users. Now copy the example of the SSH client

Step 14: Open MobaXterm and find the key which we created as a key pair and paste the example in that directory

Step 15: Finally, we are accessing our EC2 instance Red Hat

How Linux Architecture Works

Linux architecture consists of several layers that interact with each other to manage hardware and software resources efficiently. The primary components are:

  1. Shell: The command-line interface where users input commands.

  2. Kernel: The core part of the operating system that manages system resources, hardware, and communication between software and hardware.

  3. Terminal: The interface that displays the shell and allows user interaction.

The flow typically works as follows:

Shell command → Kernel → Terminal

In Red Hat Linux, the root directory is denoted by a single forward slash (/). This is the top-level directory in the filesystem hierarchy, and all other directories and files are located under it. The root directory contains important subdirectories such as:

  • /bin: Essential command binaries

  • /boot: Static files of the boot loader

  • /dev: Device files

  • /etc: Host-specific system configuration

  • /home: User home directories

  • /lib: Essential shared libraries and kernel modules

  • /media: Mount points for removable media

  • /mnt: Mount point for temporarily mounted filesystems

  • /opt: Add-on application software packages

  • /root: Home directory of the root user

  • /sbin: System binaries

  • /tmp: Temporary files

  • /usr: Secondary hierarchy

  • /var: Variable data files

Each of these directories serves a specific purpose and helps in organizing the filesystem in a structured manner.

Let’s make the first command of our Red Hat journey

YUM vs DNF

YUM (Yellowdog Updater, Modified) and DNF (Dandified YUM) are both package managers used in Red Hat-based Linux distributions, but they have some key differences:

  1. Performance:

    • YUM: Slower dependency resolution and package management.

    • DNF: Faster dependency resolution and improved performance due to a more efficient dependency solver.

  2. Dependency Resolution:

    • YUM: Uses an older dependency resolution algorithm which can be slower and less efficient.

    • DNF: Uses the libsolv library for dependency resolution, which is faster and more accurate.

  3. Memory Usage:

    • YUM: Higher memory usage during operations.

    • DNF: Lower memory usage, making it more efficient.

  4. Features:

    • YUM: Lacks some advanced features found in DNF.

    • DNF: Includes advanced features like better support for modularity, improved transaction handling, and a more flexible plugin system.

  5. Backward Compatibility:

    • YUM: Older and more established, but being phased out in favor of DNF.

    • DNF: Designed to be backward compatible with YUM, but with improvements and new features.

  6. Command Syntax:

    • YUM: Commands are slightly different and may require adjustments when switching to DNF.

    • DNF: Commands are similar to YUM but with some differences. For example, yum install becomes dnf install.

Overall, DNF is the successor to YUM and is designed to be more efficient, faster, and feature-rich. It is the default package manager in newer versions of Red Hat-based distributions like Fedora and CentOS.

What is httpd in Red Hat?

In Red Hat Linux, httpd is the Apache HTTP Server, a widely-used open-source web server software. It is responsible for serving web content to clients over the HTTP and HTTPS protocols. The httpd service listens on port 80 for HTTP requests and port 443 for HTTPS requests by default. It is highly configurable and supports a variety of features, including virtual hosting, URL redirection, and authentication mechanisms.

The httpd service listens on port 80, so we have to open port number 80 for everyone.

Step 1: Select the instance and click on security

Step 2: Click on edit inbound rules

Step 3: Click on Add rules and open port 80 to everyone

Step 4: Now copy the public IP address of the instance and paste it into the browser

Step 5: Now you can see the Test page of Red Hat

Thankyou for reading !!!!