How To Install Apache Web Server on AlmaLinux 9
In this tutorial, we will show you how to install Apache Web Server on AlmaLinux 9. For those of you who didn’t know, Apache is an open-source and widely used web server. It’s an open-source and cross-platform web server software developed and maintained by Apache Software Foundation. It’s easy to set up and learn to use, which has led to its widespread adoption for small and large-scale websites.
This article assumes you have at least basic knowledge of Linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘sudo
‘ to the commands to get root privileges. I will show you the step-by-step installation of the Apache Web Server on AlmaLinux 9. You can follow the same instructions for CentOS and Rocky Linux.
Prerequisites
- A server running one of the following operating systems: AlmaLinux 9.
- It’s recommended that you use a fresh OS install to prevent any potential issues.
- SSH access to the server (or just open Terminal if you’re on a desktop).
- A
non-root sudo user
or access to theroot user
. We recommend acting as anon-root sudo user
, however, as you can harm your system if you’re not careful when acting as the root.
Install Apache Web Server on AlmaLinux 9
Step 1. First, let’s start by ensuring your system is up-to-date.
sudo dnf clean all sudo dnf update sudo dnf groupinstall "Development Tools"
Step 2. Installing Apache Web Server on AlmaLinux 9.
By default, Apache is available on the AlmaLinux 9 base repository. Now we install the latest version of Apache using dnf
the command:
sudo dnf install httpd httpd-tools
You can start the httpd
service and configure it to run on startup by entering the following commands:
sudo systemctl start httpd sudo systemctl enable httpd sudo systemctl status httpd
Step 3. Configure Firewall.
To make your pages available to the public, you will have to edit your firewall rules to allow HTTP and HTTPS requests on your web server by using the following commands:
sudo firewall-cmd --permanent --zone=public --add-service=http sudo firewall-cmd --permanent --zone=public --add-service=https sudo firewall-cmd --reload
Step 4. Accessing Apache Web Interface.
Once successfully installed, You can verify that the web server is running and accessible by accessing your server’s IP address:
http://your-IP-address
Congratulations! You have successfully installed Apache. Thanks for using this tutorial for installing the Apache HTTP Server on your AlmaLinux 9 system. For additional help or useful information, we recommend you check the official Apache website.