1
# -*- coding: iso-8859-1 -*-
3
MoinMoin.server.server_fastcgi
5
This is not really a server, it is just so that fastcgi stuff
6
(the real server is likely Apache2) fits the model we have for
7
Twisted and standalone server.
11
from MoinMoin.server.server_fastcgi import FastCgiConfig, run
13
class Config(FastCgiConfig):
18
See more options in FastCgiConfig class.
20
@copyright: 2007 MoinMoin:ThomasWaldmann
22
@license: GNU GPL, see COPYING for details.
25
from MoinMoin.server import Config
26
from MoinMoin.request import request_fcgi
27
from MoinMoin.support import thfcgi
29
# Set threads flag, so other code can use proper locking.
30
from MoinMoin import config
31
config.use_threads = 1
34
class FastCgiConfig(Config):
35
""" Set up default server """
37
# properties = {'script_name': '/'}
39
# how many requests shall be handled by a moin fcgi process before it dies,
40
# -1 mean "unlimited lifetime":
43
# how many threads to use (1 means use only main program, non-threaded)
46
# backlog, use in socket.listen(backlog) call
52
def run(ConfigClass=FastCgiConfig):
53
config = ConfigClass()
55
handle_request = lambda req, env, form, properties=config.properties: \
56
request_fcgi.Request(req, env, form, properties=properties).run()
57
fcg = thfcgi.FCGI(handle_request, port=config.port, max_requests=config.max_requests, backlog=config.backlog, max_threads=config.max_threads)