Note that there are some explanatory texts on larger screens.

plurals
  1. PODjango app with Nginx + uWSGI on Amazon EC2
    text
    copied!<p>I am trying to set a Django app on Amazon EC2 using Nginx + uWSGI.</p> <p>Following basic these tutorials</p> <p><a href="https://uwsgi.readthedocs.org/en/latest/tutorials/Django_and_nginx.html" rel="nofollow">https://uwsgi.readthedocs.org/en/latest/tutorials/Django_and_nginx.html</a> <a href="http://www.yaconiello.com/blog/setting-aws-ec2-instance-nginx-django-uwsgi-and-mysql/#sthash.TsdnEDM8.oK2geOwb.dpbs" rel="nofollow">http://www.yaconiello.com/blog/setting-aws-ec2-instance-nginx-django-uwsgi-and-mysql/#sthash.TsdnEDM8.oK2geOwb.dpbs</a></p> <p>Nginx welcome page appears ok, Instance is running, Loadbalancer is In Service, Route53 alias to loadbalancer. But I can't see my app...</p> <p>It appears that the app is running. I have tested local and it works.</p> <p>I typed on terminal</p> <pre><code>uwsgi --ini myproject_uwsgi.ini </code></pre> <p>And get this</p> <pre><code>[uWSGI] getting INI configuration from myproject_uwsgi.ini *** Starting uWSGI 1.9.15 (64bit) on [Wed Sep 11 06:14:04 2013] *** compiled with version: 4.7.3 on 10 September 2013 09:27:00 os: Linux-3.8.0-19-generic #29-Ubuntu SMP Wed Apr 17 18:16:28 UTC 2013 nodename: ip-10-252-80-160 machine: x86_64 clock source: unix detected number of CPU cores: 1 current working directory: /home/ubuntu/myproject writing pidfile to /tmp/myproject-master.pid detected binary path: /usr/local/bin/uwsgi your processes number limit is 4569 your memory page size is 4096 bytes *** WARNING: you have enabled harakiri without post buffering. Slow upload could be rejected on post-unbuffered webservers *** detected max file descriptor number: 1024 lock engine: pthread robust mutexes uwsgi socket 0 bound to UNIX address /tmp/myproject.sock fd 3 Python version: 2.7.4 (default, Apr 19 2013, 18:30:41) [GCC 4.7.3] Set PythonHome to /home/ubuntu/.virtualenvs/myproject *** Python threads support is disabled. You can enable it with --enable-threads *** Python main interpreter initialized at 0x1235b30 your server socket listen backlog is limited to 100 connections your mercy for graceful operations on workers is 60 seconds mapped 363880 bytes (355 KB) for 4 cores *** Operational MODE: preforking *** WSGI app 0 (mountpoint='') ready in 0 seconds on interpreter 0x1235b30 pid: 1500 (default app) *** uWSGI is running in multiple interpreter mode *** spawned uWSGI master process (pid: 1500) spawned uWSGI worker 1 (pid: 1501, cores: 1) spawned uWSGI worker 2 (pid: 1502, cores: 1) spawned uWSGI worker 3 (pid: 1503, cores: 1) spawned uWSGI worker 4 (pid: 1504, cores: 1) </code></pre> <p>And I try to see the error.log and I get nothing...</p> <p>EDIT</p> <p>myproject_uwsgi.ini</p> <pre><code>[uwsgi] # Django-related settings chdir = /home/ubuntu/myproject module = myproject.wsgi home = /home/ubuntu/.virtualenvs/myproject env = DJANGO_SETTINGS_MODULE=myproject.settings # process-related settings master = true processes = 4 socket = /tmp/myproject.sock chmod-socket = 664 harakiri = 20 vacuum = true max-requests = 5000 pidfile = /tmp/myproject-master.pid daemonize = /home/ubuntu/myproject/log/myproject.log </code></pre> <p>myproject_nginx.conf</p> <pre><code># the upstream component nginx needs to connect to upstream django { server unix:///tmp/myproject.sock; # server 127.0.0.1:8001; } # configuration of the server server { listen 80; server_name myproject.com www.myproject.com; charset utf-8; root /home/ubuntu/myproject/; client_max_body_size 75M; location /media { alias /home/ubuntu/myproject/myproject/media; } location /static { alias /home/ubuntu/myproject/myproject/static; } location / { uwsgi_pass unix:///tmp/myproject.sock; include /home/ubuntu/myproject/uwsgi_params; } } </code></pre> <p>`</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload