28.1.07 – Happy new year. I recently had cause to set up moinmoin on ubuntu 6.10, and figured I’d give you the blow by blow. Because it’s not as simple as I’d like it to be, in spite of the excellent documentation on moinmoin’s website.
First, get the base packages. You’re looking at a simple “sudo apt-get install moinmoin-common”. No problems there, then.
Now, moinmoin is python based, which is good because if it wasn’t then there’s no way on this fucking planet that I would’ve managed the install properly. See, there’re a few things along the way that get mangled between apt-getting and attempting to follow the moinmoin documentation.
So, now grab the moinmoin official packages. I know, I know, you just apt-getted the binaries, but this actually seems like a necessary step. See, moinmoin wants to have a bunch of special MoinMoin scripts installed as python packages, and this is the easiest way to get there.
Once you’ve grabbed the official packages, gunzip and untar ’em to your desktop.
Locate setup.py and run it as described here. It adds all the packages to your python setup (python 2.4 is included as default on Ubuntu, I think). Remember to sudo the install command.
Now, test whether or not that worked properly. At the command line type “python”. THe prompt will change. Now type “import MoinMoin”. It should just work with no weird errors at all, you just get the >>> prompt again. Hit ctrl-D to leave python.
So great, you’ve got the install done. Next is to alter permissions and tweak some files to get YOUR wiki instance running rather than the default. You’ll appreciate the use of python as the base language here.
First, altering permissions. This is important as it changes how public your wiki is. I wanted one that only one group on my linux box could alter, everyone else was to be locked out. So, first thing I did was create a new user account to be the wiki admin. You can do this through gnome’s gui tool very easily, just use that for now.
I called my new user moinmoin and added a new group for that user called moinmoin, and my following examples assume that you do the same thing.
Now that you have the group and user IDs set up, cd into the moinmoin directory that you have; it’s /usr/share/moin. Now there are a few ways to change the group recursively. Easiest way is probably chgrp -R. So run this command:
sudo chgrp -R moinmoin ./
Now if you do an ls -l you should see that your moinmoin group (whatever it is) owns all the files and folders and whatnot.
Now do this:
sudo chmod -R 770 ./
This makes it so the owner, root, can edit everything, and anyone in the moinmoin group can edit everything, but the rest of the world can’t. It’s good security, unless you want to go the traditional wiki route of allowing ANYONE to edit ANYTHING in which case 777 is a good way to go.
Now, creating the wiki instance. The moinmoin documentation here is very good, so click here and follow it. If you make your wiki instance as the moinmoin user, it’ll have the correct group owner automagically.
If you make a mistake here, it’s most likely duplicating some directory names. My wiki is called SeventhSon, and when I checked their instructions I had a /usr/share/moin/SeventhSon/SeventhSon/[all the data], so I copied the data into the higher Seventh Son and deleted the other one.
Almost everything is done.
This is linux, based on unix. As such, when you want to offer a service it runs as a constant process; think about ssh. If you want ssh to run, you set up the sshd script to run. There’s a moinmoin script that needs to run in order to offer this service. Weirdly enough, I didn’t notice this being mentioned anywhere on moinmoin’s documentation, I found it mentioned here.
You may as well copy it into your wiki’s directory, for convenience. It’ll be in /usr/share/moin/server/, and it’s called moin.py You can run it from wherever you see it, though.
Almost there. If you run moin.py by entering from the wiki directory ./moin.py. You get instructions about how to access your wiki – open a browser and enter localhost:8000 as the URL to visit.
You should get an error, telling you something like:
“/org/mywiki/data doesn’t exist.”
I managed to luck upon the way to fix this.
sudo vi /etc/moin/mywiki.py and change the data directory listed in the last line to /usr/share/moin/[yourwikiname].