Здравствуйте уважаемые. Собираю хостинг для django проектов по этому мануалу. Столкнулся с проблемой 502 Bad Gateway. В лог сыпятся ошибки:
18:45:58 [crit] 2575#0: *88 connect() to unix:/var/run/uwsgi/blog.sock failed (13: Permission denied) while connecting to upstream, client: 192.168.0.5, server: example.com, request: "GET / HTTP/1.1", upstream: "uwsgi://unix:/var/run/uwsgi/blog.sock:", host: "example.com"
Конфиг виртуального хоста nginx:
upstream wsgi_blog {
server unix:/var/run/uwsgi/blog.sock;
}
server {
listen 80;
server_name example.com;
charset utf8;
autoindex off;
access_log /var/log/nginx/blog_access.log;
error_log /var/log/nginx/blog_error.log error;
set $project_home /home/django/projects/blog;
location /static_common {
root $project_home;
expires 1d;
}
location / {
try_files $uri @django;
}
location @django {
uwsgi_pass wsgi_blog;
include uwsgi_params;
}
}
Конфиг uwsgi:
[uwsgi]
virtualenv = /home/django/env/%n
chdir = /home/django/projects/%n
plugins = python34
pythonpath = ..
socket = /var/run/uwsgi/%n.sock
chmod-socket = 666
logto = /var/log/uwsgi/%n.log
env = DJANGO_SETTINGS_MODULE=%n.settings
module = django.core.handlers.wsgi:WSGIHandler()
buffer-size = 32768
Операционая система gentoo, uwsgi собирался с этими флагами:
www-servers/uwsgi-2.0.9::gentoo USE="python -apache2 -caps -cgi -debug -embedded -expat -jemalloc -json -lua -mono -pcre -perl -php -python_asyncio -python_gevent -routing -ruby (-selinux) -ssl -xml -yajl -yaml -zeromq" PHP_TARGETS="php5-5 (-php5-4)" PYTHON_TARGETS="python2_7 python3_4 -python3_3" RUBY_TARGETS="ruby20" UWSGI_PLUGINS="http* router_access* router_cache* router_http* router_memcached router_rewrite router_static router_uwsgi -alarm_curl -alarm_xmpp -cache -carbon -cheaper_busyness -clock_monotonic -clock_realtime -corerouter -curl_cron -dumbloop -echo -emperor_amqp -emperor_pg -emperor_zeromq -fastrouter -forkptyrouter -geoip -graylog2 -ldap -legion_cache_fetch -logcrypto -logfile -logpipe -logsocket -mongodblog -nagios -notfound -pam -ping -rados -rawrouter -redislog -router_basicauth -router_expires -router_hash -router_metrics -router_radius -router_redirect -router_redis -router_spnego -router_xmldir -rpc -rrdtool -rsyslog -signal -spooler -sqlite* -ssi -sslrouter -stats_pusher_statsd -symcall -syslog -systemd_logger -transformation_chunked -transformation_gzip -transformation_offload -transformation_tofile -transformation_toupper -tuntap -ugreen -webdav -xattr -xslt -zabbix -zergpool"
Что я делаю не так?