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

python manage.py runserver

I have my security setting set to

    port 80

and I want to access


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
Validating models...

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

and checked

netstat -nao | grep 80


tcp        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

or the public dns



What could be the problem?

Thanks, any help would be greatly appreciated

  • 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 '14 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 – LinuxDevOps Apr 26 '14 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 – Kevin Apr 26 '14 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 (everybody) in your security group, or start django debug server in port 80 – LinuxDevOps Apr 26 '14 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 '14 at 0:59

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.