cherrypy_server

Entry point for CherryPy's WSGI server


Functions

f cpwsgi_server(app, global_conf=None, host='127.0.0.1', port=None, ssl_pem=None, protocol_version=None, numthreads=None, server_name=None, max=None, request_queue_size=None, timeout=None) ...

Serves the specified WSGI app via CherryPyWSGIServer.

app

The WSGI 'application callable'; multiple WSGI applications may be passed as (script_name, callable) pairs.

host

This is the ipaddress to bind to (or a hostname if your nameserver is properly configured). This defaults to 127.0.0.1, which is not a public interface.

port

The port to run on, defaults to 8080 for HTTP, or 4443 for HTTPS. This can be a string or an integer value.

ssl_pem

This an optional SSL certificate file (via OpenSSL) You can generate a self-signed test PEM certificate file as follows:

$ openssl genrsa 1024 > host.key $ chmod 400 host.key $ openssl req -new -x509 -nodes -sha1 -days 365

System Message: ERROR/3 (paste.script.cherrypy_server.cpwsgi_server, line 25)

Unexpected indentation.
-key host.key > host.cert

System Message: WARNING/2 (paste.script.cherrypy_server.cpwsgi_server, line 26)

Block quote ends without a blank line; unexpected unindent.

$ cat host.cert host.key > host.pem $ chmod 400 host.pem

protocol_version

The protocol used by the server, by default HTTP/1.1.

numthreads

The number of worker threads to create.

server_name

The string to set for WSGI's SERVER_NAME environ entry.

max

The maximum number of queued requests. (defaults to -1 = no limit).

request_queue_size

The 'backlog' argument to socket.listen(); specifies the maximum number of queued connections.

timeout

The timeout in seconds for accepted connections.

See the source for more information.