The most common web platform out there is Linux, Apache, MySQL, and PHP or LAMP for short. Below is my quick guide for setting up LAMP on CentOS 7 (or RHEL 7).
For this configuration CentOS was installed with minimal packages (no GUI) and all commands are run with root privileges.
Core components of Apache, MariaDB (MySQL), and PHP.
yum install httpd mariadb-server mariadb php php-mysql
systemctl start httpd systemctl start mariadb
Secure MariaDB (MySQL)
Follow the prompts to set a SQL root password and secure the DB server.
Automatic Start Up
systemctl enable httpd.service systemctl enable mariadb.service
Verify Apache (httpd) is running by browsing to: http://<server_ip_address>/
Verify PHP / MariaDB is working with Apache by creating a file info.php in /var/www/html/ with the contents:
<?php phpinfo(); ?>
Browse to: http://<server_ip_address>/info.php
Verify PHP/MySQL linking in above.
phpMyAdmin the most common tool for the administration of MySQL over the web, supporting a wide range of operations on MySQL, and MariaDB. Operations including managing databases, tables, users, permissions, etc. can be performed via the user interface.
yum install epel-release yum install phpmyadmin
Change any lines that contain “Require ip 127.0.0.1” or “Allow from 127.0.0.1” to refer to your workstations IP address. The locations in the file that must be changed are:
Require ip your_workstation_IP_address . . . Allow from your_workstation_IP_address . . . Require ip your_workstation_IP_address . . . Allow from your_workstation_IP_address
systemctl restart httpd.service
Browse to http://<server_ip_address>/phpmyadmin
Finally it’s time to allow access to your web server.
sudo firewall-cmd --permanent --zone=public --add-service=http sudo firewall-cmd --permanent --zone=public --add-service=https sudo firewall-cmd --reload