Lab 5-2: LAMP Stack in AWS Part 2
Secure the database server:
Start the MariaDB server.
sudo systemctl start mariadbRun mysql_secure_installation.
sudo mysql_secure_installationWhen prompted, type a password for the root account.
Type the current root password. By default, the root account does not have a password set. Press Enter.
Type
Yto set a password, and type a secure password twice. . Make sure to store this password in a safe place.
Type
Yto remove the anonymous user accounts.Type
Yto disable the remote root login.Type
Yto remove the test database.Type
Yto reload the privilege tables and save your changes.
Set the MariaDB server to start at every boot, type the following command.
sudo systemctl enable mariadbSubmit: Screenshot showing the mariadb status as active

Install phpMyAdmin:
Install the required dependencies.
sudo yum install php-mbstring -yRestart Apache.
sudo systemctl restart httpdRestart php-fpm.
sudo systemctl restart php-fpmNavigate to the Apache document root at /var/www/html.
cd /var/www/htmlSelect a source package for the latest phpMyAdmin release from https://www.phpmyadmin.net/downloads Links to an external site.. To download the file directly to your instance, copy the link and paste it into a wget command, as in this example:
wget https://www.phpmyadmin.net/downloads/phpMyAdmin-latest-all-languages.tar.gzCreate a phpMyAdmin folder and extract the package into it with the following command.
mkdir phpMyAdmin && tar -xvzf phpMyAdmin-latest-all-languages.tar.gz -C phpMyAdmin --strip-components 1Delete the phpMyAdmin-latest-all-languages.tar.gz tarball.
rm phpMyAdmin-latest-all-languages.tar.gzSUBMIT: Screenshot showing successful PHP MyAdmin Login


Last updated