使用mod_fcgid在Apache上部署主塔

我试图使用这里find的说明部署我的Pylons应用程序。 当我访问我的域的根时,这只是加载默认的Pylons页面。 当我尝试进入任何path时,我收到消息

Unhandled Exception An unhandled exception was thrown by the application. 

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

有什么build议要检查什么? 我喜欢用塔架开发,但这是我第一次尝试部署。 我已经尝试了多个不同的Web服务器上的多个configuration,我没有任何运气。

更新:下面是我的Pylons应用程序的configuration(剥离的意见,使其更短)

 [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:[email protected]/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地址)

 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脚本

 #!/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() 

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

您可能遇到的问题与在您的.ini文件中设置的debug = true有关,该文件不能在multithreading模式下工作,或者在打印到STDOUT的代码中工作。 如果你可以发布更多的configuration,日志等等,那么应该比较容易地看到错误。 根控制器中的操作是否被调用? 你有没有改变你的路线?

你使用virtualenv来设置你的环境(go-pylons.py安装程序?),还是使用系统库,并在你的根目录下执行easy_install?