At nearly all my recent engagements, clients have needed a means to collabarate, document and publish information across the organziation. Specifically, the information needed to be easily accessible, secure and configurable. In some instances, the client purchased expensive out of the box content management systems while others preferred using open source options. Each system offerred its own set of benefits and drawbacks.
In my research, I encountered a myriad of products which satifisfied the client's requirement to identify software that provided the ability to collaborate and document the organization's information. To my amazement, the number of options available were overwhelming, each claiming to provide features and benefits over others. My challenge became not in finding software which accomplished their need rather in sifting through the mountains of options available.
During my analysis, I realized most organizations had a common list of wants for their new collaborative software. Many listed the following attributes to be the most important when making the proper selection:
- Ease of Use: The solution needs to be easy to use, upgrade and manage.
- Cost: The software should ideally be open source and/or come at a minimal cost.
- Support: The software must provide proper documentation.
- Flexibility: The product needs to be flexible and pluggable to accommodate the organization's changing data/documentation needs.
- Active Development: The product must be in active development and have regular interval releases.
The solution, as you can guess from the title of this blog, was DokuWiki. DokuWiki satisfied and fulfilled all of the client's identified needs. It claimed to be very easy to use, was open source, provided the ability to add plugins, was actively developed and had a large user community. It also provided all the major features of a wiki including the ability to upload documents, spam protection, page access control (security), ability to customize, inline HTML and document renaming. In addition, it supported the ability to create web feeds, was extensible via plugins, and provided cross WIKI support.
For this tutorial, we'll be installing DokuWiki on Red Hat's Fedora Linux operating system running Apache 2 web server.
DokuWiki has a minimal set of requirements including
- A webserver which supports PHP
- PHP 5.12 or higher installed on the webserver
- A current browser
Note: Most people run DokuWiki on Apache but IIS, Nginx and lighttpd have been noted to work.
Install DokuWiki manually not with apt-get. Since it uses text files to store information, there is no need to install a database. Installation is as simple as downloading the required files, extracting them and modifying some file permissions.
- Download the latest release from http://www.splitbrain.org/Programming/PHP/DokuWiki/index.php.
- Open a terminal and issue the following commands:
$ cd /var/www $ tar -xzvf /path/to/your/download/dokuwiki-YYYY-MM-DD.tgz
- You should see the terminal extract the files from the compressed package.
- Do a list command to confirm your new directory exists:
- In the list you should see a directory named
- You can rename the directory, lets call it
$ mv dokuwiki-YYYY-MM-DD wiki
- Finally create a
changes.logfile which is required for Dokuwiki to function. Using the
touchcommand willl create an empty file called
$ touch wiki/data/changes.log
We want to note a couple important directories used by the wiki.
- Installation directory
- Data directory
First Time Access
We need to modify some permissions before the wiki can be accessible. Fortunately for us, DokuWiki provides a nice screen detailing any permission issues.
- Access your server at http://localhost/wiki/install.php.
You should see a screen with an attempt to load dokuwiki.
- You may have some errors on the screen which can be resolved by giving permission to the files that require access. The error(s) on the screen show you what files are affected.
- Navigate to the wiki root directory.
- Change all the wiki sub-folders recursively so www-data is the owner and group.
chown -R www-data wiki chgrp -R www-data wiki
- Ensure all the subdirectories were properly changed.
-rw-r--r-- 1 www-data www-data 10676 Feb 14 2009 feed.php -rw-r--r-- 1 www-data www-data 2206 Feb 14 2009 doku.php drwxr-xr-x 2 www-data www-data 4096 Feb 14 2009 bin -rw-r--r-- 1 www-data www-data 240 Feb 14 2009 README -rw-r--r-- 1 www-data www-data 17992 Feb 14 2009 COPYING -rw-r--r-- 1 www-data www-data 1470 Feb 14 2009 .htaccess.dist -rw-r--r-- 1 www-data www-data 16072 Feb 14 2009 install.php -rw-r--r-- 1 www-data www-data 185 Feb 14 2009 index.php drwxr-xr-x 8 www-data www-data 4096 Feb 14 2009 lib -rw-r--r-- 1 www-data www-data 12 May 26 14:56 VERSION drwxr-xr-x 7 www-data www-data 4096 May 26 14:56 . drwxr-xr-x 6 www-data www-data 4096 May 26 14:57 inc drwxr-xr-x 6 root root 4096 Aug 15 17:17 .. drwxr-xr-x 10 www-data www-data 4096 Aug 15 17:17 data drwxr-xr-x 2 www-data www-data 4096 Aug 15 17:31 conf
Migrating Data to a New Server or Installation
As previously mentioned, DokuWiki uses flat files to store the data. Migrating data to a new installation is as simple as moving the data directories to the new server WIKI directory.
- Navigate (
cd) to the new DokuWiki data directory
- Remove all the data (in this case move) to the
/tmpfolder. Moving to tmp means they will be deleted on next reboot, but you can still retrieve data before reboot if you goof up.
$ mv /var/lib/dokuwiki /tmp
- Copy the data directory from the old location to the new location.
$ cp -av /path/to/old/machine/var/lib/dokuwiki /var/lib/
- Login to newly populated wiki and administratively install all plugins that you had before.
Allowing Additional Upload File Types
- Create a file called
- Add mime-types to the file (! means mp3 will NOT be allowed for upload).
mp3 !audio/mpeg avi video/x-msvideo mpg video/mpeg mpeg video/mpeg
- Ensure permissions for
mime.local.confis set to
Increasing Max Upload File Size
- The file upload size is set in your PHP configuration,
php.ini, with the parameter
- The setting can be changed in a number of different places depending on your webserver and the method it uses to run PHP.
- For Apache & mod_php, add the following two lines to
.htaccessin the installed directory:
php_value upload_max_filesize 15M php_value post_max_size 15M
Note: Red Hat ES users will also want to check (and probably increase)
/etc/httpd/conf.d/php.conf, which is set by default to a fairly low value. This directive specifies the number of bytes from 0 (meaning unlimited) to 2147483647 (2GB) that are allowed in a request body.
For additional help, you can visit the following websites for information about DokuWiki: