1 Introduction
2 ------------
3
4 The moinsetup script is a utility separate from MoinMoin which attempts to
5 assist in the configuration and deployment of MoinMoin and extensions. It can
6 automate the installation of MoinMoin according to recommended practices,
7 create and initialise new Wiki instances, install extensions, themes and
8 related resources, and perform certain configuration changes.
9
10 Important Notices
11 -----------------
12
13 Release 0.3 of moinsetup changes the Wiki instance directory hierarchy so that
14 the top-level directory, instead of containing the conf and wikidata
15 directories, contains the Wiki configuration file (unless located elsewhere -
16 see the site_config setting) plus data, underlay and htdocs directories. See
17 the migration section below for details.
18
19 Release 0.3 also changes the moinsetup command syntax to require -m (or
20 --method=) before method names. This fixes a critical ambiguity issue with
21 option processing.
22
23 Usage
24 -----
25
26 Running moinsetup as follows will provide a list of methods available:
27
28 python moinsetup.py
29
30 Before any work can be done by the program, a configuration file needs to be
31 created. See the supplied moinsetup.cfg file in the examples directory which
32 can be modified and used for this purpose.
33
34 An alternative configuration file is specified using the -f option:
35
36 python moinsetup.py -f mywiki.cfg
37
38 Configuration files provide information about the MoinMoin installation and a
39 particular Wiki instance and Web site where the instance is published.
40
41 Migration from moinsetup 0.2
42 ----------------------------
43
44 The Wiki instance directory hierarchy has changed in moinsetup 0.3 as
45 illustrated below:
46
47 wiki (old)
48 conf
49 (wikiconfig.py)
50 data
51 underlay
52 wikidata
53 ... (htdocs)
54
55 wiki (new)
56 (wikiconfig.py)
57 data
58 underlay
59 (htdocs)
60
61 Since the contents of wikidata is generally superfluous, since the files are
62 mostly shared resources, that directory is no longer created and such shared
63 resources are no longer copied into it. The htdocs directory is copied since
64 it can be convenient to maintain a separate collection of static files so that
65 they can be updated with theme-related changes without modifying common system
66 files.
67
68 To migrate old Wiki instance layouts, run the following command:
69
70 python moinsetup.py -m migrate_instance
71
72 Add an optional argument after the method name to run the migration method in
73 test mode:
74
75 python moinsetup.py -m migrate_instance test
76
77 This will just print the actions to be taken when migrating the instance.
78
79 Configuration
80 -------------
81
82 The configuration file has two sections: "installation" and "site". A brief
83 description of the settings is given below.
84
85 Installation settings influence the configuration, installation and
86 customisation of a Wiki and are generally not optional:
87
88 moin_distribution A path to a MoinMoin distribution directory, which can
89 also be a clone of a MoinMoin repository.
90
91 prefix The directory prefix containing lib, bin and share
92 directories where MoinMoin is (or will be) installed.
93 Although this follows the layout of the /usr directory (on
94 Unix-based systems), it is likely that MoinMoin may be
95 installed elsewhere.
96
97 site_packages The location of a directory which is either a Python
98 site-packages directory or something providing a selection
99 of different Python packages. If Python packages are
100 installed outside the 'prefix' area, perhaps due to a
101 distribution-specific mechanism, this setting should be
102 used in addition to the 'prefix' setting. Otherwise, it can
103 be omitted or left blank.
104
105 web_app_dir A directory where the moin.cgi program is (or will be)
106 installed.
107
108 web_static_dir A directory from which static resources are to be served.
109 This directory need only be specified in a limited hosting
110 environment (see below for more details).
111
112 web_site_dir The directory where sites available to the Apache Web
113 server are defined. This directory may just be a place
114 where initial site definitions are written, and after
115 manual editing, such definitions may be copied to the
116 appropriate location. If this directory is left
117 unspecified, a limited hosting environment will be
118 assumed.
119
120 Except for the common_dir setting, site settings are generally only relevant
121 when configuring and installing a Wiki:
122
123 common_dir The directory in which the Wiki instance being configured
124 or managed resides (or will reside).
125
126 farm_config A specific Wiki farm configuration file for multiple Wiki
127 deployments. This overrides the 'common_dir' setting if
128 used, indicating that a Wiki farm configuration must be
129 edited when configuring a Wiki.
130
131 site_config A specific configuration file location for a Wiki deployed
132 within a Wiki farm. This overrides the 'common_dir' setting
133 if used.
134
135 url_path The URL path (after the host details) of the Wiki.
136
137 static_url_path The URL path (after the host details) of the Wiki's static
138 resources. This is only required if a limited hosting
139 environment enforces separate "htdocs" and "cgi-bin"
140 directories, and the static resources must be placed in
141 the "htdocs" directory.
142
143 superuser The superuser of the Wiki.
144
145 site_name The name of the Wiki.
146
147 site_identifier An identifier used to refer to the site, typically derived
148 from 'site_name' if left unspecified, and only really of use
149 when an Apache site file needs to be written. In limited
150 hosting environments, this setting has no effect.
151
152 front_page_name The name of the Wiki's front page.
153
154 theme_default The default theme of the Wiki.
155
156 Working with MoinMoin System Installations
157 ------------------------------------------
158
159 Where MoinMoin has already been installed using a package supplied by an
160 operating system distribution (such as Debian, Red Hat, Ubuntu), there is no
161 need to install the software itself. However, it is still necessary to set up
162 Wiki instances. The moinsetup.cfg.debian file in the examples directory could
163 be used as a starting point for configuring Wiki instances on Debian systems.
164
165 Limited Hosting Environments
166 ----------------------------
167
168 Sometimes, the hosting environment in which MoinMoin is to be deployed will be
169 restrictive or "limited", meaning that substantial configuration of the Web
170 server will not be possible for the user installing and configuring MoinMoin.
171 In such environments, users will typically be allowed to install content in
172 preconfigured directories for static and dynamic content. For example:
173
174 /path/to/www/cgi-bin a dynamic content directory, providing CGI scripts
175 /path/to/www/htdocs a static content directory, providing Web pages
176
177 To work in such environments, specify the configuration settings in
178 moinsetup.cfg as follows:
179
180 web_app_dir = /path/to/www/cgi-bin
181 web_static_dir = /path/to/www/htdocs
182 web_site_dir =
183
184 url_path = /mysite/cgi-bin
185 static_url_path = /mysite
186
187 If the web_static_dir setting is left blank, the static resources will be
188 placed alongside the CGI script. Some environments have .cgi files served as
189 CGI scripts and other files served statically; in such cases, static_url_path
190 can also be left blank.
191
192 Inside the directory used to hold static resources, a subdirectory will be
193 created to hold the static content used by MoinMoin.
194
195 See the moinsetup.cfg.sourceforge file in the examples directory for an
196 illustration of how Wiki instances can be configured in a restrictive hosting
197 environment.
198
199 Wiki Farm Environments
200 ----------------------
201
202 MoinMoin supports the notion of a Wiki farm where a single common configuration
203 is overridden by configurations for individual Wiki instances. To work in such
204 environments, specify the configuration settings in moinsetup.cfg as follows:
205
206 farm_config = /path/to/farmconfig.py
207 site_config = /path/to/wikiname.py
208
209 Examples
210 --------
211
212 Some of the more useful invocation methods are described below using examples.
213
214 To set up MoinMoin and a Wiki instance (useful when installing MoinMoin
215 yourself):
216
217 python moinsetup.py -m setup
218
219 To set up only a Wiki instance (useful on a system with MoinMoin installed):
220
221 python moinsetup.py -m setup_wiki
222
223 To set up only a Wiki instance, but using a different configuration file:
224
225 python moinsetup.py -f mywiki.cfg -m setup_wiki
226
227 To change a Wiki configuration setting (for example, the default theme):
228
229 python moinsetup.py -m reconfigure_moin theme_default mercurialwiki
230
231 To install a theme from a directory containing a theme module, css and img
232 directories (for example, MercurialWikiTheme):
233
234 python moinsetup.py -m install_theme /path/to/MercurialWikiTheme/themes/mercurialwiki
235
236 To install an extension package from a directory containing a setup.py script
237 (for example, EventAggregator):
238
239 python moinsetup.py -m install_extension_package /path/to/EventAggregator
240
241 To install actions from a directory containing action modules:
242
243 python moinsetup.py -m install_actions /path/to/EventAggregator/actions
244
245 To install macros from a directory containing macro modules:
246
247 python moinsetup.py -m install_macros /path/to/EventAggregator/macros
248
249 To install theme-related resources for an extension from a directory
250 containing css and img directories:
251
252 python moinsetup.py -m install_theme_resources /path/to/EventAggregator
253
254 To add theme-related resources to existing stylesheets (for example, adding
255 the event-aggregator.css resource to the screen.css stylesheet for all
256 installed themes):
257
258 python moinsetup.py -m edit_theme_stylesheet screen.css event-aggregator.css
259
260 To make a page package containing pages to be added to a Wiki:
261
262 python moinsetup.py -m make_page_package pages_dir pages.zip
263
264 To install a page package in a Wiki:
265
266 python moinsetup.py -m install_page_package pages.zip
267
268 Contact, Copyright and Licence Information
269 ------------------------------------------
270
271 See the following Web page for more information about this work:
272
273 http://moinmo.in/ScriptMarket/moinsetup
274
275 The author can be contacted at the following e-mail address:
276
277 paul@boddie.org.uk
278
279 Copyright and licence information can be found in the docs directory - see
280 docs/COPYING.txt and docs/gpl-3.0.txt for more information.
281
282 Dependencies
283 ------------
284
285 moinsetup has the following basic dependencies:
286
287 Packages Release Information
288 -------- -------------------
289
290 CMDsyntax Tested with 0.91
291 Source: http://www.boddie.org.uk/david/Projects/Python/CMDSyntax/index.html
292
293 New in moinsetup 0.4 (Changes since moinsetup 0.3)
294 --------------------------------------------------
295
296 * Added edit and event log permissions/ownership commands to the postinstall
297 scripts.
298 * Fixed the .htaccess file location for limited hosting environments, using
299 the static resources directory in preference to the application directory.
300 * Added support for separate static URL paths enforced by limited hosting
301 environments.
302
303 New in moinsetup 0.3 (Changes since moinsetup 0.2)
304 --------------------------------------------------
305
306 * Changed the command syntax to require -m (or --method=) before method
307 names; improved the error reporting when settings are missing or
308 inappropriate.
309 * Flattened the Wiki instance hierarchy, putting the configuration, data,
310 underlay and htdocs in the same top-level directory. (See the migration
311 section in the documentation for information on updating the hierarchy.)
312 * Changed the location of MoinMoin 1.9 resources, installing them in the
313 prefix hierarchy and copying only static resources into Wiki instances.
314 * Changed the handling of static resources with MoinMoin 1.9 to serve them
315 separately just as MoinMoin 1.8 does; this makes performance much better
316 when CGI is used under Apache.
317 * Moved the editing of the moin script into the setup method so that no
318 attempt is made to edit system programs.
319 * Made moin_distribution optional so that when MoinMoin is installed from a
320 system package, the non-installation actions can still be performed using
321 shared data typically found in /usr/share/moin.
322 * Added support for Wiki farms, separate library/site-packages directories,
323 and site identifiers (based on site names).
324 * Improved the MoinMoin version detection.
325 * Added an event handler installation action.
326
327 New in moinsetup 0.2 (Changes since moinsetup 0.1)
328 --------------------------------------------------
329
330 * Improved OpenID configuration, supporting MoinMoin 1.9, and added support
331 for other authentication methods.
332 * Added support for ACL-capable filesystems when setting Wiki permissions.
333 It can be more convenient to retain read/write access to the installed
334 files while also granting the Web server user (who need not be in a common
335 group) access to read and modify the files.
336 * Added support for configurations employing a separate static resources
337 directory (such as a typical "htdocs" directory).
338 * Added a parser installation action.
339 * Added support for page attachments in the page-packaging action.
340
341 Release Procedures
342 ------------------
343
344 Update the moinsetup.py __version__ attribute.
345 Change the version number and package filename/directory in the documentation.
346 Update the release notes (see above).
347 Tag, export.
348 Archive, upload.
349 Update the ScriptMarket (see above for the URL).