Package cherrypy :: Package test :: Module modwsgi
[hide private]
[frames] | no frames]

Module modwsgi

source code

Wrapper for mod_wsgi, for use as a CherryPy HTTP server.

To autostart modwsgi, the "apache" executable or script must be
on your system path, or you must override the global APACHE_PATH.
On some platforms, "apache" may be called "apachectl" or "apache2ctl"--
create a symlink to them if needed.


KNOWN BUGS
==========

##1. Apache processes Range headers automatically; CherryPy's truncated
##    output is then truncated again by Apache. See test_core.testRanges.
##    This was worked around in http://www.cherrypy.org/changeset/1319.
2. Apache does not allow custom HTTP methods like CONNECT as per the spec.
    See test_core.testHTTPMethods.
3. Max request header and body settings do not work with Apache.
##4. Apache replaces status "reason phrases" automatically. For example,
##    CherryPy may set "304 Not modified" but Apache will write out
##    "304 Not Modified" (capital "M").
##5. Apache does not allow custom error codes as per the spec.
##6. Apache (or perhaps modpython, or modpython_gateway) unquotes %xx in the
##    Request-URI too early.
7. mod_wsgi will not read request bodies which use the "chunked"
    transfer-coding (it passes REQUEST_CHUNKED_ERROR to ap_setup_client_block
    instead of REQUEST_CHUNKED_DECHUNK, see Apache2's http_protocol.c and
    mod_python's requestobject.c).
8. When responding with 204 No Content, mod_wsgi adds a Content-Length
    header for you.
9. When an error is raised, mod_wsgi has no facility for printing a
    traceback as the response content (it's sent to the Apache log instead).
10. Startup and shutdown of Apache when running mod_wsgi seems slow.

Classes [hide private]
  ModWSGISupervisor
Server Controller for ModWSGI and CherryPy.
Functions [hide private]
 
read_process(cmd, args='') source code
 
application(environ, start_response) source code
Variables [hide private]
  curdir = '/build/cherrypy3-bwivxy/cherrypy3-3.5.0/cherrypy/test'
  APACHE_PATH = 'apache'
  CONF_PATH = 'test_mw.conf'
  conf_modwsgi = '\n# Apache2 server conf file for testing Cherr...
  loaded = False
  __package__ = 'cherrypy.test'
Variables Details [hide private]

conf_modwsgi

Value:
'''
# Apache2 server conf file for testing CherryPy with modpython_gateway\
.

ServerName 127.0.0.1
DocumentRoot "/"
Listen %(port)s

...