First, update your systems package index
dnf update -y
Install Apache
dnf install httpd -y
Once the installation is complete, enable and start the Apache service
systemctl enable httpd
systemctl start httpd
Configure the Firewall to allow http and https traffic
firewall-cmd –permanent –add-service=http
firewall-cmd –permanent –add-service=https
firewall-cmd –reload
Verify Apache Installation
systemctl status httpd
Configure Apache (Optional)
Apache’s configuration files are located in the following directory
/etc/httpd
Run the following command to see the location of the main configuration file
find ‘/etc/httpd’ -name “httpd.conf”
The main configuration file is httpd.conf and should be located in the /etc/httpd/conf folder
Apache error logs
If you encounter any issues, check your Apache error logs located in /var/log/httpd/error_log
When it comes to restarting the Apache server, there are several reasons why you might need to do so. Some of the most common reasons are performance issues, configuration changes, and security updates.
systemctl restart httpd
To stop your web server, type:
systemctl stop httpd
Learn about the popular Apache HTTP Web Server on the official site https://httpd.apache.org/