Installing MoinMoin on the Mitel SME Server
As I've done this a couple of times, I thought I should write it down. It's quite simple, but there are several steps to follow. Note that the full instructions are in the INSTALL.html file included in the MoinMoin tarball. I suggest you read the section on installing on Unix.
This has been tested on release 6.0.
Create the Ibay
Assuming you don't plan to use the Primary ibay, go into the server manager and create an ibay for the wiki. You'll need to enable CGI. For now, lets assume the group owning the ibay is called "moingroup". You can use the Primary ibay as well.
Install Moin
While you could grab the source tarball for this, I've packaged it into an rpm for the SME Server. Grab it from my contrib area.
Install it with rpm -Uvh moin-1.2.4-2.i386.rpm
Create your Wiki instance
You can create as many instances of MoinMoin as you like. Here's how to make one.
cd /usr/share/moin cp -r data myibay/../cgi-bin cp cgi-bin/* myibay/../cgi-bin cp -r htdocs/* myibay/../html cd myibay/../cgi-bin
All files should be mode 660, except for moin.cgi, which should be 750. Group ownership should correspond to the group for the ibay. Ownership should be "root", if the Wiki administrator is the administrator for the server, or the server admin wishes all new extensions to be screened and installed by him/her. Otherwise, give ownership of the files/directories to a user who will be administering the Wiki.
Hack index.html
The configuration file for MoinMoin is called moin_config.py, and it's in the cgi-bin directory. The basic defaults will need changing. Here is a basic config for a simple ibay.
# basic options (you normally need to change these) sitename = 'OPAG Wiki' interwikiname = 'OPAG' data_dir = './data/' url_prefix = '/ibayname' logo_url = url_prefix + '/classic/img/moinmoin.png'
I've also enabled ACLs, and force users to login before they can change anything.
# Enable acls acl_enabled = 1 acl_rights_default = 'Known:read,write,delete,revert All:read'
Modify this, if not the style sheets css will not function :
httpd_docs = "/usr/share/moin/htdocs/"
As the configuration file is python, you can even drop python code right in to customize behaviour. Be sure to read the Wiki docs. Also, make sure this file is not writable by anyone but root.
Add a ScriptAlias to the Apache config
For this Wiki, it runs out of cgi-bin/wiki/moin.cgi, but that's ugly to see in a URL. So, I've aliased that to "wiki". To do this on SME, you need a custom template of course. Mine is
/etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf/VirtualHosts/20IbayContent
But if this file doesn't exist, you copy it :
# cp /etc/e-smith/templates/etc/httpd/conf/httpd.conf/VirtualHosts/ /etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf/
Then edit the file :
# pico /etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf/VirtualHosts/20IbayContent
Here is a diff from the original template, to guide you.
@@ -22,6 +22,12 @@ . " # /sbin/e-smith/signal-event console-save\n"; } $OUT .= " Alias /files $basedir/files\n"; + + # Mike: Add a scriptalias for the opag wiki + if ($key eq 'opagsite') + { + $OUT .= " ScriptAlias /wiki /home/e-smith/files/ibays/$key/cgi-bin/wiki/moin.cgi"; + } my @ibays = grep { db_get_type(\%accounts, $_) eq "ibay" } keys %accounts;
paste the code between :
foreach my $ibay (@ibays) ... $OUT .= " # No ibays in system\n" unless @ibays;
in the "20Ibaycontent" file
then save the file, and do a :
# /sbin/e-smith/expand-template /etc/httpd/conf/httpd.conf
at last a :
service httpd-e-smith restart
You can verify in "httpd.conf" with, if the lines are added :
# pico /etc/httpd/conf/httpd.conf
Restrict access to the data directory
As I've instructed you to put the data directory under cgi-bin, this does create a potential security hole. Honestly, I can't see how to exploit it, since while we haven't explicitly told apache to deny access to that directory, all requests there will be treated as attempts to invoke a CGI and will fail. Still, as an extra measure of security, you can tell apache to block all requests there.
I have not yet done this. At the moment this is left as an exercise to the reader. It's a Wiki though, so update this if you get around to it. ;-)
Conclusion
That's it. You should have a workable wiki now. Hack the hell out of the default styles, as they're a kind of pukey-orange colour, and that's just not right. Be sure to back up your Wiki often, and before upgrades. You may find the information in it quickly becomes irreplaceable.
Please let me know if this information is inaccurate. Better yet, modify it yourself. It's a Wiki. Cheers...
After tests under SME 6.0.1 and have CSS problems
I've changed the content of those files to 20IbayContent:
if ($key eq 'ibayname') { $OUT .= " ScriptAlias /$key /home/e-smith/files/ibays/$key/cgi-bin/moin.cgi\n"; $OUT .= " Alias /wiki /home/e-smith/files/ibays/$key/html\n$ }
and the file moin_config.py:
url_prefix = '/wiki'
======================= Added by objetitos@gmail.com on April 20th, 2006 ========================
I have found after a while struggling with it that the provided RPM installs under python2.2. As on my server there are several versions of python (i.e.: 2.2, 2.3 and 2.4) and the link on /usr/bin points to 2.3, I was left with a "Forbidden" message on the browser and an error saying MoinMoin was not found (check the error log from your http server). By then, I already downloaded the latest tarball from MoinMoin's homepage and followed from there.
As of SME 7.0, where the scripts readed $ibay they should read $key. Y don't know with previous versions.