A free Open-Source Linux-driven, PHP-driven CVS repository bugbase & hosting site.
See: http://sourceforge.net/ or: http://sf.net
Support?
If you have troubles and hints below do not help you, you can also get some Support rather than asking below.
MoinMoin on SourceForge - Current Status
See site status page for news about the SourceForge servers.
SF has upgraded their web servers, as of 2004-12-05. The upgrade includes an update from Python 1.5.2 to Python 2.3.3, a change from Debian Potato to Fedora Core 2, and a policy to track changes to the OS vendor's updates (Red Hat Linux).
SF has updated their project folder policy, as of 2005-08-15. The project folder is now mounted read-only by the web server, so moin can not store its data in this location. They discourage the use of the filesystem and ask to use the MySQL database instead, but for MoinMoin this currently is no option. The alternative is to use /tmp/persistent, as described below.
http://sourceforge.net/community/forum/topic.php?id=3505&page 2008-09-24 There is no more interactive shell access - so the instructions below need some updating. Instead of shell access rsync and/or sftp have to be used to transfer the data. The path to the old /tmp/persistent now is /home/persistent/M/MY/MYPROJECT with rsync/sftp. All files you put there will be available to the webserver under /tmp/persistent/MYPROJECT, with read-write access. Old data in /tmp/perstistent have been purged, but simply re-uploading a backup makes it all work again.
2008-09-30: Is it really possible to run a moin wiki on sourceforge ? I can't find a moinmoin wiki running on their servers anymore. I only get a blank page, even if basic test (pythontest.cgi) still works. I added a try/except around the from MoinMoin.server.server_cgi import CgiConfig, run and I caught the following message : /usr/lib64/python2.4/lib-dynload/_socketmodule.so: failed to map segment from shared object: Cannot allocate memory
I don't know where this comes from, if I made a mistake or if moin really can't run on the new servers. -VincentFavreNicolin
That sounds like a broken python installation, you should talk to SF support about that.
2008-10-31: According to this annoucement, the memory limits have been increased on the sourceforge servers, specifically for perl and python scripts. This may re-enable running moinmoin on their servers, although I have not tried yet... -VincentFavreNicolin
Working Examples
2008-10-04 - By the moment those examples are not working due to the SourceForge migration changes
See bottom of this page for security risks (in short: anyone can modify/erase your entire wiki).
How To Install (version 1.6.1)
For these instructions, MY_PROJECT is the name of your SF project. For instance, if your project is abcproject, then your project's home directory is /home/groups/a/ab/abcproject.
First, we need some directories.
- /home/groups/M/MY/MY_PROJECT is the project's home dir on SF
- /home/groups/M/MY/MY_PROJECT/moin is where I put the moinmoin shared data
- /tmp/persistent/MY_PROJECT/MY_PROJECTwiki is where I put the moinmoin wiki instance data
- /home/groups/M/MY/MY_PROJECT/htdocs/wiki is where I put the moinmoin web-server accessible data
- /home/groups/M/MY/MY_PROJECT/cgi-bin is where I put the moin.cgi
Use your own directories/names for those, where MY_PROJECT is your project's unix name, and M/MY/MY_PROJECT the path to the group directory on SF. Here are all the commands I used:
cd /home/groups/M/MY/MY_PROJECT tar xzf moin-1.6.1.tar.gz cd moin-1.6.1 python setup.py install --prefix=/home/groups/M/MY/MY_PROJECT/moin/ cd .. mkdir -p /tmp/persistent/MY_PROJECT/MY_PROJECTwiki cp -R moin/share/moin/{data,underlay,config/wikiconfig.py} /tmp/persistent/MY_PROJECT/MY_PROJECTwiki/ chmod -R 0777 /tmp/persistent/MY_PROJECT/MY_PROJECTwiki/{data,underlay} chgrp -R MY_PROJECT /tmp/persistent/MY_PROJECT find /tmp/persistent/MY_PROJECT -type d | xargs chmod g+s
Note: The above is a complete showstopper though, anyone with an SF account can do bad things to your wiki now. On the other hand, moin's anti spam system seems to work quite well against standard spam attacks, so unless you have someone sabotaging your wiki on purpose, SF can work quite well.
At this point, you may delete the moin-1.6.1.tar.gz and the moin-1.6.1 folder again to save space.
Additionally, backing up is vital on the sf.net account with the permissions as they are. You will not be able to do this with the default umask that is set. Now edit moin/lib/python2.3/site-packages/MoinMoin/config/init.py
umask = 0775 # Was 0770
The above means, anything written by the running wiki later will have permissions 775. With default permissions, you wouldn't be able to access the wiki from the shell. Since the directories were 'setgid' above, and set to be the project group, this permission will mean that any content created by the Wiki will be editable from the shell by members of the project.
Are you sure? Apache on SF will create files as nobody:nobody, which means two things: With 775, you are not able to ever de-install or upgrade your main properly (and I remember I also had trouble getting my rsync backups to work). And additionally, everyone can put a script to SF (which then runs as nobody:nobody), and modify your wiki files at will anyway from that script, so there's not much point. -- Allefant 2006-11-29 00:46:17
Following this approach the files created by MoinMoin on my wiki I can definitely confirm that files are created as group "MY_PROJECT", but you are certainly correct that others could write (e.g.) PHP code to muck with such files. It does "raise the bar" for making changes, but SF is fundamentally insecure. I am certainly able to rsync the important parts of the Wiki to a safe backup location, although I note that MoinMoin has not applied the umask to every file it creates - some files in my Wiki have been created with mode 600 (i.e. the pagelinks cache, such as underlay/pages/WikiName/cache/pagelinks). Most files are like "drwxrwxr-x 4 nfsnobody rscds 4096 Nov 25 01:24 CategoryRoadmap". -- AndrewMcMillan 2006-11-29 01:23:17
Yes, such 600 files would explain my problems (not even rsync could read them then I guess). But if we can find out how they are generated, then maybe it's indeed better to suggest an umod of 775 instead of 777 (mentioning the PHP problem). I'll try to install another wiki instance on my SF account in the next days with 0755 and see if I can reproduce the problems.. -- Allefant 2006-11-29 15:28:20
cd /home/groups/M/MY/MY_PROJECT mkdir htdocs/wiki cp -R moin/share/moin/htdocs/* htdocs/wiki/ cp moin/share/moin/server/moin.cgi cgi-bin/
Configure htdocs/wiki/index.html to use the correct path (URL=/cgi-bin/moin.cgi for this example).
Now edit cgi-bin/moin.cgi and fill in the paths:
import sys sys.path.insert(0, '../moin/lib/python2.3/site-packages') sys.path.insert(0, '/tmp/persistent/MY_PROJECT/MY_PROJECTwiki')
Adjust the config, in my case /tmp/persistent/MY_PROJECT/MY_PROJECTwiki/wikiconfig.py. Besides the standard stuff, change the following:
data_dir = '/tmp/persistent/MY_PROJECT/MY_PROJECTwiki/data/' data_underlay_dir = '/tmp/persistent/MY_PROJECT/MY_PROJECTwiki/underlay/' url_prefix_static = '/wiki'
SourceForge Logo
You are required to display the SourceForge logo on your page (see this document, or the Shell/DB/Web page under the Admin pane on your project's page). The easiest way is to add the following to wikiconfig.py:
page_footer1 = """ <a href="http://sourceforge.net/projects/MY_PROJECT"><img align="right" src="http://sourceforge.net/sflogo.php?group_id=MY_PROJECT_GROUP_ID&type=1" width="88" height="31" border="0" alt="SourceForge.net Logo" /></a> """
Replace MY_PROJECT with your project name, and "MY_PROJECT_GROUP_ID" with your project group id. Both are available from the Admin pane of your project page. You can also experiment with page_footer2 rather than page_footer1, or adding vertical space with vspace="10" or a similar img parameter.
- See Also
macro/SourceForgeLogo macro
Hiding the cgi-bin/moin.cgi in URLS
If you want to hide the cgi-bin/moin.cgi from URLS, so the page http://MY_PROJECT.sf.net/cgi-bin/moin.cgi/FrontPage gets http://MY_PROJECT.sf.net/mywiki/FrontPage, do the following:
Place this .htaccess file into /home/groups/M/MY/MY_PROJECT/htdocs/:
RewriteEngine On RewriteRule ^mywiki(/.*)?$ /cgi-bin/moin.cgi$1 [type=application/x-httpd-cgi]
You can of course replace the regular expression ^mywiki(/.*)?$ by anything you like, except ^wiki(/.*)?$. See here for details: Apache Website
Then setup the script_name in your moin.cgi script (/home/groups/M/MY/MY_PROJECT/cgi-bin/moin.cgi):
properties = { 'script_name':'/mywiki'}
And in your wikiconfig (/tmp/persistent/MY_PROJECT/MY_PROJECTwiki/wikiconfig.py), adjust the cookie path (due to a bug in moin, it seems - otherwise cookies will be stored for the wrong path):
cookie_path = "/"
Change the "mywiki" to whatever you like, except "wiki", or even remove it completely (in the latter case, any request to your SF site will be passed to the moin.cgi).
- 20070309 - Is this still needed ? Cookies seem to work without this ?
If you like to use "wiki", you need to place everything under htdocs/wiki to a different folder. Direct and re-directed content need to have different URLs.
Putting the MoinMoin wiki directly at the root your web site
In OpenCV, we have setup to have MoinMoin as base for the site. To have this working, the .htaccess in the /home/groups/M/MY/MY_PROJECT/htdocs/ directory is like:
# start the rewrite engine RewriteEngine On # all uri starting with wiki are _not_ translated (we have images for example in it) RewriteRule ^(wiki.*)$ $1 [L] # all other uri are translated to the moin.cgi script RewriteRule ^(.*)$ /cgi-bin/moin.cgi/$1
When it doesn't work
For moin 1.5.0, it seems you need to apply this patch: http://moinmoin.wikiwikiweb.de/MoinMoinBugs/DeepCopyError
Getting BadContent to work
Enable AntiSpamPolicy in wikiconfig.py. This will work, but it won't be able to fetch updated spam information from moinmaster, due to the firewall settings on SF which prevent all outbound connections. One way around this is to update it from somewhere else using XmlRpc, for example I installed a cronjob at home which does it.
To do this, you need to enable XmlRpc writing on the wiki. I couldn't figure out how to make HTTP authentication work on SF for this (without having it also for the whole wiki), so the following is a bit hackish.
First, make a new user over the wiki, I used the name "Anti Spam Subsystem" for it. Then add this to your wikiconfig.py:
acl_rights_before = <whatever you already have here> + " Anti Spam Subsystem:read,write,admin" actions_excluded = []
Now, that new user has admin rights, and the putPage command in XMLRPC is enabled.
Next edit /home/groups/M/MY/MY_PROJECT/moin/lib/python2.3/site-packages/MoinMoin/xmlrpc/__init__.py. In the function xmlrpc_putPage, I simply added this to the start of the function:
1 if pagename == "BadContent": self.request.user = user.User(self.request, auth_username="Anti Spam Subsystem")
What this is supposed to do is, each xmlrpc_putPage to BadContent is done as the user "Anti Spam Subsystem", which means it can modify the page with Admin rights.
You should probably do something more sophisticated, anyone can now edit your BadContent page as admin over xmlrpc.
This should be all that's needed already, now run the following script from a cronjob on a machine able to connect to moinmaster: ScriptMarket/BadContentXmlRpcScript
It will then use xmlrpc to update the BadContent page on your SF wiki - and the update will appear as made by the user created above.
Back ups
If you followed the instructions on this page, then /tmp/persistent/MY_PROJECT/MY_PROJECTwiki is the directory with your writeable wiki data. Since all files have mode 777, you can simply copy that folder from your shell account. Or you can automate it by adding something like this to your local crontab:
rsync -r USER@shell.sf.net:/tmp/persistent/MY_PROJECT/MY_PROJECTwiki /my/backup/directory
It will make the backup directly to your local backup directory, and use rsync to only copy changed files.
If you are not afraid of some more command line options, better use this rsync:
rsync -v -r -t -z -f "- cache/" -f "- *.pyc" allefant@shell.sf.net:/tmp/persistent/MY_PROJECT/MY_PROJECTwiki /my/backup/directory
It will leave out all caches and pre-parsed python files (which will constantly change also by read-accessed).
Difficult Issues
It is hard to run a MoinMoin server on SourceForge, for several reasons:
- It is S-L-O-W (Like everything else on their project web servers)
- Don't forget to set the umask, as described, or you will end up with files only accessible by the webserver user.
- Because you need to make your writeable wiki data world-writeable, it is easy for anyone to eradicate your files - and in fact, it seems to happen quite regularly on SF that somehow all world-writeable files are deleted (e.g. on 2005-08-31). Daily backups of your wiki are therefore mandatory.
Tightening The Permissions
You can tighten the permissions somewhat from this. Firstly, directories and files which are not changed after installation can be locked down further by setting permissions of 755 after everything is working. Your wiki will work just fine if the following files and directories are changed to mode 0755 (or 0775 if you've changed it to the project group):
/tmp/persistent/MY_PROJECT /tmp/persistent/MY_PROJECT/MY_PROJECTwiki /tmp/persistent/MY_PROJECT/MY_PROJECTwiki/data /tmp/persistent/MY_PROJECT/MY_PROJECTwiki/underlay /tmp/persistent/MY_PROJECT/MY_PROJECTwiki/wikiconfig.py
There will also be a /tmp/persistent/MY_PROJECT/MY_PROJECTwiki/wikiconfig.pyc file which is the compiled configuration. If you change the configuration you should:
- chmod 777 /tmp/persistent/MY_PROJECT/MY_PROJECTwiki
- Visit a page on the Wiki, so it gets recompiled.
- chmod 755 /tmp/persistent/MY_PROJECT/MY_PROJECTwiki
There are quite possibly other directories which could be tightened down to mode 755. You should also consider making the directories group MY_PROJECT:
chgrp -R MY_PROJECT /tmp/persistent/MY_PROJECT chmod -R g+w /tmp/persistent/MY_PROJECT
If you do that after you've used the Wiki you will see masses of 'permission denied' messages which you can ignore. Setting the permissions this way will give other project members the ability to change things.