Login into the server using non-root account and run the following commands.
sudo yum clean all
sudo yum -y update
Finally install apache
sudo yum -y install httpd
Start apache server
sudo systemctl start httpd.service
or
sudo service httpd start
Enable apache to start at boot
sudo systemctl enable httpd.service
Other useful commands
To check the status of Apache
sudo systemctl status httpd
or
sudo service httpd status
To stop Apache
sudo systemctl stop httpd.service
or
sudo service httpd stop
To restart Apache server
sudo systemctl restart httpd.service
or
sudo service httpd restart
After apache installation you may now install mariadb mysql database management system