Configuring apache mariadb and phpmyadmin on RHEL 7

1 ) Install apache mariadb php and phpmyadmin on server by using following command

yum install php phpmyadmin httpd mariadb

2)  type below command and set the password for root

mysql_secure_installation

3) vim  /etc/httpd/conf.d/phpMyAdmin.conf

in the section/container <Directory /usr/share/phpMyAdmin/> </Directory>

add the following two lines.

Options Indexes FollowSymLinks
Require all granted

4) add firewall rules  and reload firewall

firewall-cmd –permanent –add-port=80/tcp
firewall-cmd –permanent –add-port=80/udp
firewall-cmd –permanent –add-port=443/tcp
firewall-cmd –permanent –add-port=443/udp

firewall-cmd –reload

OR

firewall-cmd –permanent –add-service=http

systemctl restart firewalld

5) Now restart apache service by typing

service httpd restart or

systemctl restart httpd.service

6) checking and adding apache and mariadb services to startup

systemctl is-enabled httpd

systemctl is-enabled mariadb

if it says its disabled then enable it by following command.

systemctl enable httpd

systemctl enable mariadb