Pages

Friday, April 25, 2025

Installing PHP 8.3 on RHEL-based Systems: A Step-by-Step Guide


PHP stands as a cornerstone of web development, a versatile scripting language and interpreter renowned for its open availability and prevalent use on Linux-based web servers. Keeping your PHP installation up-to-date is crucial for performance, security, and access to the latest features. This guide walks you through the process of installing PHP 8.3 on your Red Hat Enterprise Linux (RHEL) based system, leveraging the EPEL and REMI repositories for a streamlined experience.

Adding the EPEL and REMI Repositories

To gain access to a wider range of software packages, including the latest PHP versions, we'll add the Extra Packages for Enterprise Linux (EPEL) and the Remi Community Repository (REMI) to your system's package manager. Execute the following commands in your terminal:

Bash
sudo dnf install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
sudo dnf -y install https://rpms.remirepo.net/enterprise/remi-release-9.2.rpm

Note: The dnf command is the package manager used in modern RHEL-based systems like CentOS, Fedora, and AlmaLinux. The -y flag automatically confirms the installation, so proceed with caution.

Installing Yum Utilities

The yum-utils package provides a collection of helpful utilities for managing your DNF repositories and packages. Install it using the following command:

Bash
sudo dnf -y install yum-utils

While the command mentions yum, it's often a symbolic link to dnf on newer systems, so this command works seamlessly.

Enabling the PHP 8.3 Remi Repository

The REMI repository offers more recent PHP versions than the default RHEL repositories. To enable the PHP 8.3 stream from REMI, you'll first need to reset any active PHP modules and then enable the specific PHP 8.3 module:

Bash
sudo dnf module reset php
sudo dnf module install php:remi-8.3

The dnf module reset php command ensures a clean slate by disabling any previously enabled PHP modules. Following this, dnf module install php:remi-8.3 activates the PHP 8.3 module provided by the REMI repository.

With these steps completed, your system is now configured to install PHP 8.3 and its associated packages from the REMI repository. You can now proceed to install PHP 8.3 and any extensions you require using the dnf install php php-<extension-name> command.

Fixing “Permission Denied” Errors in Nginx Reverse Proxy Setups with SELinux

Running Nginx as a reverse proxy on a system with SELinux enabled can sometimes lead to frustrating errors like:

[crit] connect() to 172.16.5.32:32400 failed (13: Permission denied) while connecting to upstream, client: 172.16.0.1, server: rplex.adminz.in, request: "GET /web/index.html HTTP/2.0", upstream: "http://172.16.5.32:32400/web/index.html", host: "rplex.adminz.in:8443"

If you’re seeing this, SELinux is likely blocking Nginx from making outbound network connections to your upstream servers. Here’s how you can diagnose and fix the issue.

Understanding the Problem

When SELinux is in enforcing mode, it restricts what processes can do—even if you’re running as root. By default, Nginx (and other web servers running under the httpd_t SELinux context) cannot make arbitrary outbound network connections. This is a security feature, but it can block legitimate reverse proxy setups.

Typical log entries look like this:

[crit] connect() to <backend-ip>:<port> failed (13: Permission denied) while connecting to upstream, ...

Diagnosing SELinux Denials

To confirm SELinux is the culprit:

Check your Nginx error logs for “(13: Permission denied)” messages.

Inspect the SELinux audit logs:

sudo grep nginx /var/log/audit/audit.log | grep denied

If you see denials related to name_connect on a TCP socket, SELinux is blocking the connection.

The Solution: Allow Nginx Network Connections

SELinux controls network permissions for web servers using Boolean flags. The most relevant for Nginx reverse proxies is httpd_can_network_connect.

What does httpd_can_network_connect do?

Enabling this Boolean allows Nginx (and other httpd processes) to make outgoing network connections to any port.

This is required for Nginx to proxy requests to other backend servers, especially if they’re not on standard HTTP/HTTPS ports.

How to Enable It

Make the change persistent with:

setsebool -P httpd_can_network_connect true

The -P flag makes the change survive reboots.

After running this command, restart Nginx:

systemctl restart nginx

This should resolve the “permission denied” errors when connecting to upstream servers.

Tuesday, November 26, 2024

Harvester Setup and Configuration

Harvester is an open-source hyperconverged infrastructure (HCI) software that provides a powerful and easy-to-use platform for deploying and managing virtual machines (VMs). Built on Kubernetes, it simplifies the process of setting up and maintaining a virtualized environment. 

The following steps will guide you in setting up Harvester 

Download the Harvester ISO from the website.

Make a bootable USB from the ISO with any of the following tools

  • https://etcher.balena.io/
  • https://rufus.ie/en/

Once the machine has been booted from USB we will get the following Page



Once booted, follow the steps to complete the installatoon

  1. Cluster Creation:
    • Select "Create a new Harvester Cluster"
  2. Disk Selection:
    • Use the right arrow key to navigate and choose a disk for Harvester's system.
    • Select a separate disk dedicated to storing virtual machine data.
  3. Host Configuration:
    • Enter a hostname for your Harvester node.
  4. Network Setup:
    • Use the right arrow key to select your network interface card (NIC).
    • Choose between DHCP or static IP configuration.
      • If using Static, provide the necessary network details (IP address, subnet mask, gateway).
    • Configure DNS server addresses.
  5. VIP Configuration:
    • Use the right arrow key to navigate, Choose between DHCP or static IP for the Virtual IP (VIP) address.
      • If using Static, enter the desired VIP.
  6. Cluster Token:
    • Set a cluster token. This is crucial for adding more nodes to your cluster later.
  7. Password and SSH:
    • Set a strong password for accessing the node (default SSH user is 'rancher').
  8. NTP Servers:
    • Configure NTP servers (defaults to 0.suse.pool.ntp.org) to ensure time synchronization across all nodes. Use commas to separate multiple server addresses.
  9. Optional Configurations:
    • HTTP Proxy: If needed, provide the proxy URL.
    • SSH Keys: Import SSH keys by providing their HTTP URL (e.g., GitHub public keys).
    • Harvester Configuration: If you have a specific configuration file, enter its HTTP URL.
  10. Review and Install:
    • Review all the settings you've configured.
    • Confirm to start the installation process. This might take a few minutes.
  11. Access Harvester:
    • After the node restarts, the Harvester console will show the management URL and node status.
    • Access the web interface using the provided URL (defaults to https://your-virtual-ip).
    • Use F12 to switch to the shell if needed, and type exit to return to the console.

Latest Steps can be found @  https://github.com/harvester/harvester