====== DokuWiki ======
These instructions detail how to install [[http://wiki.splitbrain.org/wiki:dokuwiki | DokuWiki]] on our Debian GNU/Linux system. We're currently running the 2008-05-05 version of DokuWiki.
===== Requirements =====
* Apache
* PHP (4.3.x or 5.x)
* PHP's [[http://de2.php.net/manual/en/ref.image.php|GD]] extension with [[http://www.boutell.com/gd/|libGD 2]] is recommended but not needed
===== Installation =====
Download and unpack the program:
export VERSION=2005-09-22
cd /home/web/wiki.sluug.org/
wget http://www.splitbrain.org/_media/projects/dokuwiki/dokuwiki-$VERSION.tgz
tar xfz dokuwiki-$VERSION.tgz
rm dokuwiki-$VERSION.tgz
rm -f public
ln -s dokuwiki-$VERSION public
cd public
touch data/changes.log
chown -R www-data:www-data * .ht*
Edit the .htaccess file. Make it look like this:
## We don't need to allow index files.
Options -Indexes
## Don't allow access to the .htaccess file.
Order allow,deny
Deny from all
Satisfy All
## Enable nice-looking URLs.
RewriteEngine on
RewriteRule ^lib/ - [L]
RewriteRule ^_media/(.*) lib/exe/fetch.php?media=$1 [QSA,L]
RewriteRule ^_detail/(.*) lib/exe/detail.php?media=$1 [QSA,L]
RewriteRule ^$ doku.php?id=home [QSA,L]
RewriteRule (.*) doku.php?id=$1 [QSA,L]
===== Configuration =====
Copy the example configuration file to use as a base:
cp conf/local.php.dist conf/local.php
Edit the ''conf/local.php'' file to look like this (make sure it doesn't have any blank lines outside the PHP tags):
Deactivate the automatic conversion of certain character combinations into different symbols since this destroys the ability to cut/paste commands and sample configuration data from the documentation. For example, DokuWiki was converting ''--inet=1'' into ''–inet='' which resulted in a single dash when cut/pasted from the browser to another window, with the copied command failing.
mv conf/entities.conf conf/entities.conf.out
===== Backups =====
Create a place to store our backup files, and make sure it's not readable by anyone:
mkdir -p /var/backups/web
chmod -R 600 /var/backups/web
Create the backup script in /etc/cron.daily/backup-dokuwiki:
#!/bin/sh
DATE=`date +'%Y%m%d'`
BACKUPDIR=/var/backups/web
EXCLUDE='data/cache/*'
INCLUDE='data/ conf/'
WIKIDIR=/home/web/wiki.sluug.org/public
tar cfz $BACKUPDIR/wikidata-$DATE.tgz -C $WIKIDIR --exclude="$EXCLUDE" $INCLUDE
Make the script executable:
chmod 755 /etc/cron.daily/backup-dokuwiki
Run the script to test that it works, and saves a file in /var/backups/web/. Run 'tar tfz' on the resulting backup file to make sure it contains files in the data and conf directories.
TODO: Copy the files in /var/backups off the server.
===== Testing =====
Browse to the [[http://wiki.sluug.org | wiki]] and make sure it shows up.
Try to edit a page. Make sure it saves OK.
Make sure history feature ("Old revisions") works.
===== Upgrading =====
Here are the steps taken to upgrade to version 2007-06-26b.
First we create a backup of the existing site.
cd /home/web/wiki.sluug.org
tar cfz /var/backups/web/wiki.sluug.org.BACKUP-`date +%Y%m%d`.tgz public
Download and unpack the new version.
export VERSION=2008-05-05
wget http://www.splitbrain.org/_media/projects/dokuwiki/dokuwiki-$VERSION.tgz
tar xfz dokuwiki-$VERSION.tgz
rm dokuwiki-$VERSION.tgz
Read through ''dokuwiki-$VERSION/.htaccess'' to look for anything new.
diff -u public/.htaccess dokuwiki-$VERSION/.htaccess.dist | less
Read through the ''dokuwiki-$VERSION/conf/dokuwiki.php'' file to look for any new config options.
diff -u public/conf/dokuwiki.php dokuwiki-$VERSION/conf/dokuwiki.php | less
Double-check to see if there are any patches in the old version of DokuWiki. If so, you'll probably have to manually apply the patches to the new version. (Check to ensure they're still needed first though.) In this case, I manually added the patch listed above.
find public -name '*.ORIG*'
Delete the old caches, since we don't need it, and the formats may have changed between versions. We can also use the new help pages (in the wiki namespace), so we can delete them from the old site.
rm public/data/cache/* -rf
rm public/data/pages/wiki -rf
Copy all the configuration info and data over from the old site to the new site.
cp -f public/conf/{local.php,acl.auth.php,users.auth.php} dokuwiki-$VERSION/conf/
cp -f public/.htaccess dokuwiki-$VERSION/
cp -a public/data/* dokuwiki-$VERSION/data/
It installed a new ''entities.conf'', so get rid of it again.
mv dokuwiki-$VERSION/conf/entities.conf dokuwiki-$VERSION/conf/entities.conf.out
Check to see if there are any custom templates in ''wiki.sluug.org/lib/tpl'' (besides the ''default'' template). We don't use any (yet), so we don't need to copy anything over.
Re-create the sitemap file.
touch dokuwiki-$VERSION/sitemap.xml.gz
Correct the ownership so that the web server can write to where it needs to.
chown -R www-data:www-data dokuwiki-$VERSION
Switch over to the new version.
rm public
ln -s dokuwiki-$VERSION public
Test the site. Make sure you can browse to a few different pages. Also make sure you can edit and save a page. Once you're comfortable that the upgrade went OK, you can delete the directory for the previous version of DokuWiki.
===== TODO: Enable ACLs and User Accounts =====
Create the conf/users.auth file:
touch conf/users.auth
chown www-data:www-data conf/users.auth
chmod 440 conf/users.auth
Add an admin account in the file (replace $WIKI_ADMIN_PWD with real password):
# echo "admin:`echo -n '$WIKI_ADMIN_PWD' | md5sum | awk '{print $1;}'`:Administrator:webmaster@sluug.org:admin,users" >> conf/users.auth
Create the conf/acl.auth file:
cp conf/acl.auth.dist conf/acl.auth
chown www-data:www-data conf/acl.auth
chmod 440 conf/acl.auth
Edit the conf/acl.auth file to look something look this:
* @admin 255
* @ALL 7
private:* @admin 255
private:* @ALL 0
readonly:* @admin 255
readonly:* @ALL 1
===== TODO =====
Copy the files in /var/backups off the server. Delete older versions, or at least create a subdirectory structure.
Accounts/ACLs. [[http://wiki.splitbrain.org/wiki:acl | See documentation]]. Set admin's password.
Turn on wordblock to ban edits with certain words (to prevent spamming and profanity)?
May not be necessary if we implement ACLs and require users to log in to make edits,
except for limited areas.
See if we have the PHP GD extension and libgd2. (I think they might have been installed now, but it was tricky to keep them from installing the entire X library set.)
Consider changing these config values: fetchsize, registernotify, gzip_output, pluginmanager, hidepages, sitemap
See if there are any new configuration settings we should change.
We should make sure there's a ''robots.txt'' file for the Wiki site.
We might want to consider setting permissions, so that local users can't read protected stuff. However, I don't think we're going to ever have any content that truly needs protecting.
===== Credits =====
Initially installed, configured, and documented by Craig Buchek, 2005-09-10. Updated to newer versions on 2005-11-26, 2007-05-09, and 2008-06-11.