UWSGI中的错误(使用nginx)

时间:2015-03-11 07:30:21

标签: ubuntu nginx uwsgi

错误:

      Wed Mar 11 11:06:20 2015 - mounting main:application on /
      Error opening file for reading: Permission denied

日志:

      Wed Mar 11 11:06:19 2015 - goodbye to uWSGI.
      [uWSGI] getting INI configuration from /usr/share/uwsgi/conf/default.ini
      [uWSGI] getting INI configuration from /etc/uwsgi/apps-enabled/tiles.ini
       Wed Mar 11 11:06:20 2015 - *** Starting uWSGI 1.0.3-debian (32bit) on [Wed Mar 11 11:06:20 2015] ***
       Wed Mar 11 11:06:20 2015 - compiled with version: 4.6.3 on 17 July 2012 02:24:04
       Wed Mar 11 11:06:20 2015 - current working directory: /
       Wed Mar 11 11:06:20 2015 - writing pidfile to /run/uwsgi/app/tiles/pid
       Wed Mar 11 11:06:20 2015 - detected binary path: /usr/bin/uwsgi-core
       Wed Mar 11 11:06:20 2015 - setgid() to 33
       Wed Mar 11 11:06:20 2015 - setuid() to 33
       Wed Mar 11 11:06:20 2015 - your memory page size is 4096 bytes
       Wed Mar 11 11:06:20 2015 - uwsgi socket 0 bound to UNIX address /run/uwsgi/app/tiles/socket fd 4
       Wed Mar 11 11:06:20 2015 - Python version: 2.7.3 (default, Aug  1 2012, 05:27:35)  [GCC 4.6.3]
       Wed Mar 11 11:06:20 2015 - Python main interpreter initialized at 0x9370220
       Wed Mar 11 11:06:20 2015 - your server socket listen backlog is limited to 100 connections
       Wed Mar 11 11:06:20 2015 - *** Operational MODE: preforking ***
       Wed Mar 11 11:06:20 2015 - mounting main:application on /
       Error opening file for reading: Permission denied
       Wed Mar 11 11:06:20 2015 - WSGI application 0 (mountpoint='/') ready on interpreter 0x9370220 pid: 24426 (default app)
       Wed Mar 11 11:06:20 2015 - *** uWSGI is running in multiple interpreter mode ***
       Wed Mar 11 11:06:20 2015 - spawned uWSGI master process (pid: 24426)
       Wed Mar 11 11:06:20 2015 - spawned uWSGI worker 1 (pid: 24438, cores: 1)
       Wed Mar 11 11:06:20 2015 - spawned uWSGI worker 2 (pid: 24439, cores: 1)
       Wed Mar 11 11:06:20 2015 - spawned uWSGI worker 3 (pid: 24440, cores: 1)
       Wed Mar 11 11:06:20 2015 - spawned uWSGI worker 4 (pid: 24441, cores: 1)
       Wed Mar 11 11:06:20 2015 - spawned uWSGI worker 5 (pid: 24442, cores: 1)
       Wed Mar 11 11:06:20 2015 - spawned uWSGI worker 6 (pid: 24443, cores: 1)
       Wed Mar 11 11:06:20 2015 - spawned uWSGI worker 7 (pid: 24444, cores: 1)
       Wed Mar 11 11:06:20 2015 - spawned uWSGI worker 8 (pid: 24445, cores: 1)

的/ etc / nginx的/位点可用/瓦:

      server {
              listen 0.0.0.0:80;
              #  server_name tiles.domain.tld;

              root /var/www;

              location @tiles {
                 uwsgi_pass unix:/var/run/uwsgi/app/tiles/socket;
                 include uwsgi_params;
              }

              location /tms/ {
                  root /var/cache/tiles/;
                  try_files $uri @tiles;
              }

              location /xyz/ {
                  root /var/cache/tiles/;
                  try_files $uri @tiles;
              }
       }

/etc/uwsgi/apps-available/tiles.ini:

        [uwsgi]

          procname = uwsgi-tiles
          procname-master = uwsgi-tiles-master

          chdir = /usr/local/share/tiles
          #module = app:application
          mount = /=main:application
          plugin = python27
          master = true
          processes = 8

我是从http://vladimir-stupin.blogspot.ru/2014/09/python-mapnik-bottle.html(和#34; python /usr/local/share/tiles/main.py"工作正常)和nginx(主持人:88 / xyz / osmpsk / 8 / 148 / 77.png)返回错误500(内部服务器错误)。

1 个答案:

答案 0 :(得分:0)

在/etc/uwsgi/apps-available/tiles.ini中添加:

   uid = root
   gid = www-data