How to install the Apache Web Server on AlmaLinux 8

Categories

How to install the Apache Web Server on AlmaLinux 8

You are here:

In this article we’ll be explaining how you can install the Apache Web Server on AlmaLinux 8.

Firstly before we do anything related to Apache, it’s best to ensure the current operating system is up to date with the following command.

yum update && yum upgrade

 

Installing the Apache Service.

We’ll start by installing the packages and dependencies for the Apache server.

yum install httpd -y

 

Next up we want to enable and start the services by using the commands below.

sudo systemctl enable httpd
sudo systemctl start httpd

Before we go further, we’ll check the status of Apache by running the following command.

sudo systemctl status httpd

 

 

Tweaking the firewall to allow connections to Apache.

Firewalld is already installed and enabled as part of the AlmaLinux installation process.

Firstly, check if this service is running, if so then there are additional configuration steps required to allow Apache connections to pass through the firewall.

systemctl status firewalld

Add rules to allow Apache HTTP and HTTPS connections through the firewall.

sudo firewall-cmd --zone=public --add-service=http --permanent
sudo firewall-cmd --zone=public --add-service=https --permanent

Reload firewalld to apply the changes.

sudo firewall-cmd --reload

Confirm that the applications have been registered.

sudo firewall-cmd --list-all | grep http

(you should see http and https highlighted)

Testing
Now we can test the configuration to be able to access the website

Go to your server IP in the browser browser. If the AlmaLinux Test page appears. Apache has been successfully installed and working!

AlmaTestPage

Previous How to Install Redis on Almalinux
Next Howto Import and Export a MySQL database in SSH
Table of Contents