【问题标题】:Error in UWSGI(with nginx)UWSGI 中的错误(使用 nginx)
【发布时间】:2015-03-11 16:13:52
【问题描述】:

错误:

      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/sites-available/tiles:

      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 开始(并且“python /usr/local/share/tiles/main.py”工作正常)和 nginx(host:88/xyz/osmpsk/8/148/77.png) 返回错误 500(内部服务器错误)。

【问题讨论】:

    标签: ubuntu nginx uwsgi


    【解决方案1】:

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

       uid = root
       gid = www-data
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-04-30
      • 1970-01-01
      • 2016-02-16
      • 2018-08-11
      • 2014-08-03
      • 2012-07-10
      • 1970-01-01
      • 2021-05-24
      相关资源
      最近更新 更多