A very small cherrypy (2.1.1) program running under SCGI provided by paste (0.5dev_r4745) and scgi-1.10.

###

import cherrypy
import mx.DateTime
from cherrypy._cpwsgi import wsgiApp
from paste.util.scgiserver import serve_application

class HelloWorld:
    def index(self):
        return "%s Hello world!" % mx.DateTime.now()
    index.exposed = True

cherrypy.root = HelloWorld()

# init cherrypy
cherrypy.server.start(initOnly=True, serverClass=None)

# run the server
serve_application(application=wsgiApp, prefix="/prefix", port=4000)

###

And relevant cherokee.conf, cherokee 0.4.31b8

Documentroot /home/bzhou/public_html/test-scgi
DirectoryIndex index.html

Directory /static {
    Handler file
}

Directory /dynamic {
    Handler scgi {
        Server localhost:4000
        ErrorHandler on
    }
}

Request "^/$" {
    Handler redir { Rewrite "" "/static/index.html" }
}

When accessing http://localhost:8082/dynamic/ , I got a "500 Internal Server Error" and python trace back:

Traceback (most recent call last):
  File "test-cherrypy-scgi.py", line 17, in ?
    serve_application(application=wsgiApp, prefix="/dynamic", port=4000)
  File "/opt/lib/python2.4/site-packages/paste/util/scgiserver.py", line 147, in serve_application
    scgi_server.SCGIServer(SCGIAppHandler, port=port).serve()
  File "/opt/lib/python2.4/site-packages/scgi/scgi_server.py", line 104, in __init__
  File "/opt/lib/python2.4/site-packages/scgi/scgi_server.py", line 126, in spawn_child
  File "/opt/lib/python2.4/site-packages/scgi/scgi_server.py", line 72, in serve
  File "/opt/lib/python2.4/site-packages/paste/util/scgiserver.py", line 60, in handle_connection
    environ = self.read_env(input)
  File "/opt/lib/python2.4/site-packages/scgi/scgi_server.py", line 76, in read_env
  File "/opt/lib/python2.4/site-packages/scgi/scgi_server.py", line 45, in read_env
AssertionError: malformed headers

The same program runs fine under lighttpd + mod_scgi though, with config like:

$HTTP["url"] !~ "^/static/" {
    scgi.server = (
        "/" => (
            "127.0.0.1" => (
                "host" => "127.0.0.1",
                "port" => 4000,
                "check-local" => "disable"
            )
        )
    )
}

Any idea what is going on? All tested on nslu2-linux.

Thanks,

-Brian Zhou
_______________________________________________
Cherokee mailing list
[email protected]
http://www.0x50.org/cgi-bin/mailman/listinfo/cherokee

Reply via email to