A Journey in Learning

MySql, PHPMyAdmin, Moodle, & EC2 Hosting

I work as a volunteer for a non-profit organization called the Ahmadiyya Muslim Community, they mainly focus on humanitarian along with religious activities and currently they needed help with their AWS systems.

I volunteered my time and was given two tasks

  1. Apply SSL certificates to terminate on their locally hosted EC2 Moodle Bitnami server, whose domain hosting is on Bluehost.
  2. Make the system leaner and more highly available with a serverless architecture.

Today I was able to get the following accomplished

  1. Access the SQL database using PHPMyAdmin, this required me to reset the database username and password, after looking around online I figured out that this involved creating a Mysql-init file with the following code to reset the password. I learned about how to read the log files to determine when my syntax was off or if my command was not recognized.
UPDATE mysql.user SET Password=PASSWORD('NEW_PASSWORD') WHERE User='root';
FLUSH PRIVILEGES;

##I kept using the newer code because I though this MySql program 
would be up to date but it wasn't working, the wrong commands were:

ALTER USER 'root'@'127.0.0.1' IDENTIFIED BY 'NEW_PASSWORD';

##and

ALTER USER 'root'@'localhost' IDENTIFIED BY 'NEW_PASSWORD';

2. After getting access to the SQL server, I exported the data immediately. I also searched for mdl_user table to get access to my test server’s login information for Moodle. Moodle is a platform that allows educators to create online learning programs to teach remote students. I used the following SQL expression to update the password, I added ****** in place of my sensitive information.

update mdl_user set password = md5('*****') where username = '*****';

3. Lastly I was informed that they wanted to have a secure site, so I also used my knowledge of Bitnami to install SSL certificates to terminate on the production instance, to be sure I backed up the instance in case of failure. I used the the bncert-tool and my installation commands looked like:

wget -O bncert-linux-x64.run https://downloads.bitnami.com/files/bncert/latest/bncert-linux-x64.run
--2020-11-23 18:07:03--  https://downloads.bitnami.com/files/bncert/latest/bncert-linux-x64.run

sudo mkdir /opt/bitnami/bncert
sudo mv bncert-linux-x64.run /opt/bitnami/bncert/
sudo chmod +x /opt/bitnami/bncert/bncert-linux-x64.run
sudo ln -s /opt/bitnami/bncert/bncert-linux-x64.run /opt/bitnami/bncert-tool
sudo /opt/bitnami/bncert-tool

I am so far happy with my exposure to AWS today and will be continuing to make this setup more lean and available in the future.