我试图部署django。所以在干净的VPS中安装了所有东西。我能够使用独角兽运行服务器,但我试图使用supervisord。所以我像过去一样关注this教程,但现在当我使用sudo supervisorctl start uniprogress
启动应用时,我收到错误uniprogress: ERROR (abnormal termination)
。您可以在下面找到日志文件。
文件:/opt/myapps/logs/gunicorn_supervisor.log
Starting uniprogress as uniusr
2014-04-24 04:54:30 [18053] [INFO] Starting gunicorn 18.0
Traceback (most recent call last):
File "/opt/myapps/uniprogress/../bin/gunicorn", line 9, in <module>
load_entry_point('gunicorn==18.0', 'console_scripts', 'gunicorn')()
File "/opt/myapps/local/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 71, in run
WSGIApplication("%(prog)s [OPTIONS] [APP_MODULE]").run()
File "/opt/myapps/local/lib/python2.7/site-packages/gunicorn/app/base.py", line 143, in run
Arbiter(self).run()
File "/opt/myapps/local/lib/python2.7/site-packages/gunicorn/arbiter.py", line 172, in run
self.start()
File "/opt/myapps/local/lib/python2.7/site-packages/gunicorn/arbiter.py", line 134, in start
self.LISTENERS = create_sockets(self.cfg, self.log)
File "/opt/myapps/local/lib/python2.7/site-packages/gunicorn/sock.py", line 198, in create_sockets
sock = sock_type(addr, conf, log)
File "/opt/myapps/local/lib/python2.7/site-packages/gunicorn/sock.py", line 99, in __init__
os.remove(addr)
OSError: [Errno 13] Permission denied: '/opt/myapps/run/gunicorn.sock'
Starting uniprogress as uniusr
2014-04-24 04:54:31 [18064] [INFO] Starting gunicorn 18.0
Traceback (most recent call last):
File "/opt/myapps/uniprogress/../bin/gunicorn", line 9, in <module>
load_entry_point('gunicorn==18.0', 'console_scripts', 'gunicorn')()
File "/opt/myapps/local/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 71, in run
WSGIApplication("%(prog)s [OPTIONS] [APP_MODULE]").run()
File "/opt/myapps/local/lib/python2.7/site-packages/gunicorn/app/base.py", line 143, in run
Arbiter(self).run()
File "/opt/myapps/local/lib/python2.7/site-packages/gunicorn/arbiter.py", line 172, in run
self.start()
File "/opt/myapps/local/lib/python2.7/site-packages/gunicorn/arbiter.py", line 134, in start
self.LISTENERS = create_sockets(self.cfg, self.log)
File "/opt/myapps/local/lib/python2.7/site-packages/gunicorn/sock.py", line 198, in create_sockets
sock = sock_type(addr, conf, log)
File "/opt/myapps/local/lib/python2.7/site-packages/gunicorn/sock.py", line 99, in __init__
os.remove(addr)
OSError: [Errno 13] Permission denied: '/opt/myapps/run/gunicorn.sock'
Starting uniprogress as uniusr
2014-04-24 04:54:31 [18064] [INFO] Starting gunicorn 18.0
Traceback (most recent call last):
File "/opt/myapps/uniprogress/../bin/gunicorn", line 9, in <module>
load_entry_point('gunicorn==18.0', 'console_scripts', 'gunicorn')()
File "/opt/myapps/local/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 71, in run
WSGIApplication("%(prog)s [OPTIONS] [APP_MODULE]").run()
File "/opt/myapps/local/lib/python2.7/site-packages/gunicorn/app/base.py", line 143, in run
Arbiter(self).run()
File "/opt/myapps/local/lib/python2.7/site-packages/gunicorn/arbiter.py", line 172, in run
self.start()
File "/opt/myapps/local/lib/python2.7/site-packages/gunicorn/arbiter.py", line 134, in start
self.LISTENERS = create_sockets(self.cfg, self.log)
File "/opt/myapps/local/lib/python2.7/site-packages/gunicorn/sock.py", line 198, in create_sockets
sock = sock_type(addr, conf, log)
File "/opt/myapps/local/lib/python2.7/site-packages/gunicorn/sock.py", line 99, in __init__
os.remove(addr)
OSError: [Errno 13] Permission denied: '/opt/myapps/run/gunicorn.sock'
Starting uniprogress as uniusr
2014-04-24 04:54:34 [18075] [INFO] Starting gunicorn 18.0
Traceback (most recent call last):
File "/opt/myapps/uniprogress/../bin/gunicorn", line 9, in <module>
load_entry_point('gunicorn==18.0', 'console_scripts', 'gunicorn')()
File "/opt/myapps/local/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 71, in run
WSGIApplication("%(prog)s [OPTIONS] [APP_MODULE]").run()
File "/opt/myapps/local/lib/python2.7/site-packages/gunicorn/app/base.py", line 143, in run
Arbiter(self).run()
File "/opt/myapps/local/lib/python2.7/site-packages/gunicorn/arbiter.py", line 172, in run
self.start()
File "/opt/myapps/local/lib/python2.7/site-packages/gunicorn/arbiter.py", line 134, in start
self.LISTENERS = create_sockets(self.cfg, self.log)
File "/opt/myapps/local/lib/python2.7/site-packages/gunicorn/sock.py", line 198, in create_sockets
sock = sock_type(addr, conf, log)
File "/opt/myapps/local/lib/python2.7/site-packages/gunicorn/sock.py", line 99, in __init__
os.remove(addr)
OSError: [Errno 13] Permission denied: '/opt/myapps/run/gunicorn.sock'
Starting uniprogress as uniusr
2014-04-24 04:54:37 [18086] [INFO] Starting gunicorn 18.0
Traceback (most recent call last):
File "/opt/myapps/uniprogress/../bin/gunicorn", line 9, in <module>
load_entry_point('gunicorn==18.0', 'console_scripts', 'gunicorn')()
File "/opt/myapps/local/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 71, in run
WSGIApplication("%(prog)s [OPTIONS] [APP_MODULE]").run()
File "/opt/myapps/local/lib/python2.7/site-packages/gunicorn/app/base.py", line 143, in run
Arbiter(self).run()
File "/opt/myapps/local/lib/python2.7/site-packages/gunicorn/arbiter.py", line 172, in run
self.start()
File "/opt/myapps/local/lib/python2.7/site-packages/gunicorn/arbiter.py", line 134, in start
self.LISTENERS = create_sockets(self.cfg, self.log)
File "/opt/myapps/local/lib/python2.7/site-packages/gunicorn/sock.py", line 198, in create_sockets
sock = sock_type(addr, conf, log)
File "/opt/myapps/local/lib/python2.7/site-packages/gunicorn/sock.py", line 99, in __init__
os.remove(addr)
OSError: [Errno 13] Permission denied: '/opt/myapps/run/gunicorn.sock'
答案 0 :(得分:5)
问题是,用户uniusr
不有权写入/opt/myapps
。所以我为了解决这个问题所做的就是以下内容。
sudo chown -R uniusr:users /opt/myapps
sudo chmod -R g+w /opt/myapps