繁体   English   中英

为哨兵设置Apache2 mod_wsgi

[英]Setup Apache2 mod_wsgi for sentry

我已经使用了通过以下apache configs安装在virtualenv上的哨兵8.1:

<VirtualHost x.x.x.x:80>
        WSGIDaemonProcess sentry python-path=/var/www/sentry-me:/var/www/sentry-me/env/lib/python2.7/site-packages
        WSGIProcessGroup sentry
        WSGIScriptAlias / /var/www/sentry-me/env/lib/python2.7/site-packages/sentry/wsgi.py
</VirtualHost>

并且所有工作正常,但是在将哨兵更新到8.3.3之后,我遇到了静态文件问题,并且在apache日志中,我看到以下异常:

[Sun May 01 16:38:46.106931 2016] [wsgi:error] [pid 19046] [remote 5.39.50.57:27319] Traceback (most recent call last):
[Sun May 01 16:38:46.106960 2016] [wsgi:error] [pid 19046] [remote 5.39.50.57:27319]   File "/var/www/sentry-me/env/lib/python2.7/site-packages/raven/middleware.py", line 48, in __call__
[Sun May 01 16:38:46.107006 2016] [wsgi:error] [pid 19046] [remote 5.39.50.57:27319]     for event in iterable:
[Sun May 01 16:38:46.107043 2016] [wsgi:error] [pid 19046] [remote 5.39.50.57:27319] KeyError: 'file like object has no read() method'

iterable类型是FileWrapper,我的哨兵virtualenv中当前还安装了以下软件包:

amqp==1.4.9
anyjson==0.3.3
BeautifulSoup==3.2.1
billiard==3.3.0.23
celery==3.1.18
cffi==1.6.0
click==6.6
contextlib2==0.5.1
cryptography==1.3.1
cssselect==0.9.1
cssutils==0.9.10
Django==1.6.11
django-bitfield==1.7.1
django-crispy-forms==1.4.0
django-debug-toolbar==1.3.2
django-jsonfield==0.9.13
django-paging==0.2.5
django-picklefield==0.3.2
django-recaptcha==1.0.5
django-social-auth==0.7.28
django-sudo==1.2.1
django-templatetag-sugar==1.0
djangorestframework==2.3.14
email-reply-parser==0.2.0
enum34==1.1.4
exam==0.10.5
hiredis==0.1.6
httplib2==0.9.2
idna==2.1
ipaddr==2.1.11
ipaddress==1.0.16
kombu==3.0.30
lxml==3.6.0
mock==1.0.1
ndg-httpsclient==0.4.0
oauth2==1.9.0.post1
petname==1.7
progressbar==2.3
psycopg2==2.6.1
py==1.4.31
pyasn1==0.1.9
pycparser==2.14
pyOpenSSL==16.0.0
pytest==2.6.4
pytest-django==2.9.1
python-dateutil==2.5.3
python-memcached==1.57
python-openid==2.2.5
pytz==2016.4
PyYAML==3.11
raven==5.13.0
rb==1.4
redis==2.10.5
requests==2.9.2
sentry==8.3.3
setproctitle==1.1.9
simplejson==3.8.2
six==1.10.0
South==1.0.1
sqlparse==0.1.19
statsd==3.1
toronado==0.0.7
ua-parser==0.7.0
urllib3==1.14
uWSGI==2.0.12

我如下更改了*/my-venv/lib/python2.7/site-packages/sentry/wsgi.py最新行,现在可以工作:

application = WSGIHandler()  # Sentry(FileWrapperWSGIHandler())

但是我认为哨兵无法监视和显示内部异常,在下一步中,我如下更改了application变量定义行:

application = Sentry(WSGIHandler())  # Sentry(FileWrapperWSGIHandler())

而且我认为这段代码可以正常工作。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM