5208
Comment: Indicate command lines, since we have long commands
|
6020
update examples, bolden YOURDOMAIN
|
Deletions are marked like this. | Additions are marked like this. |
Line 3: | Line 3: |
This page explains how to quickly set up a MoinMoin wiki on one of your domains. | This page explains how to quickly set up a MoinMoin wiki on one of your domains, and also how to migrate old MoinMoin wiki instances to work with the current MoinMoin release. |
Line 13: | Line 13: |
'''We should have a global script that does all of this, and we should start this page with short instructions that use it, possibly retaining this behind-the-scenes information afterward. --AdamChlipala''' |
|
Line 16: | Line 18: |
mkdir -p $INSTANCE cp -r /usr/share/moin/data $INSTANCE cp -r /usr/share/moin/underlay $INSTANCE cp /usr/share/moin/config/wikiconfig.py $INSTANCE fs setacl $INSTANCE $USER.daemon read fsr setacl $INSTANCE/data $USER.daemon write fsr setacl $INSTANCE/underlay $USER.daemon write |
$ mkdir -p $INSTANCE $ cp -r /usr/share/moin/data $INSTANCE $ cp -r /usr/share/moin/underlay $INSTANCE $ cp /usr/share/moin/config/wikiconfig.py $INSTANCE $ fs setacl $INSTANCE $USER.daemon read $ fsr setacl $INSTANCE/data $USER.daemon write $ fsr setacl $INSTANCE/underlay $USER.daemon write |
Line 29: | Line 31: |
You can find an existing {{{moin.cgi}}} file at {{{/usr/share/moin/htdocs/moin.cgi}}}. Copy it into the same directory as the other MoinMoin stuff. | You can find an existing {{{moin.cgi}}} file at {{{/usr/share/moin/server/moin.cgi}}}. Copy it into the same directory as the other MoinMoin stuff. |
Line 32: | Line 34: |
cp /usr/share/moin/htdocs/moin.cgi $INSTANCE | $ cp /usr/share/moin/server/moin.cgi $INSTANCE |
Line 41: | Line 43: |
'''This is silly. We should create our own base file that already has this commented out. --AdamChlipala''' |
|
Line 43: | Line 47: |
There are several ways to do this, depending on what URL you want to use to access your wiki. What you place on your "alias" line, we will call '''$HTDOCS''': people commonly use either {{{moin}}} or {{{wikidata}}} there. | The easiest thing is to set up a dedicated web site for serving a MoinMoin wiki, like so: |
Line 45: | Line 49: |
Here's an example of putting the wiki on a new subdomain called "wiki", with a typical page in the wiki looking like {{{http://wiki.DOMAIN.TLD/SomePage}}}. | {{{moinMoin "mymoin" where Script = home "cgi-bin/moin.cgi" end}}} |
Line 47: | Line 53: |
{{{ web "wiki" with alias "$HTDOCS" "/usr/share/moin/htdocs"; scriptAlias "/" (home "$INSTANCE/moin.cgi/"); end; }}} |
When this is done within '''$YOURDOMAIN''', you get a new web virtual host `mymoin.$YOURDOMAIN` which expects your `moin.cgi` script to be in the base of your home directory. Change the `Script` parameter to alter this expectation. The static moin files are served out of `http://mymoin.$YOURDOMAIN/moin/...`, and the wiki pages themselves are accessed at URLs like `http://mymoin.$YOURDOMAIN/PageName`. If you do this, your '''$HTDOCS''' setting will be "moin". |
Line 54: | Line 55: |
Here's an example of putting the wiki into an existing domain, under the path "/wiki". A typical page in the wiki will look like {{{http://www.DOMAIN.TLD/wiki/SomePage}}}. | You can also add a MoinMoin wiki within a larger virtual host. For example: |
Line 56: | Line 57: |
{{{ web "www" with (* Some other stuff ... *) |
{{{web "other" where alias "/something" "/something_else"; |
Line 60: | Line 60: |
alias "$HTDOCS" "/usr/share/moin/htdocs"; scriptAlias "/wiki" (home "$INSTANCE/moin.cgi"); end; }}} |
addMoinMoin where Htdocs = "/wikidata"; Script = home "other/moin.cgi"; Prefix = "/mywiki" end end}}} Here, we add a wiki to a vhost `other.$YOURDOMAIN` that also has some other config. We ask to serve the static files with the URL prefix `wikidata` instead of `moin`, we say that `moin.cgi` file is found in the `other` subdirectory of our home directory, and we ask to serve wiki pages at `http://other.$YOURDOMAIN/mywiki/PageName`. |
Line 104: | Line 108: |
cd /usr/share/python-support/python-moinmoin/MoinMoin/script/old/migration/ | $ cd /usr/share/python-support/python-moinmoin/MoinMoin/script/old/migration/ |
Line 130: | Line 134: |
./152_to_1050300.py $DATA | $ ./152_to_1050300.py $DATA |
This page explains how to quickly set up a MoinMoin wiki on one of your domains, and also how to migrate old MoinMoin wiki instances to work with the current MoinMoin release.
New wiki
We already have MoinMoin installed on our system. All you need to do is copy a few files over, make a moin.cgi file, and add some DomTool configuration.
Copying files
We should have a global script that does all of this, and we should start this page with short instructions that use it, possibly retaining this behind-the-scenes information afterward. --AdamChlipala
Here's what you need to do to copy the files over. We assume that $INSTANCE is where you'd like to store the wiki data, and $USER is your username.
$ mkdir -p $INSTANCE $ cp -r /usr/share/moin/data $INSTANCE $ cp -r /usr/share/moin/underlay $INSTANCE $ cp /usr/share/moin/config/wikiconfig.py $INSTANCE $ fs setacl $INSTANCE $USER.daemon read $ fsr setacl $INSTANCE/data $USER.daemon write $ fsr setacl $INSTANCE/underlay $USER.daemon write
Thanks to jdrake for figuring this out.
Making a moin.cgi file
You can find an existing moin.cgi file at /usr/share/moin/server/moin.cgi. Copy it into the same directory as the other MoinMoin stuff.
$ cp /usr/share/moin/server/moin.cgi $INSTANCE
Then, you'll want to comment out the following line, by placing a "#" in front of it.
sys.path.insert(0, '/etc/moin')
This is silly. We should create our own base file that already has this commented out. --AdamChlipala
Adding to your Domtool configuration
The easiest thing is to set up a dedicated web site for serving a MoinMoin wiki, like so:
{{{moinMoin "mymoin" where
- Script = home "cgi-bin/moin.cgi"
end}}}
When this is done within $YOURDOMAIN, you get a new web virtual host mymoin.$YOURDOMAIN which expects your moin.cgi script to be in the base of your home directory. Change the Script parameter to alter this expectation. The static moin files are served out of http://mymoin.$YOURDOMAIN/moin/..., and the wiki pages themselves are accessed at URLs like http://mymoin.$YOURDOMAIN/PageName. If you do this, your $HTDOCS setting will be "moin".
You can also add a MoinMoin wiki within a larger virtual host. For example:
{{{web "other" where
- alias "/something" "/something_else"; addMoinMoin where
- Htdocs = "/wikidata"; Script = home "other/moin.cgi"; Prefix = "/mywiki"
end}}}
Here, we add a wiki to a vhost other.$YOURDOMAIN that also has some other config. We ask to serve the static files with the URL prefix wikidata instead of moin, we say that moin.cgi file is found in the other subdirectory of our home directory, and we ask to serve wiki pages at http://other.$YOURDOMAIN/mywiki/PageName.
Modifying wikiconfig.py
As the final step, you will want to edit wikiconfig.py, which resides in your $INSTANCE folder. Remember the directory that you called $HTDOCS from the previous section, and use it below.
Change the line:
url_prefix = '/wiki'
to:
url_prefix = '$HTDOCS'
At this point, check out the rest of that file to set, for example, your site name. When done, tell domtool to update your configuration, and point a browser at your new wiki installation.
Migrating old MoinMoin wikis
Depending on the last version of MoinMoin you used, this could be tricky. The good news is that once you migrate your wiki instance to the version of MoinMoin that we have installed, migration should be a lot easier in the future.
If you know what version of MoinMoin you used previously, then skip to the appropriate section. Otherwise read on, and we will try to help you figure it out.
We will call your MoinMoin data directory $DATA.
Before MoinMoin 1.2
Good luck. You'll have to download MoinMoin 1.2.4 yourself, upgrade to it first, and then remove MoinMoin 1.2.4 and proceed with the next sections. If you have hosted a MoinMoin on an old HCoop server, you almost certainly had a later version of MoinMoin than this.
MoinMoin 1.2 through 1.3.4
If you want to know whether you have at least MoinMoin 1.3.4, check for the existence of the $DATA/plugin/__init__.py file. If you have it, skip this section. Otherwise, continue on.
First, back up your data by making a copy of it.
Then, change to the directory where the migration scripts are located:
$ cd /usr/share/python-support/python-moinmoin/MoinMoin/script/old/migration/
Then, consult /usr/share/doc/moinmoin-common/README.Migration.gz, and figure out which scripts you need to run. Unfortunately, you'll have to either know exactly which version of MoinMoin you were last using, or do some detective work by looking at the migration scripts themselves.
To run an individual script (in this example, the 12_to_13_mig11.py script), do:
$ ./12_to_13_mig11.py $DATA
This brings you up to MoinMoin 1.3.5.
MoinMoin 1.3.5
If you have previously used an old HCoop server, this is most likely the version you last used.
First, change to the directory where the migration scripts are located:
$ cd /usr/share/python-support/python-moinmoin/MoinMoin/script/old/migration/
Then, run just this one migration script:
$ ./152_to_1050300.py $DATA
This brings you up to MoinMoin 1.5.3.
MoinMoin 1.5.3 or later
You have it easy. Just run the following, from any directory.
$CONFIGDIR is the full path to the directory that has your wikidata.py file, without any "~" characters. We will call your Wiki URL (example: wiki.DOMAIN.TLD/) $WIKIURL.
$ /usr/share/doc/moinmoin-common/examples/moin --config-dir=$CONFIGDIR --wiki-url=$WIKIURL migration data