Python/Apache WSGI应用程序,插件插件失败后应用程序中断(500s)

2024-05-15 13:05:48 发布

您现在位置:Python中文网/ 问答频道 /正文

首先,我在MediaDrop论坛上问过这个问题,但是没有得到回应(流量很低)。这可能是我对Python和WSGI的具体误解,而不是MediaDrop特有的,所以我现在要问这个问题。

我们正在评估MediaDrop的使用情况,并在sandbox VM中以WSGI模式在Apache下启动并运行。

这是我第一次接触Python,所以我对发生了什么以及如何修复它有点一无所知。我通常是个PHP人。

首先,我安装了这个程序并在Apache的RHEL6.4上以WSGI模式运行。虚拟机运行的是python2.6.6。

文件上说媒体核心.wsgi文件位于install tarball中的特定位置,但实际上不在那里。我在GitHub上找到了它,并用它继续安装。但可能与这个问题无关。

应BA的要求,我下载了Mediacore熊猫插件。它的安装失败,因为它无法访问某些外部源来下载某些文件。我没有保留日志,因为我们最终决定不评估这个插件,因为它使用amazons3,我们希望在本地托管所有东西。

此后,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

葛瑞普·傅不是很好,但你知道。。。 我读到有点媒体核心.wsgi文件将触发Python代码的重新编译,因为它看到了新的修改日期,我希望这是正确的,但我也重新启动了Apache(几次)以达到良好的效果。运气不好。 Apache日志例外:

^{pr2}$

那么,我在这里遗漏了什么?如果不必要的话,我宁愿不把这个装置吹走,重新开始。


Tags: and文件thedevwsgiyourdocapache
1条回答
网友
1楼 · 发布于 2024-05-15 13:05:48

万一是个bug,我会下载pylint并在wsgi应用程序上运行它以确保没有错误。在

pylint /opt/MediaCore-0.10.3/mediacore.wsgi

您也可以通过管道将该命令发送到grep "E",以快速查找错误行。(pylint不会自动完成.wsgi文件,您需要在命令行中显式指定它们。)

编辑:另外,请验证您的wsgi插件是否与python2.6兼容。如果插件是python3或python2.7+,这可以解释错误。 另外,是否安装了libapache2 mod wsgi插件?(不确定这是否是redhat的确切名称)

相关问题 更多 >