2013-11-23 227 views
0

我試圖用gunicorn和nginx部署我的django項目,我遵循本指南:http://michal.karzynski.pl/blog/2013/06/09/django-nginx-gunicorn-virtualenv-supervisor/。我創建了bash腳本gunicorn_starthttp://pastebin.com/J86MQZYa 但是當我運行該腳本,我進入錯誤:Gunicorn在啓動時出現錯誤

[email protected]:~/webapps/hello_ice1/bin$ sudo ./gunicorn_start 
Starting icecream as root 
Traceback (most recent call last): 
File "/home/alex/webapps/hello_ice1/icecream/../bin/gunicorn", line 9, in <module> 
load_entry_point('gunicorn==18.0', 'console_scripts', 'gunicorn')() 
File "/home/alex/webapps/hello_ice1/local/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 71, in run 
WSGIApplication("%(prog)s [OPTIONS] [APP_MODULE]").run() 
File "/home/alex/webapps/hello_ice1/local/lib/python2.7/site-packages/gunicorn/app/base.py", line 28, in __init__ 
self.do_load_config() 
File "/home/alex/webapps/hello_ice1/local/lib/python2.7/site-packages/gunicorn/app/base.py", line 32, in do_load_config 
self.load_config() 
File "/home/alex/webapps/hello_ice1/local/lib/python2.7/site-packages/gunicorn/app/base.py", line 99, in load_config 
self.cfg.set(k.lower(), v) 
File "/home/alex/webapps/hello_ice1/local/lib/python2.7/site-packages/gunicorn/config.py", line 66, in set 
self.settings[name].set(value) 
File "/home/alex/webapps/hello_ice1/local/lib/python2.7/site-packages/gunicorn/config.py", line 248, in set 
self.value = self.validator(val) 
File "/home/alex/webapps/hello_ice1/local/lib/python2.7/site-packages/gunicorn/config.py", line 30, in _wrapped 
return func(*args, **kwargs) 
File "/home/alex/webapps/hello_ice1/local/lib/python2.7/site-packages/gunicorn/config.py", line 374, in validate_group 
raise ConfigError("No such group: '%s'" % val) 
gunicorn.errors.ConfigError: No such group: '' 

希望有人能幫助我:)

回答

0

您註釋掉組7號線,而你在第29行使用它。結果你傳遞空白的GROUP到gunicorn,對USER也是如此,如果你不想改變默認的USER或GROUP,那麼不要把它傳遞給gunicorn。

從文檔:

A valid group id (as an integer) or the name of a user that can be retrieved with a call to pwd.getgrnam(value) or None to not change the worker processes group.

http://docs.gunicorn.org/en/latest/configure.html#group

+0

謝謝你,我沒有看到這條線,當我再次執行我有這樣的錯誤:http://pastebin.com/fLmuE3ki。我必須自己創建.wsgi模塊嗎? – Betelgeuse

+0

看看本教程,是的,你必須在本教程結束時檢查目錄結構。我想你把應用程序名稱從「hello」改名爲「icecream」,所以你需要相應地重命名這些東西。 – jbub

+0

是的,目錄的名稱是正確的。唯一不同的是,dir'run'是一個根目錄,並且這些設置位於項目的子目錄中(我有icecream.settings.base.py,..local.py和production.py)。 – Betelgeuse