Configure LAMP server in KodeKloud 2.0

Hi Team,
as in the title the problem concerns “Configure LAMP server”
From all three APP servers, I have an output saying “App is able to connect to the database using user kodekloud_joy” (from index.php)
Below are the screenshots



Please review and let me know what is wrong here.
Regard

Hi @unis_mwasik_shhk

What was the statement for the task? port 80 or 8085 ?

Hello,

I did this task in different ways.
It is known that each time I had to set different ports in STAPP[01 02 03] (once I had a 3003, once I had an 8085)
I even logged into LBR and there I manually tried to set the endpoints for the backend
It didn’t do anything - I always get an error that on STAPP01 website is not working.
Below is a snapshot of a recent job

output-from-stlb01

And below is the task:

a. Install httpd, php and its dependencies on all app hosts.
b. Apache should serve on port 8085 within the apps.
c. Install/Configure MariaDB server on DB Server.
d. Create a database named kodekloud_db5 and create a database user named kodekloud_top identified as password <password>. Further make sure this newly created user is able to perform all operation on the database you created.
e. 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_top

Regard

Hi unis_mwasik_shhk,

Any update on the issue? How do you do this task? i seem stuck on the php side, installation and configuration. please help , thanks.

Hi,
I no longer remember this task, but I will paste what I have in my notes

yum install -y net-tools mc
yum install -y httpd php.x86_64 php-mysqlnd.x86_64
vi /etc/httpd/conf/httpd.conf
Listen 172.16.238.10:8085
Listen 172.16.238.11:8085
Listen 172.16.238.12:8085
sudo yum install mariadb-server
sudo systemctl start mariadb
sudo systemctl enable mariadb
sudo systemctl status mariadb
sudo mysql_secure_installation

CREATE USER kodekloud_gem IDENTIFIED BY ‘password’;
CREATE DATABASE kodekloud_db1;
GRANT ALL privileges ON kodekloud_db1.* TO kodekloud_gem;
mysql -u kodekloud_gem -p kodekloud_db1;

I also have such a script, which is constantly querying LoadBalancer. And then I pressed “check”.

#!/bin/bash
while true;
do
  curl http://stlb01 & echo -e "\n"
  sleep 0.5
done

Maybe the above posts will help
Greetings

1 Like

Thank you for sharing, I will update here if I have any findings.

Hi unis_mwasik_shhk,

I have successfully pass the task, here is the difference in steps:
after install httpd and php on each app server, just change Listen 80 to Listen 8086 or what ever port is given, do not need the ip address before the port number.
And in db server, dont run this command: sudo mysql_secure_installation.
I guess the testing algorithm is mess up by the secure installation.
I welcome any questions.

Thanks

HI,
I have a strange task acceptance error here:


Please help me understand why testing algorithm show this error?
When I click “App” button i see “App is able to connect to the database using user kodekloud_joy”.