Installing LAMP on RHEL or Centos 7

Installing LAMP on RHEL or Centos 7 

Install httpd services – Web service

# yum install httpd

Restart httpd resvices

# systemctl restart httpd

Check status of httpd services

# systemctl status httpd

Stop httpd services

# systemctl stop httpd

Start httpd services

 # systemctl start httpd

Install php

# yum install php php-mysql php-pdo php-gd php-mbstring

Install and Configure MariaDB Database

# yum install mariadb-server mariadb

# systemctl start mariadb

# mysql_secure_installation

Now, Test database functionality by login to MariaDB using its root account and exit using quit statement as follows:

mysql -u root -p
MariaDB > SHOW VARIABLES;
MariaDB > quit

Install PhpMyAdmin

By default official RHEL 7 or CentOS 7 repositories doesn’t provide any binary package for PhpMyAdmin Web Interface. To install this we need to install repository.

# yum install http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el7.rf.x86_64.rpm
# yum install phpmyadmin

Now restart httpd services

# systemctl restart  httpd

Now enable all the installed Packages at startup on reboot

# systemctl enable mariadb
# systemctl enable httpd

 

Leave a Reply