I went through your post and I see you have been having trouble with the firewalld service. This task is not part of the two project labs in the end, which is the reason why it is not validated.
(Specifically in the all-in-one-server, since both DB and Web App are running on the same server it is not generally required.)
Here are the steps to be followed for that specific lab:
1 yum install -y mariadb-server
2 service mariadb start
3 systemctl enable mariadb
4 mysql (and the in the prompt)
MariaDB > CREATE DATABASE ecomdb;
MariaDB > CREATE USER 'ecomuser'@'localhost' IDENTIFIED BY 'ecompassword';
MariaDB > GRANT ALL PRIVILEGES ON *.* TO 'ecomuser'@'localhost';
MariaDB > FLUSH PRIVILEGES;
5 mysql < /opt/db-load-script.sql
6 yum install -y httpd php php-mysql
7 sed -i 's/index.html/index.php/g' /etc/httpd/conf/httpd.conf
8 service httpd start; systemctl enable httpd
9 yum install -y git; git clone https://github.com/kodekloudhub/learning-app-ecommerce.git /var/www/html/
10 sed -i ‘s/172.20.1.101/localhost/g’ /var/www/html/index.php
But I can see why this may have been confusing, as in the demo preceding the lab we do use it. I will fix that by either updating the video or including the task in the lab to install firewalld ( As I mentioned, the labs currently do not ask you to install and configure iptables/firewald)
I had a look at the error why it was failing in your attempt. That was because the “iptables” version running in the lab system was older and had to be updated for it to work.
- yum update
- yum reinstall iptables
- yum install firewalld
And the rest of the firewalld configuration.