3

I'm a newcomer to AWS, and am using the free tier to test personal Django projects. However, when I try to access the IP address, the browser gives a timeout error. The site works locally, and the timeout error shows when accessing via wireless or wired connection.

The way I set up the site was using Bitnami DjangoStack, server is running via ./manage.py runserver 0.0.0.0:8080 I also bound an available IP address to the existing public DNS name. TCP Port 80 is open as HTTP with a source of 0.0.0.0/0.

I executed netstat -aon and got the output

tcp        0      0 10.4.89.232:22          141.114.79.244:38928    ESTABLISHED keepalive (3582.28/0/0)
tcp        0    272 10.4.89.232:22          141.114.79.244:40393    ESTABLISHED on (0.21/0/0)

These two addresses are from my site access requests, and I'm using the IP address and port 80 and 8080, but timeouts still occur.

The source code and database were set up via

  • Cloned git repository with site source code
  • Imported mysql dump into database
  • modified settings.py to reflect new database credentials
  • executed runserver command in server shell

No errors are showing up in the server logs. nmap produces

nmap -P0 -p80 54.2**.***.*

Starting Nmap 5.21 ( http://nmap.org ) at 2013-08-27 10:32 EDT
Nmap scan report for ec2-54-2**-***-*.compute-1.amazonaws.com (54.2**.***.*)
Host is up.
PORT   STATE    SERVICE
80/tcp filtered http

Nmap done: 1 IP address (1 host up) scanned in 2.08 seconds
slm
  • 7,615
  • 16
  • 56
  • 76
Jason
  • 131
  • 1
  • 4

3 Answers3

2

You say you're using AWS...the security groups is the "gotcha" in this case. Configure the security group to allow the ports you want and it should work.

Nathan C
  • 15,059
  • 4
  • 43
  • 62
1

According to Bitnami Django stack documentation here, if you start the server using their control scripts ctl.sh, the application runs on port 8080. If you use runserver, the application runs on port 8000 by default.

The easiest way to access the application is to open ports 8080 ( or 8000 if you have used runserver ) on your Security Groups and access the application as http://ec2-54-2**-***-*.compute-1.amazonaws.com:8080

The other ways include changing Apache configuration to run on port 80 or run HAProxy or Nginx to reverse proxy the request to this server.

Shyam Sundar C S
  • 1,063
  • 8
  • 12
1

Setting Security Groups can solve the problem.

SecurityGroups > Inbound > Edit inbound rules > Add new rules > All TCP

Detail of image is in the below enter image description here

Zgpeace
  • 121
  • 3