0
these instructionsを使用してReviewBoardをレビューするソフトウェアのサーバーを設定しようとしています。私はUbuntu 16.04.3でPython 2.7、apacahe2、postgresを使用しています。私は、ドキュメントルートとこの設定を生成するためにセットアップスクリプトを使用しました。ReviewBoardサイトの設定時にWSGI処理エラーが発生しました
<VirtualHost *:80>
ServerName http://mywebsite-here.com
DocumentRoot "/var/www/reviewboard/htdocs"
# Error handlers
ErrorDocument 500 /errordocs/500.html
WSGIPassAuthorization On
WSGIScriptAlias "/" "/var/www/reviewboard/htdocs/reviewboard.wsgi/"
<Directory "/var/www/reviewboard/htdocs">
AllowOverride All
Options -Indexes +FollowSymLinks
Allow from all
</Directory>
# Prevent the server from processing or allowing the rendering of
# certain file types.
<Location "/media/uploaded">
SetHandler None
Options None
AddType text/plain .html .htm .shtml .php .php3 .php4 .php5 .phps .asp
AddType text/plain .pl .py .fcgi .cgi .phtml .phtm .pht .jsp .sh .rb
<IfModule mod_php5.c>
php_flag engine off
</IfModule>
# Force all uploaded media files to download.
<IfModule mod_headers.c>
Header set Content-Disposition "attachment"
</IfModule>
</Location>
# Alias static media requests to filesystem
Alias /media "/var/www/reviewboard/htdocs/media"
Alias /static "/var/www/reviewboard/htdocs/static"
Alias /errordocs "/var/www/reviewboard/htdocs/errordocs"
Alias /favicon.ico "/var/www/reviewboard/htdocs/static/rb/images/favicon.png"
</VirtualHost>
インデックスWSGIスクリプトは、私は、メインページをロードしようと500エラーを取得し続け、およびログがあれば、
[Mon Nov 06 11:26:37.499681 2017] [wsgi:error] [pid 4908:tid 140377516406528] [client <ip address>:64883] working_set = WorkingSet._build_master(), referer: http://mywebsite-here.com
[Mon Nov 06 11:26:37.499699 2017] [wsgi:error] [pid 4908:tid 140377516406528] [client <ip address>:64883] File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 664, in _build_master, referer: http://mywebsite-here.com
[Mon Nov 06 11:26:37.499704 2017] [wsgi:error] [pid 4908:tid 140377516406528] [client <ip address>:64883] ws.require(__requires__), referer: http://mywebsite-here.com
[Mon Nov 06 11:26:37.499709 2017] [wsgi:error] [pid 4908:tid 140377516406528] [client <ip address>:64883] File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 981, in require, referer: http://mywebsite-here.com
[Mon Nov 06 11:26:37.499715 2017] [wsgi:error] [pid 4908:tid 140377516406528] [client <ip address>:64883] needed = self.resolve(parse_requirements(requirements)), referer: http://mywebsite-here.com
[Mon Nov 06 11:26:37.499719 2017] [wsgi:error] [pid 4908:tid 140377516406528] [client <ip address>:64883] File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 867, in resolve, referer: http://mywebsite-here.com
[Mon Nov 06 11:26:37.499725 2017] [wsgi:error] [pid 4908:tid 140377516406528] [client <ip address>:64883] raise DistributionNotFound(req, requirers), referer: http://mywebsite-here.com
[Mon Nov 06 11:26:37.499795 2017] [wsgi:error] [pid 4908:tid 140377516406528] [client <ip address>:64883] DistributionNotFound: The 'idna>=2.1' distribution was not found and is required by cryptography, referer: http://mywebsite-here.com
[Mon Nov 06 11:27:37.620929 2017] [wsgi:error] [pid 4909:tid 140377390515968] [client <ip address>:64904] mod_wsgi (pid=4909): Target WSGI script '/var/www/reviewboard/htdocs/reviewboard.wsgi' cannot be loaded as Python module., referer: http://mywebsite-here.com
[Mon Nov 06 11:27:37.620989 2017] [wsgi:error] [pid 4909:tid 140377390515968] [client <ip address>:64904] mod_wsgi (pid=4909): Exception occurred processing WSGI script '/var/www/reviewboard/htdocs/reviewboard.wsgi'., referer: http://mywebsite-here.com
[Mon Nov 06 11:27:37.621027 2017] [wsgi:error] [pid 4909:tid 140377390515968] [client <ip address>:64904] Traceback (most recent call last):, referer: http://mywebsite-here.com
[Mon Nov 06 11:27:37.621144 2017] [wsgi:error] [pid 4909:tid 140377390515968] [client <ip address>:64904] File "/var/www/reviewboard/htdocs/reviewboard.wsgi", line 3, in <module>, referer: http://mywebsite-here.com
[Mon Nov 06 11:27:37.621202 2017] [wsgi:error] [pid 4909:tid 140377390515968] [client <ip address>:64904] import pkg_resources, referer: http://mywebsite-here.com
[Mon Nov 06 11:27:37.621237 2017] [wsgi:error] [pid 4909:tid 140377390515968] [client <ip address>:64904] File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 72, in <module>, referer: http://mywebsite-here.com
[Mon Nov 06 11:27:37.621270 2017] [wsgi:error] [pid 4909:tid 140377390515968] [client <ip address>:64904] from . import py31compat, referer: http://mywebsite-here.com
[Mon Nov 06 11:27:37.621305 2017] [wsgi:error] [pid 4909:tid 140377390515968] [client <ip address>:64904] ImportError: cannot import name py31compat, referer: http://mywebsite-here.com
[Mon Nov 06 11:28:41.695761 2017] [wsgi:error] [pid 4909:tid 140377373730560] [client <ip address>:64912] mod_wsgi (pid=4909): Target WSGI script '/var/www/reviewboard/htdocs/reviewboard.wsgi' cannot be loaded as Python module., referer: http://mywebsite-here.com
しかし、これらのエラーを含んで
import __main__
__main__.__requires__ = ['ReviewBoard']
import pkg_resources
import os
import sys
os.environ['DJANGO_SETTINGS_MODULE'] = "reviewboard.settings"
os.environ['PYTHON_EGG_CACHE'] = "/var/www/reviewboard/tmp/egg_cache"
os.environ['HOME'] = "/var/www/reviewboard/data"
os.environ['PYTHONPATH'] = '/var/www/reviewboard/conf:' + os.environ.get('PYTHONPATH', '')
sys.path = ['/var/www/reviewboard/conf'] + sys.path
import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()
です私は/ usr/bin/pythonでWSGIスクリプトの最初の3行を実行しますが、エラーは発生しません。さらに、これらのパッケージは存在するようです。
$ locate py31compat
/usr/local/lib/python2.7/dist-packages/pkg_resources/py31compat.py
/usr/local/lib/python2.7/dist-packages/pkg_resources/py31compat.pyc
/usr/local/lib/python2.7/dist-packages/setuptools/py31compat.py
/usr/local/lib/python2.7/dist-packages/setuptools/py31compat.pyc
$ python
Python 2.7.12 (default, Nov 19 2016, 06:48:10)
[GCC 5.4.0 20160609] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import idna
'2.6'
>>>