gpt4 book ai didi

python - Mod_wsgi pylons (ckan) 安装不工作

转载 作者:太空狗 更新时间:2023-10-29 21:16:57 25 4
gpt4 key购买 nike

我正在根据以下说明设置 CKAN,一个 pylons 应用程序: http://packages.python.org/ckan/deployment.html

但是当我使用 IP 或主机名指向服务器(尚未设置 DNS)时,我只能看到 apache 的问候页面,这表明 ckan 应用程序未被加载。

这是我的 mod_wsgi 脚本:

import os
instance_dir = '/home/flavio/var/srvc/ckan.emap.fgv.br'
config_file = 'ckan.emap.fgv.br.ini'
pyenv_bin_dir = os.path.join(instance_dir, 'pyenv', 'bin')
activate_this = os.path.join(pyenv_bin_dir, 'activate_this.py')
execfile(activate_this, dict(__file__=activate_this))
from paste.deploy import loadapp
config_filepath = os.path.join(instance_dir, config_file)
from paste.script.util.logging_config import fileConfig
fileConfig(config_filepath)
application = loadapp('config:%s' % config_filepath)

这是我的虚拟主机配置:

<VirtualHost *:80>

ServerName dck093

ServerAlias dck093

WSGIScriptAlias / /home/flavio/var/srvc/ckan.emap.fgv.br/pyenv/bin/ckan.emap.fgv.br.py
# pass authorization info on (needed for rest api)
WSGIPassAuthorization On

ErrorLog /var/log/apache2/ckan.emap.fgv.br.error.log
CustomLog /var/log/apache2/ckan.emap.fgv.br.custom.log combined
<Directory /home/flavio/var/srvc/ckan.emap.fgv.br/pyenv/bin>
Order deny,allow
Allow from all
</Directory>
</VirtualHost>

我尝试禁用 000-default 站点(使用 a2dissite),但这并没有帮助。这样做之后我得到一个内部服务器错误页面。在修复了一些权限后,我设法获得了这个 Pylons 错误日志:

sudo tail /var/log/apache2/ckan.emap.fgv.br.error.log 
[Wed Mar 30 12:38:32 2011] [error] [client 10.250.48.110] app_iter = self.application(environ, start_response)
[Wed Mar 30 12:38:32 2011] [error] [client 10.250.48.110] File "/usr/lib/pymodules/python2.6/repoze/who/middleware.py", line 107, in __call__
[Wed Mar 30 12:38:32 2011] [error] [client 10.250.48.110] app_iter = app(environ, wrapper.wrap_start_response)
[Wed Mar 30 12:38:32 2011] [error] [client 10.250.48.110] File "/home/flavio/var/srvc/ckan.emap.fgv.br/pyenv/lib/python2.6/site-packages/pylons/middleware.py", line 201, in __call__
[Wed Mar 30 12:38:32 2011] [error] [client 10.250.48.110] self.app, environ, catch_exc_info=True)
[Wed Mar 30 12:38:32 2011] [error] [client 10.250.48.110] File "/home/flavio/var/srvc/ckan.emap.fgv.br/pyenv/lib/python2.6/site-packages/pylons/util.py", line 94, in call_wsgi_application
[Wed Mar 30 12:38:32 2011] [error] [client 10.250.48.110] app_iter = application(environ, start_response)
[Wed Mar 30 12:38:32 2011] [error] [client 10.250.48.110] File "/usr/lib/pymodules/python2.6/weberror/evalexception.py", line 226, in __call__
[Wed Mar 30 12:38:32 2011] [error] [client 10.250.48.110] "The EvalException middleware is not usable in a "
[Wed Mar 30 12:38:32 2011] [error] [client 10.250.48.110] AssertionError: The EvalException middleware is not usable in a multi-process environment

谁能指出我遗漏了什么?

最佳答案

由于您是在 apache 上进行部署,因此请确保您未处于交互式 Debug模式 - 这会使用 EvalException。在您的 Pylons 配置文件 (ckan.emap.fgv.br.ini) 中,确保您拥有:

[app:main]
set debug = false

关于python - Mod_wsgi pylons (ckan) 安装不工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5485790/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com