首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >使用mod_fcgid在Apache上部署幽门

使用mod_fcgid在Apache上部署幽门
EN

Server Fault用户
提问于 2010-07-11 20:48:06
回答 1查看 607关注 0票数 1

我试着用找到这里的指令部署我的幽门应用程序。当我访问域的根目录时,这只会加载默认的幽门页面。当我试图进入任何路径时,我都会收到消息。

代码语言:javascript
复制
Unhandled Exception

An unhandled exception was thrown by the application.

当我查看我的应用程序的错误日志和Apache错误日志时,似乎幽门总是试图将事情路由到错误控制器。但是,请注意,上面的消息不是我的错误控制器应该输出的信息。

对检查什么有建议吗?我喜欢用幽门进行开发,但这是我第一次尝试部署。我在多个不同的web服务器上尝试过多个配置,但我没有任何运气。

更新:下面是我的幽门应用程序的配置(注释去掉,以使它更短一点)

代码语言:javascript
复制
[DEFAULT]
smtp_server = localhost
error_email_from = paste@localhost

[server:main]
use = egg:PasteScript#flup_fcgi_thread

[app:main]
use = egg:linkdb
full_stack = true
static_files = true

cache_dir = %(here)s/data
beaker.session.key = linkdb
beaker.session.secret = b75f1813263ab9a082f67278daa26433

sqlalchemy.url = mysql://cclp:878048@mysql.mior.ca/ccorl

authkit.setup.enable = True
authkit.setup.method = form, cookie
authkit.form.authenticate.user.type = linkdb.model.auth:MyUsersFromDatabase
authkit.form.authenticate.user.data = linkdb.model
authkit.cookie.secret = c2b47614b6eb46c4bd7842cae10f27e4
authkit.cookie.signoutpath = /users/logout
authkit.form.template.obj = linkdb.model.auth:make_template

set debug = false

[loggers]
keys = root, routes, linkdb, sqlalchemy

[handlers]
keys = console

[formatters]
keys = generic

[logger_root]
level = INFO
handlers = console

[logger_routes]
level = INFO
handlers =
qualname = routes.middleware

[logger_linkdb]
level = DEBUG
handlers =
qualname = linkdb

[logger_sqlalchemy]
level = WARN
handlers =
qualname = sqlalchemy.engine

[handler_console]
class = StreamHandler
args = (sys.stderr,)
level = NOTSET
formatter = generic

[formatter_generic]
format = %(asctime)s,%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s
datefmt = %H:%M:%S

更新:下面是应用程序生成的错误日志(我疑神疑鬼,所以我找出了IP地址)

代码语言:javascript
复制
DEBUG:authkit.authenticate.cookie:These cookies were found: []
DEBUG:authkit.authenticate.cookie:Our cookie 'authkit' value is therefore ''
DEBUG:authkit.authenticate.cookie:Remote addr '***.***.***.***', value '', include_ip True
DEBUG:pylons.wsgiapp:Setting up Pylons stacked object globals
DEBUG:pylons.wsgiapp:No controller found, returning 404 HTTP Not Found
DEBUG:authkit.authenticate.multi:Status: '404 Not Found', Headers: [('Content-Type', 'text/html; charset=UTF-8'), ('Content-Length', '154')]
DEBUG:authkit.authenticate.multi:Status checker recieved status '404 Not Found', headers [('Content-Type', 'text/html; charset=UTF-8'), ('Content-Length', '154')], intecept ['401']
DEBUG:authkit.authenticate.multi:Status checker returns False
DEBUG:authkit.authenticate.multi:Multi: No binding was found for the check
DEBUG:authkit.authenticate.cookie:These cookies were found: []
DEBUG:authkit.authenticate.cookie:Our cookie 'authkit' value is therefore ''
DEBUG:authkit.authenticate.cookie:Remote addr '***.***.***.***', value '', include_ip True
DEBUG:pylons.wsgiapp:Setting up Pylons stacked object globals
DEBUG:pylons.wsgiapp:Resolved URL to controller: u'error'
DEBUG:pylons.wsgiapp:Found controller, module: 'linkdb.controllers.error', class: 'ErrorController'
DEBUG:pylons.wsgiapp:Controller appears to be a class, instantiating
DEBUG:pylons.wsgiapp:Calling controller class with WSGI interface

更新:这是我的应用程序正在使用的fcgi脚本。

代码语言:javascript
复制
#!/usr/bin/env python
import logging
# Load the WSGI application from the config file
from paste.deploy import loadapp
wsgi_app = loadapp('config:/var/www/linkdb/production.ini')

# Deploy it using FastCGI
if __name__ == '__main__':
    logging.basicConfig(filename='/var/www/linkdb/error.log', level=logging.DEBUG)
    from flup.server.fcgi import WSGIServer
    WSGIServer(wsgi_app).run()
EN

回答 1

Server Fault用户

发布于 2010-07-16 23:07:46

虽然您可以调试fcgid问题,但您可能会发现使用mod_wsgi进行部署要容易得多。

您可能遇到的问题与在您的debug=true文件中设置的.ini有关,该文件在多线程模式或对STDOUT进行打印的代码中无法工作。如果您可以张贴更多的配置,日志行等,它应该是相对容易看出什么是错误的。根控制器中的操作是否被调用?你改变路线了吗?

您是否使用virtualenv来设置您的环境(go ons.py安装程序)?或者您是否使用了系统库并在根目录中执行easy_install?

票数 1
EN
页面原文内容由Server Fault提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://serverfault.com/questions/161096

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档