How To Install Apache On Red Hat Enterprise Linux Server 9

How To Install Apache On Red Hat Enterprise Linux Server 9

Here is step-by-step instruction on how to install Apache (HTTP Server) on a Red Hat Enterprise Linux (RHEL) 9 server :

✅ Step 1 : Update the System

sudo dnf update -y

✅ Step 2 : Install Apache (httpd)

sudo dnf install httpd -y

✅ Step 3 : Enable and Start Apache

Enable Apache to start on boot :

sudo systemctl enable httpd

Start the Apache service :

sudo systemctl start httpd

✅ Step 4 : Configure the Firewall

If 'firewalld' is enabled, allow HTTP and HTTPS traffic :

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

✅ Step 5 : Verify Apache is Running

Check the status :

sudo systemctl status httpd

Visit your server's IP or domain in a browser :

http://your_server_ip/

You should see the  Apache HTTP Server test page .

✅ Optional : Manage Apache

Restart :

sudo systemctl restart httpd

Stop :

sudo systemctl stop httpd

Reload config (without restarting) :

sudo systemctl reload httpd

Tags :