Skip to content

site can't be reached

0

In all the exercises I did for AWS Cloud Technical Essentials, none of the pages I tried to view using the public IP address worked. I did every solution I saw on YouTube and here on this website, but they didn't work.

I did the following:

  1. Checked the sg to see if I set the http, ssh, https accessible anywhere.
  2. I also connect to the shell, and installed https, checked the status and restarted the server. This one I was able to display something. It displayed "It works!". Every time I do these steps, the page always displays the same
  3. I also tried to add ICMP in the security group. I was able to ping the IP address, but then, the page still displays "site can't be reached"
  4. I also disabled my antivirus
  5. I also checked my proxy settings, and follow the steps I read to clear them
  6. I also added the IP address in the list of sites that are safe to browse in my chrome settings
  7. I DID ALL THESE in both my Mac and Windows computers.

If I made a mistake or I missed something in the steps provided for the exercises, I don't believe that I did in all the exercises, especially the first few where the steps were still simple and easy

Any help will be greatly appreciated. Thanks.

  • Can you post the User Data script used in this lab?

asked 3 years ago771 views
4 Answers
1
Accepted Answer

Make sure to choose Amazon Linux 2 instead of Amazon Linux 2023 when you launch the instance. In the console, Amazon Linux 2023 is now the default. You will need to terminate the existing instance and create a new one.

AWS
EXPERT
answered 3 years ago
0

What is the HTTP status code returned when connecting to EC2 and executing the following command?

curl localhost -o /dev/null -w '%{http_code}\n' -s

In case of 5XX error, there is most likely a problem with the web server configuration.

EXPERT
answered 3 years ago
  • It is possible that the web server is not started.
    Please execute the following command to start it.

    sudo systemctl start httpd
    

    or

    sudo systemctl start apache 
    

    or

    sudo systemctl start nginx
    
  • Did you solve the problem here?

  • Thanks for your answer. This is what I got.

    [ec2-user@ip- ~]$ curl localhost -o /dev/null -w '%{http_code}\n' -s 000

0

[ec2-user@ip- ~]$ sudo systemctl start httpd Failed to start httpd.service: Unit httpd.service not found.

[ec2-user@ip- ~]$ sudo yum install httpd Last metadata expiration check: 1 day, 3:24:20 ago on Thu Apr 6 16:11:44 2023.

ec2-user@ip- ~]$ sudo systemctl start httpd [ec2-user@ip- ~]$ service httpd status Redirecting to /bin/systemctl status httpd.service ● httpd.service - The Apache HTTP Server Loaded: loaded (/usr/lib/systemd/system/httpd.service; disabled; preset: disabled) Active: active (running) since Fri 2023-04-07 19:37:10 UTC; 23s ago Docs: man:httpd.service(8) Main PID: 25460 (httpd) Status: "Total requests: 0; Idle/Busy workers 100/0;Requests/sec: 0; Bytes served/sec: 0 B/sec" Tasks: 177 (limit: 1112) Memory: 12.8M CPU: 77ms CGroup: /system.slice/httpd.service ├─25460 /usr/sbin/httpd -DFOREGROUND ├─25472 /usr/sbin/httpd -DFOREGROUND ├─25473 /usr/sbin/httpd -DFOREGROUND ├─25474 /usr/sbin/httpd -DFOREGROUND └─25475 /usr/sbin/httpd -DFOREGROUND

Apr 07 19:37:10 ip-.us-east-2.compute.internal systemd[1]: Starting httpd.service - The Apache HTTP Server... Apr 07 19:37:10 ip-.us-east-2.compute.internal systemd[1]: Started httpd.service - The Apache HTTP Server. Apr 07 19:37:10 ip-.us-east-2.compute.internal httpd[25460]: Server configured, listening on: port 80

############################### When I entered my IP address in my browser, it displayed this: It works!

BUT, that's not the output I was expecting. I think that "It works!" is a default message.

answered 3 years ago
  • Really need to see the User Data script from the lab to determine what application is running. We don't know if Apache is even the web server.

0

To: kentrad

I pasted below my user data. Thank you.

#!/bin/bash -ex wget https://aws-tc-largeobjects.s3-us-west-2.amazonaws.com/DEV-AWS-MO-GCNv2/FlaskApp.zip unzip FlaskApp.zip cd FlaskApp/ yum -y install python3 mysql pip3 install -r requirements.txt amazon-linux-extras install epel yum -y install stress export PHOTOS_BUCKET=${SUB_PHOTOS_BUCKET} export AWS_DEFAULT_REGION=<INSERT REGION HERE> export DYNAMO_MODE=on FLASK_APP=application.py /usr/local/bin/flask run --host=0.0.0.0 --port=80

answered 3 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.