0

I am a newbie to AWS and have created one instance, in which I am trying to set up my subdomain.

below are my OS details

No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 18.04.3 LTS
Release:        18.04
Codename:       bionic

I have allowed all the inbound and outbound rules from the security policy.

For some reason, I can only access port 21 an 22.
Unfortunately, port 80, 8080, 443 all are closed even though they are allowed and enabled in AWS security policy.

I also went ahead to Route 53 and created A records that point to the IP address of the instance for my subdomain and an NS record for the subdomain which I basically copied from my main root domain settings.

I can't access port 80, not 8080 nor 443. I can't access my subdomain website.

Below is the detail from running netstat -plant

(Not all processes could be identified, non-owned process info
 will not be shown, you would have to be root to see it all.)
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 127.0.0.53:53           0.0.0.0:*               LISTEN      -
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      -
tcp        0    880 172.31.6.221:22         27.255.44.66:63633      ESTABLISHED -
tcp        0      0 172.31.6.221:22         27.255.44.66:60659      ESTABLISHED -
tcp        0      0 172.31.6.221:22         27.255.44.66:61717      ESTABLISHED -
tcp        0      0 172.31.6.221:22         27.255.44.66:62106      ESTABLISHED -
tcp6       0      0 :::21                   :::*                    LISTEN      -
tcp6       0      0 :::22                   :::*                    LISTEN      -

I am not using an Elastic IP for my subdomain. Plus UFW is already inactive, I am not using that.

I wasted countless hours trying to figure out what's wrong

kenlukas
  • 2,886
  • 2
  • 14
  • 25
Jonib
  • 1
  • 1

1 Answers1

3

You have nothing running that is listening on that ports.

Your problem is not the firewall, if it were you would get a timeout. If the port is closed, nothing is listening on that port.

This is confirmed by your netstat output, which shows that nothing is listening.

Your service is not running. Start it.

Gerald Schneider
  • 19,757
  • 8
  • 52
  • 79
  • thanks for contributing.. i tried pinging my ip address but unfortunately i get request time out. plus when i go to online port checker website, thre is only port is opened. it shows others are clsoed. is there any particular command you want me to run and check it out? thanks for your help – Jonib Jun 26 '20 at 10:49
  • 2
    Pinging does not help in this case. It only shows if a VM is reachable via ICMP, which is most probably blocked in the firewall (hence the timeout). It says nothing about TCP odr UDP ports. – Gerald Schneider Jun 26 '20 at 11:23
  • 2
    There is nothing we can check. You haven't stated what you are intend to run on your instance. You need to start whatever you want to run, which is most probably a webserver like Apache or NginX (suggested by the ports 80 and 443). – Gerald Schneider Jun 26 '20 at 11:25
  • i am running a docker container sh file which basically contains these series of commands docker stop container docker rm container docker rmi web/sub:latest docker build -t web/sub:latest . docker run -it -d -p 80:80 -p 443:443 --name container web/sub:latest .... the behavior or port closed which i get above doesn't change even after running docker file. am i missing something? – Jonib Jun 26 '20 at 11:46
  • Check your container (`docker ps -a`). Most probably it's not running. – Gerald Schneider Jun 26 '20 at 11:48
  • 1
    this is what i get after running the command docker ps -a 575eb345298b web/sub:latest "/bin/sh -c 'npm run…" 13 minutes ago Exited (1) 13 minutes ago container – Jonib Jun 26 '20 at 11:52
  • 1
    Well, then find out why it exited. If you need help with this it would be a new question though, because it's a completely different problem. – Gerald Schneider Jun 26 '20 at 11:56
  • thanks for contributing and pointing me to the right direction. i will start a new question to see i could get some help to run this. at first i thought maybe it was port issue. – Jonib Jun 26 '20 at 11:57