0

I am trying to access the local host for my ubuntu server hosted on ec2 when I run

python manage.py runserver 0.0.0.0:8000

I have my security setting set to

    port 80     0.0.0.0/0

and I want to access

http://ec2-somenumber.us-west-2.compute.amazonaws.com:8000

currently it doesn't work in the command line, the app is currently running in port 8000

I ran

ubuntu@ip-somenumber:~/hello$ python manage.py runserver 0.0.0.0:8000
Validating models...

0 errors found
April 25, 2014 - 23:41:00
Django version 1.6.3, using settings 'hello.settings'
Starting development server at http://0.0.0.0:8000/

and checked

netstat -nao | grep 80

returns

tcp        0      0 127.0.0.1:8000          0.0.0.0:*               LISTEN      off (0.00/0/0)
udp6       0      0 :::18280                :::*                                off (0.00/0/0)
unix  2      [ ACC ]     SEQPACKET  LISTENING     6800     /run/udev/control
unix  3      [ ]         STREAM     CONNECTED     6780     

I also ran

ufw allow 8000
service ufw restart

but neither accessing the public dns or public ip

using the public ip

54.186.231.88:8000

or the public dns

ec2-54-186-231-88.us-west-2.compute.amazonaws.com:8000

worked

What could be the problem?

Thanks, any help would be greatly appreciated

7
  • Clarification on the down vote would be helpful in improving the quality of the question, does the question need more clarification, or is it too trivial and not appropriate?
    – Kevin
    Apr 26, 2014 at 0:36
  • do you have your security group allowing pot 8000 or 80? it seems you are mixing up the two in the question Apr 26, 2014 at 0:41
  • Yes thanks for the reply, I set up port 22, 443 and 80 on the amazon security group dashboard, with both port 443 and 80 allowing 0.0.0.0/0
    – Kevin
    Apr 26, 2014 at 0:42
  • yes but you want to expose port 8000, so you need to add TCP 8000 to allow your origin IP address or 0.0.0.0/0 (everybody) in your security group, or start django debug server in port 80 Apr 26, 2014 at 0:54
  • Thanks, I am not exactly sure what you mean by exposing port 8000, do you mean handling ec2 VPC? I am currently using the default VPC, doesn't that allows you to access port 8000 remotely? If not, what are the necessary steps I need to do to expose port 8000?
    – Kevin
    Apr 26, 2014 at 0:59

1 Answer 1

1

You need to add port 8000 in the security group (from web console for example) as well, otherwise the security group is blocking requests to your django port. Or you can start django test web server on port 80 since from your "grep" there's no service already there.

For details on Security Groups: http://docs.aws.amazon.com/AmazonVPC/latest/GettingStartedGuide/SecurityGroup.html

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .