英語が下手でごめんなさい、私はフランス人です...誰も完璧ではありません。
Nginx(Debian Wheezy、Nginx 1.4.5、MySQL 14.14、PHP 5.4.4を使用したLEMP)にReviewBoardをインストールしようとしています。私のpythonインストールでは、Python 2.7.3、easy_install 0.6.24dev-r0、pip 1.1、virtualenv 1.11.4、およびgunicorn 18.0を使用しています。
インストールとレビューボードサイトの作成には成功しましたが、ブラウザからレビューボードサイトにアクセスできません。
レビューボードが Apache を推奨していることは知っていますが、Nginx にインストールすることも可能です。http://rramsden.ca/blog/2011/09/26/nginx-reviewboard/ への多くのリンクを除いて、ステップバイステップのチュートリアルは見つかりませんが、このリンクは無効になっています。誰かが別のリンクを知っていますか?
私のNginx confは次のとおりです。
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
誰にもアイデアはありますか?
ありがとう。
編集:次のチュートリアルに基づいて解決策を見つけました https://github.com/shuge/man/blob/master/sa/review/reviewboard/reviewboard-quick-install-guide.md 設定ファイルへのリンクがありません rb .m.com.conf はこのファイルを指します: https://github.com/shuge/man/blob/master/sa/review/reviewboard/rb.m.com.conf
そのデータを使用して、flup (fastcgi python モジュール) を追加し、conf を次のように変更しました。
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 を再起動すると、すべて正常に動作します。