~ubuntu-branches/ubuntu/hardy/moin/hardy

« back to all changes in this revision

Viewing changes to wiki/server/moin.fcg

  • Committer: Bazaar Package Importer
  • Author(s): Kees Cook
  • Date: 2007-05-14 15:55:15 UTC
  • mfrom: (0.4.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20070514155515-apl4srcch40h9fcx
Tags: 1.5.7-3ubuntu1
* Merge from debian unstable, remaining changes:
  - 11000_show_traceback_toggle.patch: allow for 'show_traceback=0' in
    Moin configurations.

Show diffs side-by-side

added added

removed removed

Lines of Context:
11
11
 
12
12
import sys
13
13
 
 
14
# Path to MoinMoin package, needed if you installed with --prefix=PREFIX
 
15
# or if you did not use setup.py.
 
16
## sys.path.insert(0, 'PREFIX/lib/python2.3/site-packages')
 
17
 
14
18
# Path of the directory where wikiconfig.py is located.
15
19
# YOU NEED TO CHANGE THIS TO MATCH YOUR SETUP.
16
20
sys.path.insert(0, '/path/to/wikiconfig')
17
21
 
18
 
# Path to MoinMoin package, needed if you installed with --prefix=PREFIX
19
 
# or if you did not use setup.py.
20
 
## sys.path.insert(0, 'PREFIX/lib/python2.3/site-packages')
21
 
 
22
22
# Path of the directory where farmconfig is located (if different).
23
23
## sys.path.insert(0, '/path/to/farmconfig')
24
24
 
26
26
## import os
27
27
## os.environ['MOIN_DEBUG'] = '1'
28
28
 
29
 
# Use threaded version or non-threaded version (default 1)?
30
 
use_threads = 1
 
29
# how many requests shall be handled by a moin fcgi process before it dies,
 
30
# -1 mean "unlimited lifetime":
 
31
max_requests = -1
 
32
 
 
33
# how many threads to use (1 means use only main program, non-threaded)
 
34
max_threads = 5
 
35
 
 
36
# backlog, use in socket.listen(backlog) call
 
37
backlog = 5
31
38
 
32
39
 
33
40
# Code ------------------------------------------------------------------
37
44
 
38
45
# Set threads flag, so other code can use proper locking
39
46
from MoinMoin import config
40
 
config.use_threads = use_threads
 
47
config.use_threads = max_threads > 1
41
48
del config
42
49
 
43
50
from MoinMoin.request import RequestFastCGI
48
55
    request.run()
49
56
 
50
57
if __name__ == '__main__':
51
 
    if use_threads:
52
 
        fcg = thfcgi.THFCGI(handle_request)
53
 
    else:
54
 
        fcg = thfcgi.unTHFCGI(handle_request)    
55
 
 
 
58
    fcg = thfcgi.FCGI(handle_request, max_requests=max_requests, backlog=backlog, max_threads=max_threads)
56
59
    fcg.run()
57
60