Objectives

In this lab, you will:

Task 1: Use SSH to connect to an Amazon Linux EC2 instance


Task 2: Check the Status of the httpd Service

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.

  1. Check the status of the httpd service by using the systemctl commands as shown below and pressing ENTER

sudo systemctl status httpd.service

Untitled

  1. Check the status of the httpd service by using the systemctl commands as shown below and pressing ENTER

    
    sudo systemctl start httpd.service
    
  2. Check again the status of the httpd service by using the systemctl commands as shown below and pressing ENTER

    
    sudo systemctl status httpd.service
    

Untitled

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.

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


Task 3: Monitoring a Linux EC2 instance

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.