annotate wiki/server/mointwisted.py @ 4468:fad2936d33a7 1.8.1

added dummy mig script for 1.8.1, bumped version number
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Wed, 24 Dec 2008 16:32:46 +0100
parents 415cbfc3817b
children bccf475c18d7
rev   line source
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1 """
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
2 twisted.web based wiki server
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
3
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
4 Run this server with mointwisted script on Linux or Mac OS X, or
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
5 mointwisted.cmd on Windows.
2286
01f05e74aa9c Big PEP8 and whitespace cleanup
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1659
diff changeset
6
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
7 @copyright: 2004-2005 Thomas Waldmann, Oliver Graf, Nir Soffer
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
8 @license: GNU GPL, see COPYING for details.
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
9 """
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
10
3580
fc2f05f2b0bd server adaptor scripts: make sys.path / logging configuration / comments consistent
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3105
diff changeset
11 import sys, os
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
12
3580
fc2f05f2b0bd server adaptor scripts: make sys.path / logging configuration / comments consistent
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3105
diff changeset
13 # a) Configuration of Python's code search path
fc2f05f2b0bd server adaptor scripts: make sys.path / logging configuration / comments consistent
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3105
diff changeset
14 # If you already have set up the PYTHONPATH environment variable for the
fc2f05f2b0bd server adaptor scripts: make sys.path / logging configuration / comments consistent
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3105
diff changeset
15 # stuff you see below, you don't need to do a1) and a2).
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
16
3580
fc2f05f2b0bd server adaptor scripts: make sys.path / logging configuration / comments consistent
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3105
diff changeset
17 # a1) Path of the directory where the MoinMoin code package is located.
fc2f05f2b0bd server adaptor scripts: make sys.path / logging configuration / comments consistent
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3105
diff changeset
18 # Needed if you installed with --prefix=PREFIX or you didn't use setup.py.
fc2f05f2b0bd server adaptor scripts: make sys.path / logging configuration / comments consistent
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3105
diff changeset
19 #sys.path.insert(0, 'PREFIX/lib/python2.3/site-packages')
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
20
3580
fc2f05f2b0bd server adaptor scripts: make sys.path / logging configuration / comments consistent
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3105
diff changeset
21 # a2) Path of the directory where wikiconfig.py / farmconfig.py is located.
fc2f05f2b0bd server adaptor scripts: make sys.path / logging configuration / comments consistent
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3105
diff changeset
22 # See wiki/config/... for some sample config files.
fc2f05f2b0bd server adaptor scripts: make sys.path / logging configuration / comments consistent
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3105
diff changeset
23 #sys.path.insert(0, '/path/to/wikiconfigdir')
fc2f05f2b0bd server adaptor scripts: make sys.path / logging configuration / comments consistent
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3105
diff changeset
24 #sys.path.insert(0, '/path/to/farmconfigdir')
fc2f05f2b0bd server adaptor scripts: make sys.path / logging configuration / comments consistent
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3105
diff changeset
25
fc2f05f2b0bd server adaptor scripts: make sys.path / logging configuration / comments consistent
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3105
diff changeset
26 # b) Configuration of moin's logging
fc2f05f2b0bd server adaptor scripts: make sys.path / logging configuration / comments consistent
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3105
diff changeset
27 # If you have set up MOINLOGGINGCONF environment variable, you don't need this!
fc2f05f2b0bd server adaptor scripts: make sys.path / logging configuration / comments consistent
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3105
diff changeset
28 # You also don't need this if you are happy with the builtin defaults.
fc2f05f2b0bd server adaptor scripts: make sys.path / logging configuration / comments consistent
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3105
diff changeset
29 # See wiki/config/logging/... for some sample config files.
fc2f05f2b0bd server adaptor scripts: make sys.path / logging configuration / comments consistent
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3105
diff changeset
30 #from MoinMoin import log
fc2f05f2b0bd server adaptor scripts: make sys.path / logging configuration / comments consistent
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3105
diff changeset
31 #log.load_config('/path/to/logging_configuration_file')
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
32
49
cf52f97a5857 merge moin--main--1.3--patch-928
Nir Soffer <nirs@freeshell.org>
parents: 0
diff changeset
33 # Debug mode - show detailed error reports
3580
fc2f05f2b0bd server adaptor scripts: make sys.path / logging configuration / comments consistent
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3105
diff changeset
34 #os.environ['MOIN_DEBUG'] = '1'
fc2f05f2b0bd server adaptor scripts: make sys.path / logging configuration / comments consistent
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3105
diff changeset
35
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
36
2338
b902f2397c68 rename server and request Implementations by adding a prefix server_, request_
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 2286
diff changeset
37 from MoinMoin.server.server_twisted import TwistedConfig, makeApp
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
38
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
39
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
40 class Config(TwistedConfig):
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
41
3105
80e1a910a2f1 make logging more configurable and flexible, packages/modules shall call MoinMoin.server.getLogger
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3096
diff changeset
42 # Server name - used to create .pid and .prof files
80e1a910a2f1 make logging more configurable and flexible, packages/modules shall call MoinMoin.server.getLogger
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3096
diff changeset
43 name = 'moin'
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
44
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
45 # Path to moin shared files (default '/usr/share/moin/wiki/htdocs')
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
46 docs = '/usr/share/moin/htdocs'
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
47
1582
f37b49b6313d url_prefix_static: move default to MoinMoin.config, use matching defaults for Twisted/standalone
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 49
diff changeset
48 # URL prefix for the static stuff (used to access stuff in docs) - you
f37b49b6313d url_prefix_static: move default to MoinMoin.config, use matching defaults for Twisted/standalone
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 49
diff changeset
49 # usually should not need to change this because Twisted moin uses
f37b49b6313d url_prefix_static: move default to MoinMoin.config, use matching defaults for Twisted/standalone
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 49
diff changeset
50 # matching defaults for here and for wikiconfig.py:
4468
fad2936d33a7 added dummy mig script for 1.8.1, bumped version number
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4457
diff changeset
51 #url_prefix_static = '/moin_static181'
1582
f37b49b6313d url_prefix_static: move default to MoinMoin.config, use matching defaults for Twisted/standalone
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 49
diff changeset
52
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
53 # The server will run with as this user and group (default 'www-data')
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
54 user = 'www-data'
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
55 group = 'www-data'
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
56
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
57 # Port (default 8080)
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
58 # To serve privileged port under 1024 you will have to run as root
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
59 port = 8080
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
60
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
61 # Interfaces (default [''])
2286
01f05e74aa9c Big PEP8 and whitespace cleanup
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1659
diff changeset
62 # The interfaces the server will listen to.
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
63 # [''] - listen to all interfaces defined on the server
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
64 # ['red.wikicolors.org', 'blue.wikicolors.org'] - listen to some
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
65 # If '' is in the list, other ignored.
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
66 interfaces = ['']
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
67
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
68 # How many threads to use (default 10, max 20)
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
69 # The more threads you use, the more memory moin uses. All thread
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
70 # use one CPU, and will not run faster, but might be more responsive
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
71 # on a very busy server.
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
72 threads = 10
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
73
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
74 # Set logfile name (default commented)
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
75 # This is the *Apache compatible* log file, not the twisted-style logfile.
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
76 # Leaving this as None will have no Apache compatible log file. Apache
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
77 # compatible logfiles are useful because there are quite a few programs
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
78 # which analyze them and display statistics.
1585
a843bc5793fb introduce stdlib's logging module
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1582
diff changeset
79 ## logPath_twisted = 'mointwisted.log'
a843bc5793fb introduce stdlib's logging module
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1582
diff changeset
80
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
81 # Memory profile (default commented)
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
82 # Useful only if you are a developer or interested in moin memory usage
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
83 ## from MoinMoin.util.profile import TwistedProfiler
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
84 ## memoryProfile = TwistedProfiler('mointwisted',
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
85 ## requestsPerSample=100,
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
86 ## collect=0)
1582
f37b49b6313d url_prefix_static: move default to MoinMoin.config, use matching defaults for Twisted/standalone
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 49
diff changeset
87
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
88 # Hotshot profile (default commented)
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
89 # Not compatible with threads.
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
90 ## hotshotProfile = name + '.prof'
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
91
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
92
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
93 # Create the application
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
94 application = makeApp(Config)
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
95