To install and run a custom health check on both MySQL nodes, perform the following steps:
$ git clone https://github.com/AWS-First-Cloud-Journey/health-check-agent.git
$ cd health-check-agent
Edit the .env file to specify your MySQL connection information Edit the .env file to provide connection information to your MySQL database.
Create a Python virtual environment and activate it
$ python3 -m venv .venv
$ source .venv/bin/activate
$ pip install -r requirements.txt
$ export FLASK_APP=app.py
$ flask run -h 0.0.0.0 &
$deactivate
Log in to AWS Management Console and open the Amazon EC2 console at https://console.aws.amazon.com/ec2/.
Verify that the appropriate Region is selected.
Select Launch Instance (Initialize virtual machine).
Fill in the following information:
Perform the following steps:
The first time you perform these procedures, you will receive the message The authenticity of host (…) can’t be established.. Enter yes to continue.
sudo apt update && sudo apt upgrade
Let’s start by installing Apache. To do this, execute the following command:
sudo apt install apache2
To confirm that Apache has been installed successfully, execute the following command:
sudo systemctl status apache2
To check further, open a browser and visit your server’s IP address:
https://ip-address
sudo apt install php php-mysql
cd /tmp && wget https://wordpress.org/latest.tar.gz
tar -xvf latest.tar.gz
sudo cp -R wordpress /var/www/html/
sudo chown -R www-data:www-data /var/www/html/wordpress/
sudo chmod -R 755 /var/www/html/wordpress/
sudo mkdir /var/www/html/wordpress/wp-content/uploads
sudo chown -R www-data:www-data /var/www/html/wordpress/wp-content/uploads/
https://server-address/wordpress
You will see a WordPress installation guide and a list of credentials needed to set it up.
Fill out the form as shown below with the information specified when creating the WordPress database in MariaDB database. Do fill in the information about the database server and table prefix, then press the ‘Submit’ button.
If all the details are correct, you will be provided with a ‘Success’ message. Proceed to run the installation process.
Fill in the necessary additional information such as page title, Username and Password and save it somewhere safe if you forget. Be sure to use strong passwords.
Scroll down and press the ‘Install WordPress’ button. If everything goes smoothly, you will receive a ‘Success’ message as shown below.
Click the ‘Login’ button to access the login page of your new WordPress installation.
You will access and test your Wordpress website.