首先,我在MediaDrop论坛上问过这个问题,但没有回复(流量很低)。看起来它可能只是我对Python和WSGI的具体误解,而不是MediaDrop特定的,所以这就是我现在在这里问的原因。
我们正在评估MediaDrop的使用情况,并在沙盒虚拟机中以WSGI模式在Apache下运行(好了)。
这是我第一次接触Python,所以我对发生的事情以及如何解决这个问题一无所知。我通常是一个PHP人。
首先,我在WSELI.4上以WSGI模式在Apache下运行并运行。 VM正在运行Python 2.6.6。
仅供参考,文档说mediacore.wsgi文件位于安装tarball中的特定位置,但它实际上并不存在。我在GitHub上找到了它,并用它来继续安装。然而,可能与此问题无关。
应广管局的要求,我下载了Mediacore Panda插件。它的安装失败,因为它无法访问某些外部源来下载某些文件。我没有保留日志,因为我们最终决定不评估插件,因为它使用的是Amazon S3,我们希望在本地托管所有内容。
此后,Mediadrop被破坏,只返回500内部服务器错误。我已经看了Mediadrop的代码,看看Panda安装后是否留下了一些碎片,但我看不到任何碎片。我找到的实例是:
grep -Ri panda *
deployment.ini:# plugins = editviews, panda, seo
doc/dev/plugins.rst:created a cloud on
pandastream.com <http://pandastream.com/>
_ with
doc/dev/plugins.rst:your Panda Stream account.
doc/dev/plugins.rst:Click Add New engine > Panda Transcoding and Storage. You can also select which
doc/dev/plugins.rst:**2. Panda Storage Engine Fields**
doc/dev/plugins.rst:**3. Panda Account Details**
doc/dev/plugins.rst: Login to your PandaStream account, and at the dashboard click on your cloud.
doc/dev/plugins.rst: This is your PandaStream API Access Key. Login into PandaStream, and click
doc/dev/plugins.rst:when creating your Panda Stream Encoding Cloud. You can also enter any
mediacore/lib/auth/pylons_glue.py: # using the FunctionProtector as a decorator (e.g. in the panda plugin)
mediacore/config/deployment.ini_tmpl:# plugins = editviews, panda, seo
mediacore/public/scripts/third-party/squeezebox-1.1-rc4-yui-compressed.js: * SqueezeBox - Expandable Lightbox
mediacore/public/scripts/third-party/squeezebox-1.1-rc4.js: * SqueezeBox - Expandable Lightbox
mediacore/public/styles/third-party/squeezebox-1.1-rc4.css: * SqueezeBox - Expandable Lightbox
Grep-fu不是很好,但你明白了...... 我读到一点mediacore.wsgi文件将触发重新编译Python代码,因为它看到了新的修改日期,我希望这是正确的,但我也重新启动了Apache(几次)以获得良好的衡量标准。没运气。 Apache日志中的例外是:
[Fri Apr 04 11:27:13 2014] [error] [client xx.xx.xx.xx] mod_wsgi (pid=10464): Target WSGI script '/opt/MediaCore-0.10.3/mediacore.wsgi' cannot be loaded as Python module.
[Fri Apr 04 11:27:13 2014] [error] [client xx.xx.xx.xx] mod_wsgi (pid=10464): Exception occurred processing WSGI script '/opt/MediaCore-0.10.3/mediacore.wsgi'.
[Fri Apr 04 11:27:13 2014] [error] [client xx.xx.xx.xx] Traceback (most recent call last):
[Fri Apr 04 11:27:13 2014] [error] [client xx.xx.xx.xx] File "/opt/MediaCore-0.10.3/mediacore.wsgi", line 18, in <module>
[Fri Apr 04 11:27:13 2014] [error] [client xx.xx.xx.xx] application = loadapp('config:'+deployment_config)
[Fri Apr 04 11:27:13 2014] [error] [client xx.xx.xx.xx] File "/usr/lib/python2.6/site-packages/PasteDeploy-1.3.3-py2.6.egg/paste/deploy/loadwsgi.py", line 204, in loadapp
[Fri Apr 04 11:27:13 2014] [error] [client xx.xx.xx.xx] return loadobj(APP, uri, name=name, **kw)
[Fri Apr 04 11:27:13 2014] [error] [client xx.xx.xx.xx] File "/usr/lib/python2.6/site-packages/PasteDeploy-1.3.3-py2.6.egg/paste/deploy/loadwsgi.py", line 225, in loadobj
[Fri Apr 04 11:27:13 2014] [error] [client xx.xx.xx.xx] return context.create()
[Fri Apr 04 11:27:13 2014] [error] [client xx.xx.xx.xx] File "/usr/lib/python2.6/site-packages/PasteDeploy-1.3.3-py2.6.egg/paste/deploy/loadwsgi.py", line 625, in create
[Fri Apr 04 11:27:13 2014] [error] [client xx.xx.xx.xx] return self.object_type.invoke(self)
[Fri Apr 04 11:27:13 2014] [error] [client xx.xx.xx.xx] File "/usr/lib/python2.6/site-packages/PasteDeploy-1.3.3-py2.6.egg/paste/deploy/loadwsgi.py", line 110, in invoke
[Fri Apr 04 11:27:13 2014] [error] [client xx.xx.xx.xx] return fix_call(context.object, context.global_conf, **context.local_conf)
[Fri Apr 04 11:27:13 2014] [error] [client xx.xx.xx.xx] File "/usr/lib/python2.6/site-packages/PasteDeploy-1.3.3-py2.6.egg/paste/deploy/util/fixtypeerror.py", line 57, in fix_call
[Fri Apr 04 11:27:13 2014] [error] [client xx.xx.xx.xx] val = callable(*args, **kw)
[Fri Apr 04 11:27:13 2014] [error] [client xx.xx.xx.xx] File "/opt/MediaCore-0.10.3/mediacore/config/middleware.py", line 289, in make_app
[Fri Apr 04 11:27:13 2014] [error] [client xx.xx.xx.xx] config = load_environment(global_conf, app_conf)
[Fri Apr 04 11:27:13 2014] [error] [client xx.xx.xx.xx] File "/opt/MediaCore-0.10.3/mediacore/config/environment.py", line 41, in load_environment
[Fri Apr 04 11:27:13 2014] [error] [client xx.xx.xx.xx] plugin_mgr = PluginManager(config)
[Fri Apr 04 11:27:13 2014] [error] [client xx.xx.xx.xx] File "/opt/MediaCore-0.10.3/mediacore/plugin/__init__.py", line 50, in __init__
[Fri Apr 04 11:27:13 2014] [error] [client xx.xx.xx.xx] module = epoint.load()
[Fri Apr 04 11:27:13 2014] [error] [client xx.xx.xx.xx] File "/opt/mediadrop_venv/lib/python2.6/site-packages/pkg_resources.py", line 2047, in load
[Fri Apr 04 11:27:13 2014] [error] [client xx.xx.xx.xx] if require: self.require(env, installer)
[Fri Apr 04 11:27:13 2014] [error] [client xx.xx.xx.xx] File "/opt/mediadrop_venv/lib/python2.6/site-packages/pkg_resources.py", line 2060, in require
[Fri Apr 04 11:27:13 2014] [error] [client xx.xx.xx.xx] working_set.resolve(self.dist.requires(self.extras),env,installer)))
[Fri Apr 04 11:27:13 2014] [error] [client xx.xx.xx.xx] File "/opt/mediadrop_venv/lib/python2.6/site-packages/pkg_resources.py", line 588, in resolve
[Fri Apr 04 11:27:13 2014] [error] [client xx.xx.xx.xx] raise DistributionNotFound(req)
[Fri Apr 04 11:27:13 2014] [error] [client xx.xx.xx.xx] DistributionNotFound: panda==0.1.2
[Fri Apr 04 11:27:14 2014] [error] [client xx.xx.xx.xx] mod_wsgi (pid=10465): Target WSGI script '/opt/MediaCore-0.10.3/mediacore.wsgi' cannot be loaded as Python module.
[Fri Apr 04 11:27:14 2014] [error] [client xx.xx.xx.xx] mod_wsgi (pid=10465): Exception occurred processing WSGI script '/opt/MediaCore-0.10.3/mediacore.wsgi'.
[Fri Apr 04 11:27:14 2014] [error] [client xx.xx.xx.xx] Traceback (most recent call last):
[Fri Apr 04 11:27:14 2014] [error] [client xx.xx.xx.xx] File "/opt/MediaCore-0.10.3/mediacore.wsgi", line 18, in <module>
[Fri Apr 04 11:27:14 2014] [error] [client xx.xx.xx.xx] application = loadapp('config:'+deployment_config)
[Fri Apr 04 11:27:14 2014] [error] [client xx.xx.xx.xx] File "/usr/lib/python2.6/site-packages/PasteDeploy-1.3.3-py2.6.egg/paste/deploy/loadwsgi.py", line 204, in loadapp
[Fri Apr 04 11:27:14 2014] [error] [client xx.xx.xx.xx] return loadobj(APP, uri, name=name, **kw)
[Fri Apr 04 11:27:14 2014] [error] [client xx.xx.xx.xx] File "/usr/lib/python2.6/site-packages/PasteDeploy-1.3.3-py2.6.egg/paste/deploy/loadwsgi.py", line 225, in loadobj
[Fri Apr 04 11:27:14 2014] [error] [client xx.xx.xx.xx] return context.create()
[Fri Apr 04 11:27:14 2014] [error] [client xx.xx.xx.xx] File "/usr/lib/python2.6/site-packages/PasteDeploy-1.3.3-py2.6.egg/paste/deploy/loadwsgi.py", line 625, in create
[Fri Apr 04 11:27:14 2014] [error] [client xx.xx.xx.xx] return self.object_type.invoke(self)
[Fri Apr 04 11:27:14 2014] [error] [client xx.xx.xx.xx] File "/usr/lib/python2.6/site-packages/PasteDeploy-1.3.3-py2.6.egg/paste/deploy/loadwsgi.py", line 110, in invoke
[Fri Apr 04 11:27:14 2014] [error] [client xx.xx.xx.xx] return fix_call(context.object, context.global_conf, **context.local_conf)
[Fri Apr 04 11:27:14 2014] [error] [client xx.xx.xx.xx] File "/usr/lib/python2.6/site-packages/PasteDeploy-1.3.3-py2.6.egg/paste/deploy/util/fixtypeerror.py", line 57, in fix_call
[Fri Apr 04 11:27:14 2014] [error] [client xx.xx.xx.xx] val = callable(*args, **kw)
[Fri Apr 04 11:27:14 2014] [error] [client xx.xx.xx.xx] File "/opt/MediaCore-0.10.3/mediacore/config/middleware.py", line 289, in make_app
[Fri Apr 04 11:27:14 2014] [error] [client xx.xx.xx.xx] config = load_environment(global_conf, app_conf)
[Fri Apr 04 11:27:14 2014] [error] [client xx.xx.xx.xx] File "/opt/MediaCore-0.10.3/mediacore/config/environment.py", line 41, in load_environment
[Fri Apr 04 11:27:14 2014] [error] [client xx.xx.xx.xx] plugin_mgr = PluginManager(config)
[Fri Apr 04 11:27:14 2014] [error] [client xx.xx.xx.xx] File "/opt/MediaCore-0.10.3/mediacore/plugin/__init__.py", line 50, in __init__
[Fri Apr 04 11:27:14 2014] [error] [client xx.xx.xx.xx] module = epoint.load()
[Fri Apr 04 11:27:14 2014] [error] [client xx.xx.xx.xx] File "/opt/mediadrop_venv/lib/python2.6/site-packages/pkg_resources.py", line 2047, in load
[Fri Apr 04 11:27:14 2014] [error] [client xx.xx.xx.xx] if require: self.require(env, installer)
[Fri Apr 04 11:27:14 2014] [error] [client xx.xx.xx.xx] File "/opt/mediadrop_venv/lib/python2.6/site-packages/pkg_resources.py", line 2060, in require
[Fri Apr 04 11:27:14 2014] [error] [client xx.xx.xx.xx] working_set.resolve(self.dist.requires(self.extras),env,installer)))
[Fri Apr 04 11:27:14 2014] [error] [client xx.xx.xx.xx] File "/opt/mediadrop_venv/lib/python2.6/site-packages/pkg_resources.py", line 588, in resolve
[Fri Apr 04 11:27:14 2014] [error] [client xx.xx.xx.xx] raise DistributionNotFound(req)
[Fri Apr 04 11:27:14 2014] [error] [client xx.xx.xx.xx] DistributionNotFound: panda==0.1.2
那么,我在这里错过了什么?我宁愿不把这个装置吹走,如果我没有必要再重新开始。
答案 0 :(得分:0)
关于它是一个错误,我会下载pylint
并在wsgi应用程序上运行它以确保没有错误。
pylint /opt/MediaCore-0.10.3/mediacore.wsgi
您还可以将该命令传递给grep "E"
以快速查找错误行。 (pylint不会在.wsgi
文件上自动完成,您需要在命令行中明确指定它们。)
编辑:另外,请验证您的wsgi插件是否兼容python 2.6。如果插件是python3或python 2.7+,那可以解释错误。 另外,你是否安装了libapache2-mod-wsgi插件? (不确定这是否是redhat的确切名称)