~ubuntu-branches/ubuntu/natty/moin/natty-updates

« back to all changes in this revision

Viewing changes to wiki/server/moin.py

  • Committer: Bazaar Package Importer
  • Author(s): Jonas Smedegaard
  • Date: 2008-06-22 21:17:13 UTC
  • mfrom: (0.9.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20080622211713-fpo2zrq3s5dfecxg
Tags: 1.7.0-3
Simplify /etc/moin/wikilist format: "USER URL" (drop unneeded middle
CONFIG_DIR that was wrongly advertised as DATA_DIR).  Make
moin-mass-migrate handle both formats and warn about deprecation of
the old one.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/usr/bin/env python
2
 
"""
3
 
    Start script for the standalone Wiki server.
4
 
 
5
 
    @copyright: 2004-2005 Thomas Waldmann, Nir Soffer
6
 
    @license: GNU GPL, see COPYING for details.
7
 
"""
8
 
 
9
 
# System path configuration
10
 
 
11
 
import sys
12
 
 
13
 
# Path to MoinMoin package, needed if you installed with --prefix=PREFIX
14
 
# or if you did not use setup.py.
15
 
## sys.path.insert(0, 'PREFIX/lib/python2.3/site-packages')
16
 
 
17
 
# Path of the directory where wikiconfig.py is located.
18
 
# YOU NEED TO CHANGE THIS TO MATCH YOUR SETUP.
19
 
sys.path.insert(0, '/path/to/wikiconfig')
20
 
 
21
 
# Path of the directory where farmconfig is located (if different).
22
 
## sys.path.insert(0, '/path/to/farmconfig')
23
 
 
24
 
# Debug mode - show detailed error reports
25
 
## import os
26
 
## os.environ['MOIN_DEBUG'] = '1'
27
 
 
28
 
from MoinMoin.server.standalone import StandaloneConfig, run
29
 
 
30
 
 
31
 
class Config(StandaloneConfig):
32
 
 
33
 
    # Server name
34
 
    # Used to create .log, .pid and .prof files
35
 
    name = 'moin'
36
 
 
37
 
    # Path to moin shared files (default '/usr/share/moin/wiki/htdocs')
38
 
    # If you installed with --prefix=PREFIX, use 'PREFIX/share/moin/wiki/htdocs'
39
 
    docs = '/usr/share/moin/htdocs'
40
 
 
41
 
    # The server will run with as this user and group (default 'www-data')
42
 
    user = 'www-data'
43
 
    group = 'www-data'
44
 
 
45
 
    # Port (default 8000)
46
 
    # To serve privileged port under 1024 you will have to run as root.
47
 
    port = 8000
48
 
 
49
 
    # Interface (default 'localhost')
50
 
    # The default will listen only to localhost.
51
 
    # '' will listen to any interface
52
 
    interface = 'localhost'
53
 
 
54
 
    # Log (default commented)
55
 
    # Log is written to stderr or to a file you specify here.
56
 
    ## logPath = name + '.log'
57
 
 
58
 
    # Server class (default ThreadPoolServer)
59
 
    # 'ThreadPoolServer' - create a constant pool of threads, simplified
60
 
    # Apache worker mpm.
61
 
    # 'ThreadingServer' - serve each request in a new thread. Much
62
 
    # slower for static files.
63
 
    # 'ForkingServer' - serve each request on a new child process -
64
 
    # experimental, slow.
65
 
    # 'SimpleServer' - server one request at a time. Fast, low
66
 
    # memory footprint.
67
 
    # If you set one of the threading servers and threads are not
68
 
    # available, the server will fallback to ForkingServer. If fork is
69
 
    # not available, the server will fallback to SimpleServer.
70
 
    serverClass = 'ThreadPoolServer'
71
 
    
72
 
    # Thread limit (default 10)
73
 
    # Limit the number of threads created. Ignored on non threaded servers.
74
 
    threadLimit = 10
75
 
 
76
 
    # Request queue size (default 50)
77
 
    # The size of the socket listen backlog.
78
 
    requestQueueSize = 50
79
 
 
80
 
    # Properties
81
 
    # Allow overriding any request property by the value defined in
82
 
    # this dict e.g properties = {'script_name': '/mywiki'}.
83
 
    properties = {}
84
 
    
85
 
    # Memory profile (default commented)
86
 
    # Useful only if you are a developer or interested in moin memory usage
87
 
    # A memory profile named 'moin--2004-09-27--01-24.log' is
88
 
    # created each time you start the server.
89
 
    ## from MoinMoin.util.profile import Profiler
90
 
    ## memoryProfile = Profiler(name, requestsPerSample=100, collect=0)
91
 
 
92
 
    # Hotshot profile (default commented)
93
 
    # Not compatible with threads - use with SimpleServer only.
94
 
    ## hotshotProfile = name + '.prof'
95
 
 
96
 
 
97
 
if __name__ == '__main__':
98
 
    run(Config)
99