Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/django/22.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 如何在Nginx下安装ReviewBoard?_Python_Django_Nginx_Gunicorn_Review Board - Fatal编程技术网

Python 如何在Nginx下安装ReviewBoard?

Python 如何在Nginx下安装ReviewBoard?,python,django,nginx,gunicorn,review-board,Python,Django,Nginx,Gunicorn,Review Board,对不起,我的英语很差,我是法国人。。。没有人是完美的 我正在尝试在Nginx下安装ReviewBoard(带有Debian Wheezy的LEMP、Nginx 1.4.5、MySQL 14.14、php5.4.4)。我的python安装使用python 2.7.3、easy_install 0.6.24dev-r0、pip 1.1、virtualenv 1.11.4和gunicorn 18.0 我成功地安装了所有这些东西并创建了一个reviewboard站点,但我无法从浏览器访问reviewbo

对不起,我的英语很差,我是法国人。。。没有人是完美的

我正在尝试在Nginx下安装ReviewBoard(带有Debian Wheezy的LEMP、Nginx 1.4.5、MySQL 14.14、php5.4.4)。我的python安装使用python 2.7.3、easy_install 0.6.24dev-r0、pip 1.1、virtualenv 1.11.4和gunicorn 18.0

我成功地安装了所有这些东西并创建了一个reviewboard站点,但我无法从浏览器访问reviewboard站点

我知道reviewboard推荐Apache,但也可以在Nginx上安装它。除了许多指向http://rramden.ca/blog/2011/09/26/nginx-reviewboard/的链接外,我找不到任何分步教程,但这个链接已经失效。有人知道另一个链接吗

我的Nginx配置是:

server {
    listen   80;
    server_name review.unskontrollables.org;
    root /var/www/review.unskontrollables.org/htdocs;

    # Error handlers
    error_page 500 502 503 504 /errordocs/500.html;

    # serve directly - analogous for static/staticfiles
    # Alias static media requests to filesystem
    location /media {
        alias /var/www/review.unskontrollables.org/htdocs/media;
        # if asset versioning is used
        if ($query_string) {
            expires max;
        }
    }
    location /static {
        alias /var/www/review.unskontrollables.org/htdocs/static;
    }
    location /errordocs {
        alias /var/www/review.unskontrollables.org/htdocs/errordocs;
    }
    location /favicon.ico {
        alias /var/www/review.unskontrollables.org/htdocs/static/rb/images/favicon.png;
    }
    #~ location /admin/media/ {
        #~ # this changes depending on your python version
        #~ root /usr/local/lib/python2.6/site-packages/django/contrib;
    #~ }

    location / {
        #alias /var/www/review.unskontrollables.org/htdocs/reviewboard.wsgi;
        #root /var/www/review.unskontrollables.org/htdocs/reviewboard.wsgi/;
        #proxy_pass_request_headers on;
        proxy_pass_header Server;
        proxy_set_header Host $proxy_host;
        proxy_redirect off;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Scheme $scheme;
        proxy_connect_timeout 10;
        proxy_read_timeout 10;
        proxy_pass http://127.0.0.1:8000/;
    }

    # Prevent the server from processing or allowing the rendering of
    # certain file types.
    location /media/uploaded {
        types {
            text/plain .html .htm .shtml .php .php3 .php4 .php5 .phps .asp .pl .py .fcgi .cgi .phtml .phtm .pht .jsp .sh .rb;
        }
    }
}
要启动WSGI服务器,我使用:

root@jotunn:~# source /opt/reviewboard/rbenv/bin/activate
(rbenv)root@jotunn:~# rb-site manage /var/www/review.unskontrollables.org/ runserver
Validating models...

0 errors found
Django version 1.4.10, using settings 'reviewboard.settings'
Development server is running at http://127.0.0.1:8000/
Quit the server with CONTROL-C.
如果我尝试访问

http://review.unskontrollables.org/
我被重定向到

http://127.0.0.1:8000/r/
控制台输出为:

/opt/reviewboard/rbenv/local/lib/python2.7/site-packages/Django-1.4.10-py2.7.egg/django/views/generic/list_detail.py:10: DeprecationWarning: Function-based generic views have been deprecated; use class-based views instead.
  DeprecationWarning
/opt/reviewboard/rbenv/local/lib/python2.7/site-packages/Django-1.4.10-py2.7.egg/django/conf/__init__.py:75: DeprecationWarning: The ADMIN_MEDIA_PREFIX setting has been removed; use STATIC_URL instead.
  "use STATIC_URL instead.", DeprecationWarning)
/opt/reviewboard/rbenv/local/lib/python2.7/site-packages/Django-1.4.10-py2.7.egg/django/views/generic/simple.py:8: DeprecationWarning: Function-based generic views have been deprecated; use class-based views instead.
  DeprecationWarning
[14/Mar/2014 16:59:50] "GET / HTTP/1.0" 302 0
有人有主意吗

谢谢

编辑:我根据以下教程找到了一个解决方案 配置文件rb.m.com.conf缺少的链接指向此文件:

有了这些数据,我刚刚添加了flup(fastcgi python模块),并将我的配置更改为:

server {
    listen   80;
    server_name review.unskontrollables.org;
    root /var/www/review.unskontrollables.org/htdocs;

    # Error handlers
    error_page 500 502 503 504 /errordocs/500.html;

    # serve directly - analogous for static/staticfiles
    # Alias static media requests to filesystem
    location /media {
        alias /var/www/review.unskontrollables.org/htdocs/media;
        # if asset versioning is used
        if ($query_string) {
            expires max;
        }
    }
    location /static {
        alias /var/www/review.unskontrollables.org/htdocs/static;
    }
    location /errordocs {
        alias /var/www/review.unskontrollables.org/htdocs/errordocs;
    }
    location /favicon.ico {
        alias /var/www/review.unskontrollables.org/htdocs/static/rb/images/favicon.png;
    }
    #~ location /admin/media/ {
        #~ # this changes depending on your python version
        #~ root /usr/local/lib/python2.6/site-packages/django/contrib;
    #~ }

    location / {
        fastcgi_pass 127.0.0.1:9090;      
        fastcgi_param PATH_INFO $fastcgi_script_name;      
        fastcgi_param REQUEST_METHOD $request_method;      
        fastcgi_param QUERY_STRING $query_string;      
        fastcgi_param CONTENT_TYPE $content_type;      
        fastcgi_param CONTENT_LENGTH $content_length;      
        fastcgi_pass_header Authorization;      
        fastcgi_intercept_errors off; 
    }

    # Prevent the server from processing or allowing the rendering of
    # certain file types.
    location /media/uploaded {
        types {
            text/plain .html .htm .shtml .php .php3 .php4 .php5 .phps .asp .pl .py .fcgi .cgi .phtml .phtm .pht .jsp .sh .rb;
        }
    }
}

重新启动nginx后,一切正常。

在这个评论板中,它是否有设置来设置它应该运行的URL?我相信这是应用程序的重定向。谢谢你的帮助,但这不是审查委员会的配置问题。正如我在编辑中所解释的(见上文),代理配置是错误的。有了fastcgi,一切都很好。到github的两个链接都被删除:
由于DMCA被删除,存储库不可用。