I’ve performed below every steps still showing error, can you please rectify it. need help
Install httpd, PHP, and dependencies on all App Hosts
Install Apache and PHP
- sudo yum install -y httpd php php-mysqlnd
Start and enable httpd
- sudo systemctl start httpd
- sudo systemctl enable httpd
Configure Apache to serve on port 5000
- sudo sed -i ‘s/^Listen 80/Listen 5000/’ /etc/httpd/conf/httpd.conf
Install and configure MariaDB on DB Server
- sudo yum install -y mariadb-server
- sudo systemctl start mariadb
- sudo systemctl enable mariadb
Create the Database and User on the DB Server:
- sudo mysql -u root
- CREATE DATABASE kodekloud_db5;
- CREATE USER ‘kodekloud_gem’@‘%’ IDENTIFIED BY ‘TmPcZjtRQx’;
- GRANT ALL PRIVILEGES ON kodekloud_db5.* TO ‘kodekloud_gem’@‘%’;
- FLUSH PRIVILEGES;
- EXIT;
Configure WordPress on App Hosts
- cd /var/www/html
- sudo wget https://wordpress.org/latest.tar.gz
- sudo tar -xzf latest.tar.gz
- sudo cp -r wordpress/* .
- sudo rm -rf wordpress latest.tar.gz
sudo cp wp-config-sample.php wp-config.php
-
Edit
wp-config.phpto match DB -
define(‘DB_NAME’, ‘kodekloud_db5’);
-
define(‘DB_USER’, ‘kodekloud_gem’);
-
define(‘DB_PASSWORD’, ‘TmPcZjtRQx’);
-
define(‘DB_HOST’, ‘<DB_SERVER_IP>’);
Set correct permissions:
- sudo chown -R apache:apache /var/www/html
- sudo chmod -R 755 /var/www/html
Showing this error
Error establishing a database connection