DokuWiki is one of the most popular wiki implementations. I'm using it right now to write this tutorial. DokuWiki is a lightweight implementation possessing a of features which I find very useful and convenient:
That being said, let's move on to the requirements and installation steps.
DokuWiki is highly configurable and customizable and I'm going to define the features that are to be used by a wiki installation. These are the features I'm usually going for when doing a DokuWiki installation, such as this one:
git clone http://koala.cs.pub.ro/git/admin-public.git
razvan@swarm:~/scripts/dw$ ./dw-install ~/public_html/dw-test/ http://www.splitbrain.org/_media/projects/dokuwiki/dokuwiki-2011-05-25a.tgz http://swarm.cs.pub.ro/~razvan/dw-test * Logging information to /tmp/tmp.JYCdHg2w5P. * Using download link http://www.splitbrain.org/_media/projects/dokuwiki/dokuwiki-2011-05-25a.tgz * Downloading DokuWiki ... done. * Preparing installation folder /home/razvan/public_html/dw-test/ ... done. * Installing plugins * Installing plugin: Creole ... done. * Installing plugin: Google Analytics ... done. * Installing plugin: Include ... done. * Installing plugin: Index-Menu ... done. * Installing plugin: Display-Wiki-Page ...done. * Installing ggauth backend ...done. Installation complete. 1. Open in web browser: http://swarm.cs.pub.ro/~razvan/dw-test/install.php 2. Fill required information to complete the basic installation. 3. Remove /home/razvan/public_html/dw-test//install.php.bak file. 4. Run: ./dw-post-install /home/razvan/public_html/dw-test/ /~razvan/dw-test/
razvan@swarm:~/scripts/dw$ ./dw-post-install /home/razvan/public_html/dw-test/ /~razvan/dw-test/ * Updating conf/local.php ... done. * Updating .htaccess ... done.
The indexmenu plugin is installed but the index pages are not yet created. As written in the local.php} file, we will use index} as the index page:
$conf['plugin']['indexmenu']['page_index'] = 'home:index';
At the same time we will create and index menu on the start/home page.
You'll need to go through the following steps (mentioned in the readme} file):
{{indexmenu>..#2|js navbar nocookie id#random}}
====== Wiki Name ====== {{indexmenu>..#1|js navbar nocookie id#random}}
= Namespace Name == {{indexmenu>.#2|js}}
$conf['disableactions'] = 'register,profile,resendpwd'; $conf['authtype'] = 'ldap'; $conf['auth']['ldap']['port'] = 636; $conf['auth']['ldap']['server'] = 'ldaps://swarm.cs.pub.ro'; $conf['auth']['ldap']['usertree'] = 'ou=People,dc=swarm,dc=cs,dc=pub,dc=ro'; $conf['auth']['ldap']['grouptree'] = 'ou=Group,dc=swarm,dc=cs,dc=pub,dc=ro'; $conf['auth']['ldap']['userfilter'] = '(&(uid=%{user})(objectClass=posixAccount))'; $conf['auth']['ldap']['groupfilter'] = '(&(objectClass=posixGroup)(|(gidNumber=%{gid})(memberUID=%{user})))'; - This is optional but may be required for your server: $conf['auth']['ldap']['version'] = 3; - Mapping can be used to specify where the internal data is coming from. $conf['auth']['ldap']['mapping']['name'] = 'cn'; # Name of attribute Active Directory stores it's pretty print user name. $conf['auth']['ldap']['mapping']['grps'] = array('memberof' => '/CN=(.+?),/i'); - Optional debugging $conf['auth']['ldap']['debug'] = 1;
In case you choose to use LDAP authentication, you should disable the Dokuwiki's register}, send_password} and profile} options. This can be accomplished by two means:
The LDAP service often offers little support for group authorization inside DokuWiki. A better approach would be authenticating through LDAP and using another engine for authentication. This can be accomplished through the use of split authentication. I'm using it to authenticate through LDAP and use the basic user.auth.php} file in DokuWiki's conf} folder.
The experimental authentication backends, providing “split authentication” is deployed in the install script.
In order to configure split authentication, do the following:
$conf['authtype'] = 'split'; $conf['auth']['split']['login_auth'] = 'ldap'; # the auth backend for authentication $conf['auth']['split']['groups_auth'] = 'plain'; # the auth backend that supplies groups $conf['auth']['split']['merge_groups'] = false; # should groups from login auth also be included $conf['auth']['split']['use_login_auth_for_users'] = true; # Should login auth be used for supplying the list of users for usermanager $conf['auth']['split']['use_login_auth_for_name'] = true; # Should login auth supply user name, or only used if groups auth provides an empty name $conf['auth']['split']['use_login_auth_for_mail'] = true; # Should login auth supply email address, or only used if groups auth provides empty email.
- user:MD5password:Real Name:email:groups,comma,separated razvan:x:x:x:admin,so oana:x:x:x:so ddvlad:x:x:x:so dbaluta:x:x:x:so apitis:x:x:x:so bdrutu:x:x:x:so catalinme:x:x:x:so [...]
DokuWiki has a smart notification system that lets you know whether a new version of DokuWiki is available. A DokuWiki upgrade is fairly easy to accomplish. The upgrade steps are described on the official page.
The are two scripts you may use. One is to be run by root (the dw-upgrade} script), while the other (the dw-upgrade-no-root} script) may be run by a non-priviliged user. Each script creates a backup copy of the current wiki installation before upgrading.
The dw-upgrade} script (run by root}) is to be used when your backup needs to be web accessible. The backup uses the precises ownership information and access rights (may be owned by www-data}) such that it would be an exact copy of the original DokuWiki installation. In order for the backup copy to be completely accesible, its htaccess} filesh ould probably be updated.
The backup directory passed to the scripts should exist. This is where the actual backup is created using a name starting with dokuwiki-bak} (such as dokuwiki-bak-2011-09-12}).
A sample run is shown below:
razvan@swarm:~/scripts/dw$ ./dw-upgrade-no-root ~razvan/public_html/dw-test/ http://www.splitbrain.org/_media/projects/dokuwiki/dokuwiki-2011-05-25a.tgz ~razvan/public_html/backup/ * Logging information to /tmp/tmp.xQuZwTyfgu. * Downloading DokuWiki ... done. * Backing up Dokuwiki instance to /home/razvan/public_html/backup//dokuwiki-bak-2011-09-12 ... done * Upgrading Dokuwiki installation in /home/razvan/public_html/dw-test/ ... done * Installing plugins * Installing plugin: Creole ... done. * Installing plugin: Google Analytics ... done. * Installing plugin: Include ... done. * Installing plugin: Index-Menu ... done. * Installing plugin: Display-Wiki-Page ...done. * Installing ggauth backend ...done.
Enjoy!