test
[hcoop/zz_old/ikiwiki] / MoinMoinConfiguration.mdwn
CommitLineData
ee25310d 1We make it easy for you to set up your own MoinMoin wiki, without having to worry about managing your own installation of the software. Just follow these directions, which are a variation on the theme of HelpOnInstalling/WikiInstanceCreation:\r
2\r
3 1. Choose the directory where the data files for this wiki will live. Let's call it `$DATA`.\r
4 1. Copy `/usr/share/moin/data` and `/usr/share/moin/underlay` to `$DATA`.\r
5 1. '''Extra bonus gripe!''' Start a write-in campaign today to stop MoinMoin from wanting to write to the `underlay` directories of particular wikis. `underlay` contains pages that are exactly the same across all wikis, like documentation. However, MoinMoin wants to be cute and write cache data in the same directory. In a setting like ours, where different wikis run as different users, it's impossible to make things work out with a shared underlay directory, even though the majority of files in such a directory are never modified and are the same for everyone.\r
6 1. Set the permissions on your new directory to keep others from mucking with it:\r
7{{{chmod -R ug+rwX $DATA\r
8chmod -R o-rwx $DATA}}}\r
9 1. Copy `/home/hcoop/public_html/cgi-bin/moin.cgi` to `~/public_html/cgi-bin/`, one of its subdirectories, or anywhere you feel like storing CGI scripts. Call this directory `$CGI`. For instance, if you put `moin.cgi` in `~/public_html/cgi-bin/wacky/`, then `$CGI` is `/home/you/public_html/cgi-bin/wacky`. If you will be running the Wiki out of your own home directory (over `hcoop.net/~you/` -- that means without a real $VHOST), edit the bottom of `moin.cgi` to replace "/wiki" with something like `/~you/cgi-bin/moin.cgi`.\r
10 1. Create a `wikiconfig.py` in that same directory, or put this config somewhere else and modify `moin.cgi` so that it knows where to look. You can use `/home/hcoop/public_html/cgi-bin/wikiconfig.py` as an example. In contrast to normal MoinMoin procedure, we suggest that you keep your config files as short as possible by having them inherit from other config file classes. In particular, we've created a global `SiteConfig` class that uses all of the default options appropriate for use on the server you find it on. The example config that we just mentioned inherits from this and only sets options explicitly when they are specific to the current wiki. In any case, you are encouraged to look at `/etc/moin/siteconfig.py` for a list of options you can override. For Wikis that run out of your home directory (over `hcoop.net/~you/` -- that means without a real $VHOST), you'll want to override option "url_prefix" with a value like `/~you/moin`.\r
11\r
12\r
13 1. Choose a short name for your wiki, to appear in URLs. Let's call it $NAME. Despite what HelpOnInstalling/WikiInstanceCreation says, we use "wiki" as the name for this wiki, and it works fine because we use nonstandard URL mappings... but exactly why it works needn't really concern you. :-)\r
14 1. Pick a virtual host `$VHOST` where your wiki will reside. Modify its VirtualHostConfiguration file to:\r
15 1. Make sure that it contains a `User` directive for the same user whose `cgi-bin` directory you're using for `moin.cgi`, as well as a `Group` directive for a group that user belongs to. (Both of these are probably just your username, in the common case.) \r
16 1. Add a line `MoinMoin $NAME $CGI/moin.cgi` to enable MoinMoin requests.\r
17 1. Be sure that you have a DNS mapping to `www` for that virtual host in the relevant DnsConfiguration file. (If using a $VHOST and not `hcoop.net/~you/`).\r
18 1. Access your wiki at `http://$VHOST/$NAME/` (or maybe `hcoop.net/~you/`). Check out `/etc/domains/net/hcoop/wiki` for examples of other configuration you might want to set, including redirecting the front page of your vhost to your wiki.\r
19\r
20== Using Custom Themes Not Available in Global MoinMoin ==\r
21\r
22In order to use a custom theme available at various repositories, you must add a few lines to the wikiconfig.py file. If you set your wiki to reside at `hcoop.net/~user/`, then you are already one step ahead. Otherwise, this assumes you followed the rewrite rules for creating a wiki on a different domain.\r
23\r
24 1. First determine where in your website directory (e.g., `~/public_html/`) your themes will reside. For the use of this tutorial, we will call the theme directory `themes`, although more than just themes can reside in it for the use of MoinMoin.\r
25 1. Edit the wikiconfig.py file:\r
26 1. Add `url_prefix = '/themes'`\r
27 2. Add `theme_default = 'myUniqueTheme'`\r
28 3. Optionally, add `theme_force = True` so that users cannot select their own theme.\r
29 1. Ensure the `themes` directory exists in your web directory (i.e., `~/public_html/themes/`)\r
30 1. Install your unique theme to that location. If you desire to make available themes that come with the MoinMoin installation, you may copy them to this location. For example, `cp -R /usr/share/moin/htdocs/modern/ ~/public_html/themes/`. \r
31 1. MoinMoin may also need this directory to pull upon other files mentioned in your wikiconfig.py. You will need to copy the directories `common` en `applets` from `/usr/share/moin/htdocs` to this directory if you want Gui Editor to work.\r
32\r
33== Upgrading MoinMoin 1.2 wikis from Abulafia ==\r
34This is rather an obnoxious process; not in the least because one of the migration scripts (#10) doesn't appear to run properly. I've upgraded two of my wikis already, though, and I don't appear to have lost anything. Keep a backup of your data directory, just in case.\r
35\r
36Your wikis will be totally hosed when you move them, since there is no 1.2 installation available on the new server. This has the beneficial side effect of meaning you don't have to worry about people making changes behind your back!\r
37\r
38The process goes something like this:\r
39 1. Enter the directory that contains your wiki's "data" directory -- generally where you used to stuff your moin_config.py.\r
40 1. Run the scripts /usr/lib/python2.4/site-packages/MoinMoin/scripts/migration/12_to_13_mig01.py through 12_to_13_mig11.py Yes, all ''eleven'' of them. At the end of this process, you will have a bunch of data directories in various stages of unusability.\r
41 1. Copy over your underlay directories, new htdocs, moin.cgi, wikiconfig.py, etc, as shown above.\r
42\r
43''The documentation I read only suggested running 1 to 9, and that's worked perfectly for me for 2 wikis that I transferred. --AdamChlipala''\r
44\r
45''I was going by the documentation in /usr/share/doc/moinmoin-common/README.migration.gz, which kind of put the fear of God into me. It was telling me crazy, crazy things, like that I should move my data directory to where the migration scripts are. In site-packages, presumably! Regardless, the biggest pain was simply finding the documentation and piecing together the steps, so that's why I put this up. I don't suppose you can point to the documentation that you were using that suggested only running 1 to 9? --JeremyPenner''\r
46\r
47\r
48''I was viewing this version of the README that's on the MoinMoin wiki. Maybe it's just an out-of-date version, but I've had no problems so far.\r
49 http://moinmoin.wikiwikiweb.de/MoinMoinRelease1.3/README.migration\r
50--AdamChlipala''\r
51\r
52''Yeah, that's out of date. I would assume the README.migration on the server would correspond to the specific version of software installed on the server. Regardless, 10 and 11 don't do a hell of a lot -- they delete stray edit-lock files (you probably won't have any), convert attachment names to utf-8 (assuming you're using roman characters, they probably already are), and update your plugin directory (your custom MoinMoin plugins are already probably useless anyway. Assuming anyone besides me was writing custom MoinMoin plugins.). Probably nothing critical to your wiki surviving, but it won't hurt to run them, either. --JeremyPenner''\r
53\r
54== Controlling access to the Wiki ==\r
55\r
56The easiest way to control access to the wiki is to tune your virtual host configuration. Sometimes, however, this is not possible. For example, wikis installed in user directories (such as ''hcoop.net/USERNAME/cgi-bin/moin.cgi'') can't use ''.htaccess'' files or otherwise define access permissions. In such cases, you might directly edit the ''moin.cgi'' script and implement quick access control in there, directly, in Python. Here's a complete template you may copy-paste and populate with IP addresses of your choice:\r
57\r
58{{{\r
59import os, re, sys\r
60if not re.compile( '^(IP\.ADD\.RESS\.ONE|IP\.ADD\.RESS\.TWO)$').search( os.environ[ 'REMOTE_ADDR'] ):\r
61 print "*** ADDRES NOT AUTHORIZED ***"\r
62 sys.exit\r
63}}}\r
64\r
65This is a quite simple and elegant solution. By default, it only allows listed IP addresses to access the wiki. To reverse the meaning (allow all but the listed addresses), simply remove the '''not''' keyword. --DavorOcelic\r