The Apache HTTP server or simply Apache is free and open-source cross-platform web server software developed and maintained by Apache Software Foundation. Apache is an easy-to-learn and configures web server providing an ability to host websites mainly via HTTP or HTTPS protocols. Under RHEL 8 system Apache webserver is known under the name httpd.
How to install Apache on RHEL 8?
Step1: The first step is to use the dnf command to install the package called httpd
# dnf install httpd
Step 2: Run and enable the Apache webserver to start after reboot
# systemctl enable httpd
# systemctl start httpd
Step 3: Optionally, if you need your Apache webserver to be accessed from remote locations open HTTP firewall port 80
# firewall-cmd --zone=public --permanent --add-service=http
# firewall-cmd --reload
Step 4: Insert your website files. By default, the Apache webserver will greet you with a default welcome page. To disable the default Apache welcome page insert your index.html into /var/www/html/ directory.
echo Apache on RHEL 8 / CentOS 8 > /var/www/html/index.html
Step 5: Access your website. To access your new sample website navigate your web browser to either http://YOUR-APACHE-IP-ADDRESS or http://YOUR-APACHE-HOSTNAME
For Example: http://192.168.2.151