我尝试用nginx和gunicorn运行django。我遵循教程http://michal.karzynski.pl/blog/2013/10/29/serving-multiple-django-applications-with-nginx-gunicorn-supervisor/,但我的结构有点不同。
/家庭/流浪/ SRC
.
├── manage.py
└── src
├── __init__.py
├── __init__.pyc
├── settings.py
├── settings.pyc
├── urls.py
├── urls.pyc
├── wsgi.py
└── wsgi.pyc
我的virtualenv是/ home / vagrant / venv。我跑的时候:
/home/vagrant/venv/bin/gunicorn_start
我收到错误:
sudo -u src ./gunicorn_start
Starting src as src
[2015-02-07 17:13:26 +0000] [11793] [DEBUG] Current configuration:
proxy_protocol: False
worker_connections: 1000
statsd_host: None
max_requests_jitter: 0
post_fork: <function post_fork at 0x1275758>
pythonpath: None
enable_stdio_inheritance: False
worker_class: sync
ssl_version: 3
suppress_ragged_eofs: True
syslog: False
syslog_facility: user
when_ready: <function when_ready at 0x1275488>
pre_fork: <function pre_fork at 0x12755f0>
cert_reqs: 0
preload_app: False
keepalive: 2
accesslog: None
group: 998
graceful_timeout: 30
do_handshake_on_connect: False
spew: False
workers: 3
proc_name: src
sendfile: True
pidfile: None
umask: 0
on_reload: <function on_reload at 0x1275320>
pre_exec: <function pre_exec at 0x1275cf8>
worker_tmp_dir: None
post_worker_init: <function post_worker_init at 0x12758c0>
limit_request_fields: 100
on_exit: <function on_exit at 0x1279410>
config: None
secure_scheme_headers: {'X-FORWARDED-PROTOCOL': 'ssl', 'X-FORWARDED-PROTO': 'https', 'X-FORWARDED-SSL': 'on'}
proxy_allow_ips: ['127.0.0.1']
pre_request: <function pre_request at 0x1275e60>
post_request: <function post_request at 0x1275f50>
user: 998
forwarded_allow_ips: ['127.0.0.1']
worker_int: <function worker_int at 0x1275a28>
threads: 1
max_requests: 0
limit_request_line: 4094
access_log_format: %(h)s %(l)s %(u)s %(t)s "%(r)s" %(s)s %(b)s "%(f)s" "%(a)s"
certfile: None
worker_exit: <function worker_exit at 0x1279140>
chdir: /home/vagrant/src/src
paste: None
default_proc_name: src.wsgi:application
errorlog: -
loglevel: debug
logconfig: None
syslog_addr: udp://localhost:514
syslog_prefix: None
daemon: False
ciphers: TLSv1
on_starting: <function on_starting at 0x12751b8>
worker_abort: <function worker_abort at 0x1275b90>
bind: ['unix:/home/vagrant/venv/run/gunicorn.sock']
raw_env: []
reload: False
check_config: False
limit_request_field_size: 8190
nworkers_changed: <function nworkers_changed at 0x12792a8>
timeout: 30
ca_certs: None
django_settings: None
tmp_upload_dir: None
keyfile: None
backlog: 2048
logger_class: gunicorn.glogging.Logger
statsd_prefix:
[2015-02-07 17:08:25 +0000] [11764] [INFO] Starting gunicorn 19.2.1
[2015-02-07 17:08:25 +0000] [11764] [ERROR] Retrying in 1 second.
[2015-02-07 17:08:26 +0000] [11764] [ERROR] Retrying in 1 second.
[2015-02-07 17:08:27 +0000] [11764] [ERROR] Retrying in 1 second.
[2015-02-07 17:08:28 +0000] [11764] [ERROR] Retrying in 1 second.
[2015-02-07 17:08:29 +0000] [11764] [ERROR] Retrying in 1 second.
[2015-02-07 17:08:30 +0000] [11764] [ERROR] Can't connect to /home/vagrant/venv/run/gunicorn.sock
gunicorn.sock存在