uWSGI应用程序错误

时间:2013-06-20 17:14:10

标签: ubuntu nginx uwsgi

我跟着tutorial这封信,但我收到了以下错误。


uWSGI错误

找不到Python应用程序


以下是我的配置文件:

  1. /etc/nginx/sites-available/example.com(已被识别为../ sites-enabled / example.com)

    server {
        listen          80;
        server_name     $hostname;
        access_log /srv/www/example.com/logs/access.log;
        error_log /srv/www/example.com/logs/error.log;
    
    location / {
        #uwsgi_pass      127.0.0.1:9001;
        uwsgi_pass      unix:///run/uwsgi/app/sofitu.com/example.com.socket;
        include         uwsgi_params;
        uwsgi_param     UWSGI_SCHEME $scheme;
        uwsgi_param     SERVER_SOFTWARE    nginx/$nginx_version;
    
    }
    
    location /static {
        root   /srv/www/example.com/public_html/static/;
        index  index.html index.htm;
    
    }
    
    }
    
  2. /etc/uwsgi/apps-available/example.com.xml(符号链接到../ apps-enabled / example.com.xml)

    <uwsgi>
        <plugin>python</plugin>
        <socket>/run/uwsgi/app/example.com/example.com.socket</socket>
        <pythonpath>/srv/www/example.com/application/</pythonpath>
        <app mountpoint="/">
    
        <script>wsgi_configuration_module</script>
    
        </app>
        <master/>
        <processes>4</processes>
        <harakiri>60</harakiri>
        <reload-mercy>8</reload-mercy>
        <cpu-affinity>1</cpu-affinity>
        <stats>/tmp/stats.socket</stats>
        <max-requests>2000</max-requests>
        <limit-as>512</limit-as>
        <reload-on-as>256</reload-on-as>
        <reload-on-rss>192</reload-on-rss>
        <no-orphans/>
        <vacuum/>
    </uwsgi>
    
  3. /srv/www/example.com/application/wsgi_configuration_module.py

    import os
    import sys
    
    sys.path.append('/srv/www/example.com/application')
    
    os.environ['PYTHON_EGG_CACHE'] = '/srv/www/example.com/.python-egg'
    
    def application(environ, start_response):
        status = '200 OK'
        output = 'Hello World!'
    
        response_headers = [('Content-type', 'text/plain'),
                        ('Content-Length', str(len(output)))]
        start_response(status, response_headers)
    
        return [output]
    

  4. 我有两个问题我将在前言中说我对nginx和uWSGI配置都是全新的。

    1. 显然,为什么这不起作用?
    2. uWSGI错误日志在哪里?我需要定义他们的位置吗?

0 个答案:

没有答案