#!/bin/sh # a shell script to create a new MoinMoin Wiki with a given name # version 1.0 (9/July/2004) # # Rik Wade: moin@tcpip.fsnet.co.uk # This script is licensed under the GNU GPL # This software is provided without warranty # User editable variables MOINDIR="/usr/share/moin" APACHEUSR="www-data" APACHEGRP="www-data" WIKIDOMAIN="yourdomain.org" HTACCESS=".htaccess" FAVICON="/var/www/favicon.ico" # check for ARGV[1] if [ -z "$1" ]; then echo "usage: $0 " exit fi if [ -d "$1" ]; then echo "Directory already exists: $1" exit fi echo "Making a wiki with name $1" cd $MOINDIR echo "Making directory $1" mkdir $1 echo "Copying data to $1" cp -r data $1/ echo "Copying cgi-bin to $1" cp cgi-bin/* $1/ echo "Changing ownership to Apache Server" chown -R $APACHEUSR.$APACHEGRP $1 echo "Making cgi-bin executable" chmod a+rx $1/*.cgi echo "Append the following to your Apache configuration: httpd.conf" echo " #### $1 wiki ServerName $1.$WIKIDOMAIN Alias /wiki/ "$MOINDIR/htdocs/" Alias /favicon.ico $FAVICON ScriptAlias / "$MOINDIR/$1/moin.cgi/" AllowOverride None Options ExecCGI AuthType Basic AuthName "$1 Wiki" AuthUserFile $MOINDIR/$1/$HTACCESS require valid-user " echo "Done" echo "** Now set up AuthUserFile in $MOINDIR/$1/$HTACCESS **" echo "After restarting Apache, the Wiki will be available at: $1.$WIKIDOMAIN" echo