Я новичок в работе с серверами. Я пытаюсь запустить Django на AWS Ubuntu 12.04 с uwsgi и nginx.
Я нашел руководство, за которым следил: http://uwsgi.readthedocs.org/en/latest/tutorials/Django_and_nginx.html
Я создал виртуальный evn:
virtualenv uwsgi-tutorial
cd uwsgi-tutorial
source bin/activate
Затем я установил Python и Django с помощью pip. Затем я начал проект Django под названием mysite
Потом установил uwsgi
pip install uwsgi
Затем я создал файл test.py:
def application(env, start_response):
start_response('200 OK', [('Content-Type','text/html')])
return "Hello World"
Затем я запустил uwsgi:
uwsgi --http :8000 --wsgi-file test.py
В руководстве утверждается, что если я указываю в браузере http://myip:8000
Я должен увидеть Hello World
в моем браузере. Однако мой браузер ждет, как будто он вообще не подключается к серверу.
Когда я бегу uwsgi --http :8000 --wsgi-file test.py
Я получаю такой вывод в терминале:
*** Starting uWSGI 2.0.1 (64bit) on [Tue Feb 25 15:26:43 2014] ***
compiled with version: 4.6.3 on 25 February 2014 05:36:40
os: Linux-3.2.0-59-virtual #90-Ubuntu SMP Tue Jan 7 23:02:33 UTC 2014
nodename: ip-172-31-13-105
machine: x86_64
clock source: unix
detected number of CPU cores: 1
current working directory: /home/spencer/uwsgi-tutorial/mysite
detected binary path: /home/spencer/uwsgi-tutorial/bin/uwsgi
!!! no internal routing support, rebuild with pcre support !!!
*** WARNING: you are running uWSGI without its master process manager ***
your processes number limit is 4592
your memory page size is 4096 bytes
detected max file descriptor number: 1024
lock engine: pthread robust mutexes
thunder lock: disabled (you can enable it with --thunder-lock)
uWSGI http bound on :8000 fd 4
spawned uWSGI http 1 (pid: 9729)
uwsgi socket 0 bound to TCP address 127.0.0.1:37347 (port auto-assigned) fd 3
Python version: 2.7.3 (default, Sep 26 2013, 20:13:52) [GCC 4.6.3]
*** Python threads support is disabled. You can enable it with --enable-threads ***
Python main interpreter initialized at 0x1bbc670
your server socket listen backlog is limited to 100 connections
your mercy for graceful operations on workers is 60 seconds
mapped 72760 bytes (71 KB) for 1 cores
*** Operational MODE: single process ***
WSGI app 0 (mountpoint='') ready in 0 seconds on interpreter 0x1bbc670 pid: 9728 (default app)
*** uWSGI is running in multiple interpreter mode ***
spawned uWSGI worker 1 (and the only) (pid: 9728, cores: 1)
Возможно, я упускаю что-то очевидное или не совсем понимаю, но я очень благодарен за любую помощь!
Я никогда не открывал порт 80 ... ошибка новичка. Я надеюсь, что кто-то с такой же проблемой наткнется на это и поймет, что им нужно ОТКРЫТЬ ПОРТ 80