Make the Apache server to start automatically. Type the following command on terminal and press enter.

systemctl enable httpd

Check the Apache Web server status using the below command.

systemctl status httpd

Output:

Install LAMP Stack On RHEL 8 – Apache Web Server Service Status

Firewall

By default, the system firewall blocks the HTTP connections coming from external machines. So, to test or use the Apache web server, we need to configure the firewall to allow HTTP requests from external machines.

firewall-cmd --permanent --add-port=80/tcp
firewall-cmd --reload

Test Apache

Open up a web browser and then enter the following URL into the web address.

http://localhost

OR

http://your.ip.adr.ess

You will get the below Apache test web page. This test page confirms that the Apache is working fine.

Install LAMP Stack on RHEL 8 – Apache Web Server Test Page

Apache’s default document root is /var/www/html on RHEL, and the main configuration file is /etc/httpd/conf/httpd.conf. Additional configurations for Apache Web server are stored in /etc/httpd/conf.d/ directory.

Install MariaDB

Next, we will install the database server which is MariaDB. Type the following command in the terminal and press enter.