18/100 Configure LAMP Server

xFusionCorp Industries is planning to host a WordPress website on their infra in Stratos Datacenter. They have already done infrastructure configuration—for example, on the storage server they already have a shared directory /vaw/www/html that is mounted on each app host under /var/www/html directory.

Tasks:
1. Install httpd, php and its dependencies on all app hosts.
2. Apache should serve on port 6100 within the apps.
3. Install/Configure MariaDB server on DB Server.
4. Create a database named kodekloud_db8 and create a database user named kodekloud_sam identified as password 8FmzjvFU6S. Further make sure this newly created user is able to perform all operation on the database you created.
5. Finally you should be able to access the website on LBR link, by clicking on the App button on the top bar. You should see a message like App is able to connect to the database using user kodekloud_sam

Step 1 & 2

ssh tony@stapp01
sudo su -
dnf install php php-opcache php-gd php-curl php-mysqlnd -y
dnf install httpd -y
systemctl start httpd
systemctl status httpd
systemctl start php-fpm <-- FactCGI Process Manager
systemctl status php-fpm

# Change apache conf to serve port 6100
vi /etc/httpd/conf/httpd.conf

# Change Listen from 80 to 6100
Listen 6100
esc
:wq

systemctl restart httpd

Repeat the above process for stapp02 and stapp03

Step 3 & 4:

ssh peter@stdb01
sudo su -
dnf install mariadb mariadb-server -y
systemctl enable mariadb
systemctl status mariadb
systemctl restart mariadb

sudo -u root mysql;
create database kodekloud_db8;
GRANT ALL PRIVILEGES ON kodekloud_db8.* TO 'kodekloud_sam'@'%' identified by '8FmzjvFU6S';
select user,host from mysql.user;
+---------------+-----------+
| User          | Host      |
+---------------+-----------+
| kodekloud_sam | %         |
| mariadb.sys   | localhost |
| mysql         | localhost |
| root          | localhost |
+---------------+-----------+
Working!!