Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Private wiki farm with OpenID and Google login
PHP ApacheConf Shell JavaScript Perl CSS

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
about
css/smoothness
debian
help
js
.gitignore
COPYING
DataTables-1.7.1.zip
DefaultFarmSettings.php
GeSHiHighlight.php
Makefile
README
README-ami
README-buildpackage
README-extensions
README-performance
README-restore
SimpleTable.php
WikifarmAuthPlugin.php
WikifarmDriver.php
WikifarmPageMachine.php
adminhelp.textile
awstats.00.conf
awstats.all.conf
claim-wiki-by-password.php
commonist-0.3.43-wikifarm-1.15.patch
commonist-0.3.43-wikifarm-1.15.patch.sh
commonist-0.3.43.zip
config.php.example
favicon.ico
help.textile
index.php
initialize_wikis_db.php
install
login-bg.gif
login.php
logout.php
make_admin_user.php
mysql-utf8.cnf
php-apc-patch
serverlogo.png
setup
style.css
textile-2.0.0-php-5.2.4.patch
textile-2.0.0.tar.gz
wikifarm-apache2.conf.in
wikifarm-auth.pl
wikifarm-backup.sh
wikifarm-create-wiki
wikifarm-log-split.pl
wikifarm-php.ini
wikifarm-sudo-disable
wikifarm-sudo-enable
wikifarm-template-save
wikifarm-update-config.pl
wikifarm-update-stats.sh

README

===================================================================
Copyright 2010 President and Fellows of Harvard College

Authors:
Tom Clegg <tom@clinicalfuture.com>
Jer Ratcliffe <jer@clinicalfuture.com>

This file is part of wikifarm.

Wikifarm is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License version 2 as
published by the Free Software Foundation.

Wikifarm is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
General Public License for more details.

You should have received a copy of the GNU General Public License
along with wikifarm.  If not, see <http://www.gnu.org/licenses/>.
===================================================================

NOTE: This file documents how to set up a wikifarm on a plain Linux
system, like the Ubuntu Lucid image available on AWS.

An even quicker method is to use a pre-built AMI -- see README-ami.

===================================================================

Installing on AWS
=================

Create instance

* use ami-714ba518
* Select a suitable private key, so you can log in
* Select a security policy with ports 22, 80, and 443 open

Update your OS

  sudo aptitude update && sudo aptitude full-upgrade

Add the wikifarm repository to your apt sources

  wget -q -O- http://apt.clinicalfuture.com/clinicalfuture-key.gpg | sudo apt-key add -
  echo deb http://apt.clinicalfuture.com/wikifarm lucid main | sudo tee /etc/apt/sources.list.d/wikifarm.list
  sudo apt-get update

Install and enable wikifarm

  sudo apt-get install wikifarm
  sudo a2dissite default
  sudo a2ensite wikifarm
  sudo /etc/init.d/apache2 restart

Change your default mysql character set to utf8

  sudo cp /etc/wikifarm/mysql-utf8.cnf /etc/mysql/conf.d/utf8.cnf
  sudo /etc/init.d/mysql restart

Create an administrator account

* Visit http://{your.wiki.farm}
* Log in with your OpenID
* Copy your OpenID from the "my account" screen
* Run:
 /etc/wikifarm/make_admin_user.php http://YOUR.OPENID.HERE
* Provide your email address and real name on the "my account" page
* Click "Save changes"

Create the base wiki config and database

* Visit http://{your.wiki.farm}/00 and click "set up the wiki".  Fill in the form:
* wiki name: Wiki (won't be used)
* random password for WikiSysop (won't be used)
* database name "wikidb00"
* db username "wikiuser"
* db password "wikipass"
* yes, use superuser account.
* provide the MySQL root password you used when installing mysql-server.
* Click "Install MediaWiki!"

Copy the config file to the template wiki and lock it down

  /etc/wikifarm/wikifarm-template-save

Configure your server so it can send email notifications

* If you are using AWS, use a smarthost or attach an elastic IP address to your instance.
* Example:
  sudo dpkg-reconfigure exim4-config

Fix PHP session garbage collection

* Run /usr/lib/php5/maxlifetime
* If it reports "24" it is not reading the wikifarm.ini.
* Edit /usr/lib/php5/maxlifetime as follows:
  -for ini in /etc/php5/*/php.ini; do
  +for ini in /etc/php5/*/*.ini; do

(Optional) install mediawiki-math

  sudo apt-get install mediawiki-math

(Optional) create an AMI

* Delete any OpenID accounts you created during testing/setup:
  sqlite3 /var/lib/wikifarm/db/wikis.db 'delete from users; delete from usergroups;'
* Delete some history, cache, etc.
  sudo apt-get clean
  rm -rf ~/.*_history ~/.cache ~/.sudo_as*
  unset HISTFILE
  exit
* Shut down (not terminate) your instance
* Create an AMI from your instance (takes ~ 1/2 hour)
* Start an instance using the new AMI and test it (see README-ami)

Turn off deleteOnTermination attribute on your EBS volume

* Make sure your workstation is >= lucid
* Determine your instance id, EBS volume id, and root filesystem device
  (perhaps using "ec2-describe-instances -v")
* Turn off deleteOnTermination flag:
  ec2-modify-instance-attribute i-ef5eb785 -b /dev/sda1=vol-9a1980f3:false -v

(Optional) switch to SSL

* Create/obtain a signed site certificate
* Enable ssl:
  sudo a2enmod ssl
  sudo /etc/init.d/apache2 restart

Ensure your users always access your server with the same hostname.

* Some OpenID providers (including Google) do not supply the same
  OpenID URL when the same user signs in to different OpenID consumer
  sites.  This means your users must always access your wikifarm using
  the same domain name (i.e., only one of "http://example.com",
  "https://secure.example.com", "http://1.2.3.4").  The following code
  can be used in /etc/apache2/sites-available/wikifarm to accomplish
  this.

    <Limit GET HEAD>
      RewriteCond %{HTTP_HOST} !your.canonical.host.name
      RewriteRule (.*) https://your.canonical.host.name$1 [R,L]
    </Limit>

Create wiki number 01 for yourself

* Visit http://{your.wiki.farm}.
* Click "My Wikis"
* Complete the form
  (Name this wiki "docs" so the link to "/docs/Wiki_Tutorial" on the
  Help tab will work)
* Click "Create new wiki"
* You have Sysop privileges in your new wiki, so you can protect
  pages, edit the MediaWiki:Sidebar page, etc.

(Optional) install other mediawiki extensions

* see README-extensions

(Optional) improve performance

* see README-performance

(Optional) customize site appearance

* Set site slogain in /etc/wikifarm/config.php
  (see /etc/wikifarm/config.php.example)
* Install logo graphic in /var/lib/wikifarm/www/serverlogo.png
  (64 pixels high for best results)
* Install favicon in /var/lib/wikifarm/www/favicon.ico
  (16x16 pixels for best results)
Something went wrong with that request. Please try again.