In this lab, you will:
Check the status of the service httpd to ensure that it is running, and that you can make an http connection to the local host IP address
You will also learn how to monitor your Amazon Linux 2 EC2 instance
Httpd is the service for the Apache http server that is installed on your host. This is a lightweight web server like the ones that run your favorite websites ( think let's .... say amazon.com ) . In this exercise you check the status of the httpd service, and start it using the systemctl command and verify the service is working.
Helpful Hint
You may have to use sudo to complete this exercise if you are not root.
sudo systemctl status httpd.service
Check the status of the httpd service by using the systemctl commands as shown below and pressing ENTER
sudo systemctl start httpd.service
Check again the status of the httpd service by using the systemctl commands as shown below and pressing ENTER
sudo systemctl status httpd.service
Now that the httpd is running, let's check it works correctly. Open a new tab on your browser and enter : http://<publicip>. Replace <publicip> with the public ip that you retrieved at the beginning of the course.
Figure: When httpd is successfully running, an Apache Test page will apear with general information about the proper operation of the Apache HTTP server.
You can now stop the service by entering the command below and pressing ENTER
sudo systemctl stop httpd.service
In this exercise you will use Linux commands to monitor the Amazon Linux2 EC2 instance. You will also open the AWS Console and log into CloudWatch to see how this service can provide you with data to monitor your instance.