I am having problems setting up a server using uwsgi and nginx. This is my uwsgi ini file (and a symlink in vassals):
# ebook_uwsgi.ini file [uwsgi]
and this is my nginx config:
# mysite_nginx.conf
When I run uwsgi as my user (lucas03)
uwsgi --emperor /etc/uwsgi/vassals --uid www-data --gid www-data
this is output:
*** Starting uWSGI 2.0.10 (64bit) on [Tue May 12 20:43:19 2015] *** compiled with version: 4.7.2 on 14 April 2015 16:47:40 os: Linux-2.6.32-042stab104.1 #1 SMP Thu Jan 29 12:58:41 MSK 2015 nodename: zoltan machine: x86_64 clock source: unix pcre jit disabled detected number of CPU cores: 8 current working directory: /var detected binary path: /usr/local/bin/uwsgi *** WARNING: you are running uWSGI without its master process manager *** your processes number limit is 2062113 your memory page size is 4096 bytes detected max file descriptor number: 1024 *** starting uWSGI Emperor *** *** has_emperor mode detected (fd: 6) *** [uWSGI] getting INI configuration from ebook_uwsgi.ini *** Starting uWSGI 2.0.10 (64bit) on [Tue May 12 20:43:19 2015] *** compiled with version: 4.7.2 on 14 April 2015 16:47:40 os: Linux-2.6.32-042stab104.1 #1 SMP Thu Jan 29 12:58:41 MSK 2015 nodename: zoltan machine: x86_64 clock source: unix pcre jit disabled detected number of CPU cores: 8 current working directory: /etc/uwsgi/vassals detected binary path: /usr/local/bin/uwsgi chdir() to /var/www/django/ebook/ebook/wsgi/ebook/ your processes number limit is 2062113 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 socket 0 bound to UNIX address /var/uwsgi/ebook.sock fd 3 Python version: 2.7.3 (default, Mar 13 2014, 11:26:58) [GCC 4.7.2] Set PythonHome to /var/www/django/ebook *** Python threads support is disabled. You can enable it with --enable-threads *** Python main interpreter initialized at 0xea41a0 your server socket listen backlog is limited to 100 connections your mercy for graceful operations on workers is 60 seconds mapped 800448 bytes (781 KB) for 10 cores *** Operational MODE: preforking *** virtualenv is active WSGI app 0 (mountpoint='') ready in 0 seconds on interpreter 0xea41a0 pid: 6291 (default app) mountpoint already configured. skip. *** uWSGI is running in multiple interpreter mode *** spawned uWSGI master process (pid: 6291) Tue May 12 20:43:19 2015 - [emperor] vassal ebook_uwsgi.ini has been spawned spawned uWSGI worker 1 (pid: 6292, cores: 1) spawned uWSGI worker 2 (pid: 6293, cores: 1) Tue May 12 20:43:19 2015 - [emperor] vassal ebook_uwsgi.ini is ready to accept requests spawned uWSGI worker 3 (pid: 6294, cores: 1) spawned uWSGI worker 4 (pid: 6295, cores: 1) spawned uWSGI worker 5 (pid: 6296, cores: 1) spawned uWSGI worker 6 (pid: 6297, cores: 1) spawned uWSGI worker 7 (pid: 6298, cores: 1) spawned uWSGI worker 8 (pid: 6299, cores: 1) spawned uWSGI worker 9 (pid: 6300, cores: 1) spawned uWSGI worker 10 (pid: 6301, cores: 1)
Ebook.sock is created:
drwxrwxr-x 2 www-data www-data 3 mรกj 12 20:43 . drwxr-xr-x 13 root root 15 apr 14 16:29 .. srw-rw-r-- 1 lucas03 lucas03 0 mรกj 12 20:43 ebook.sock
but i get 502 Bad Gateway . Therefore, I change the owner of ebook.sock to www-data sudo chown www-data:www-data ebook.sock , my site is loaded correctly. Well, I thought it was great. Now I just need to run uwsgi so that it can create ebook.sock as user www data.
So I installed uwsgi to start at startup , I edited /etc/rc.local .
#!/bin/sh -e
However, after restarting the server, the ebook.sock file is not created at all, although uwsgi starts up. (I see this in ps aux | grep uwsgi ). So I thought it worked the same or similar, as if I were running this file as root.
So I run the /etc/rc.local file and it prints out:
*** Starting uWSGI 2.0.10 (64bit) on [Tue May 12 20:57:35 2015] *** compiled with version: 4.7.2 on 14 April 2015 16:47:40 os: Linux-2.6.32-042stab104.1
Since the output is shorter, I think the configuration files in /etc/uwsgi/vassals not loaded, and there are some problems with running imperial vassals.
Can anyone understand why? Thanks in advance for any response or comments.