Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

EC2 hosts Django with IP address can't be assigned-to error

I have a EC2 instance want to run Django app on it. This EC2 instance already have a Apache server on port 80. Now I want to host my Django project on port 9090. The instance has static IP 200.200.200.200.

ubuntu@ip-10-242-229-213:~/flanders$ python manage.py runserver 200.200.200.200:9090 Validating models...

0 errors found Django version 1.3.1, using settings 'flanders.settings' Development server is running at http://200.200.200.200:9090/ Quit the server with CONTROL-C. Error: That IP address can't be assigned-to. ubuntu@ip-10-242-229-213:~/flanders$

It tells me Error: That IP address can't be assigned-to, So I change to

ubuntu@ip-10-242-229-213:~/flanders$ python manage.py runserver 127.0.0.1:9090 Validating models...

0 errors found Django version 1.3.1, using settings 'flanders.settings' Development server is running at http://127.0.0.1:9090/ Quit the server with CONTROL-C.

The application starts without problem but when I try to access it http://200.200.200.200:9090/flandersapp/tags, I doesn't work. By the way, I allow port 9090 in my security setting.

like image 917
Simon Guo Avatar asked Feb 17 '12 04:02

Simon Guo


1 Answers

I solved myself. I need to use the private IP provided by EC2 instead of public IP

like image 191
Simon Guo Avatar answered Oct 16 '22 20:10

Simon Guo