From: Menglong T. <tan...@gm...> - 2010-01-24 15:54:07
|
Hi, all. Im just tring to get web.py work with the help of spawn-fcgi with yaws. But I encountered a problem: *yaws.conf:* <server localhost> port = 80 listen = 0.0.0.0 appmods = </test, yaws_appmod_fcgi> docroot = /usr/local/var/yaws/www fcgi_app_server = 127.0.0.1:3000 fcgi_trace_protocol = true </server> *index.py:* #!/usr/bin/env python import web urls = ("/.*", "hello") app = web.application(urls, globals()) class hello: def GET(self): return 'Hello, world!' if __name__ == '__main__': web.wsgi.runwsgi = lambda func, addr=None: web.wsgi.runfcgi(func, addr) app.run() *run spawn-fcgi:* spawn-fcgi -d /root/test -f /root/test/index.py -a 127.0.0.1 -p 3000 but when I visited http://localhost/test, it returned a blank page with 200. Then I modified the index.py, remove the if __name__ == '__main__': visited again, returned an exception: <type 'exceptions.ValueError'> at /apps/testappsignal only works in main thread Im new to fcgi, so turn to maillist for help after searching the whole Internet without getting anything. Thank in advance.. -- Best wishes, Tan Menglong Email/GTalk:Tan...@gm... <GTalk%3AT...@gm...> MSN:Tan...@ho... <MSN%3AT...@ho...> |