Translation(s): English - Français - ?Italiano
Contents
-
DokuWiki
- Differences between Debian package and upstream
- Installation
- Usage
-
Questions and answers
- Where is the site's data stored?
- Can you briefly list all steps necessary for multiple (separate) installations sharing the codebase?
- Can you install it on Ubuntu?
- How do I restore data from an older install on another machine?
- I installed using the Debian package, that would be the proper way to upgrade DokuWiki?
- How do I switch from using the Debian package to the upstream .tgz download?
- See also
DokuWiki
DokuWiki is available in the official Debian repository and may be installed with the usual Debian tools.
Differences between Debian package and upstream
Contrary to the standard DokuWiki installation, the Debian package:
- is managed by the package manager (of course), which allows you to get upgrades and security updates along with the your system;
- has specific paths, basically:
DokuWiki root is /usr/share/dokuwiki,
wiki data is /var/lib/dokuwiki/data,
configuration is /etc/dokuwiki;
- is initially configured by the package manager, not by the install web page;
- manages the configuration of your web server to give you access to your wiki too;
uses packaged libraries instead of some embedded ones such as Geshi and SimplePie.
Some of these decisions are made by the Debian packaging system itself; others, to comply with Debian policy. This has:
- some advantages: system integration, easy initial configuration.
- some drawbacks: file paths which deviate from the upstream project's documentation, which may lead to Debian-specific quirks or bugs.
Specific problems
The full list of bugs filed against the Debian package can be found here. Here are the most important problems you may encounter:
- old stable versions, and Debian-derived "Long Term Support" distributions may run into problems with version 0.20180422.a-2.1 of the package
the error message you'll see in the server logs (e.g., /var/log/apache2/error.log) will be: <code>Array and string offset access syntax with curly braces is no longer supported in /usr/share/dokuwiki/inc/init.php on line 557</code>
this was due to an incompatibility with PHP 8.1; it was addressed in bug #1004330, but not (yet) backported
if you find yourself in these circumstances (e.g., using oldstable or an older Ubuntu LTS), you can attempt to install a newer version from the "backports" repository, or, as a last resort, refer to the upstream project's help for installing from tarball on Debian systems
Bug reports
Please report bugs in the package using the Debian bug tracking system. See also the current list of bugs.
Installation
sudo apt-get install dokuwiki
Configuration files are in /etc/dokuwiki/.
Data files are in /var/lib/dokuwiki/.
Your DokuWiki is available at: http://localhost/dokuwiki
Starting with Debian Lenny and Squeeze with #backports, it asks you some questions for the initial configuration:
purge pages from /var/lib/dokuwiki/pages upon package removal?
- the administrator password
All these questions do not have the same priority:
low: those whose default values are relevant in most cases, for instance web path (default /dokuwiki);
medium: those with a reasonable default value, for instance wiki admin name (default “admin”);
high: those whith no reasonable default value, for instance wiki admin password (no default!).
The package will only ask you the questions which priority is higher than the one that you chose globally to be bothered with; you can set this parameter by reconfiguring the package debconf: # dpkg-reconfigure debconf
For instance, if you chose to be bothered with high priority questions only, you will not be asked for all the DokuWiki package questions. You can still reconfigure the package dokuwiki itself to get all the questions: # dpkg-reconfigure dokuwiki
Backports
The package versions in stable releases can be a bit outdated, especially oldstable. The upstream project's maintainers recommend always using the latest release in order to get the latest security updates, but Debian package maintainers can and often do backport fixes.
More up-to-date packages are often available using the backports repository. For instance, for Bookworm:
# echo "deb http://backports.debian.org/debian-backports bookworm-backports main" >> /etc/apt/sources.list.d/backports.list # apt-get update # aptitude install dokuwiki/bookworm-backports
Usage
After installation of the package, your DokuWiki install is available at http://localhost/dokuwiki. Replace localhost with the name or IP address of your server if it is not your local computer.
Starting with Debian Squeeze, your wiki is completely usable after installation.
Configuration of multisite support (farm) with virtual hosts
This option is only available in version 0.0.20101107-4 or later. We'll show how to create two DokuWiki sites in a virtual host-based setup.
Virtual Hosts
Create two minimal virtual hosts (using apache server for this example):
/etc/apache2/sites-available/cat
<VirtualHost *:80> ServerName cat.yourdomain.tld DocumentRoot /usr/share/dokuwiki </VirtualHost>
/etc/apache2/sites-available/dog
<VirtualHost *:80> ServerName dog.yourdomain.tld DocumentRoot /usr/share/dokuwiki </VirtualHost>
Enable the sites:
sudo a2ensite cat dog
And reload your server
sudo service apache2 reload
Add more directives to your virtual hosts if necessary (omitted here to simplify the example). Look at /etc/dokuwiki/apache.conf for a more complete default configuration.
Create DokuWiki sites
To create a new site, you can use the command dokuwiki-addsite(1):
sudo dokuwiki-addsite cat.yourdomain.tld sudo dokuwiki-addsite dog.yourdomain.tld
We have now two dokuwikis: one at http://cat.yourdomain.tld and the other one at http://dog.yourdomain.tld. They share the DokuWiki code, but have independent configurations and data.
Configuration files are in /etc/dokuwiki/farm/cat.yourdomain.tld and /etc/dokuwiki/farm/dog.yourdomain.tld.
Data files are in /var/lib/dokuwiki/farm/cat.yourdomain.tld and /var/lib/dokuwiki/farm/dog.yourdomain.tld.
Remove DokuWiki sites
sudo dokuwiki-delsite dog.yourdomain.tld
Questions and answers
Feel free to ask questions here!
Where is the site's data stored?
Under /var/lib/dokuwiki to comply with the Debian Policy and match the general system layout.
Can you briefly list all steps necessary for multiple (separate) installations sharing the codebase?
Implementing the farming within the Debian package is a mid-term goal, not achieved yet. Stay tuned.
Can you install it on Ubuntu?
Yes, because every package in Debian ends up in Ubuntu too. It is not directly maintained though, so things may break.
How do I restore data from an older install on another machine?
Copy /var/lib/dokuwiki/data from the old installation to the new one. Install the needed plugins manually.
I installed using the Debian package, that would be the proper way to upgrade DokuWiki?
Upgrade your system (from Bullseye to Bookworm for instance) or use a #backport.
How do I switch from using the Debian package to the upstream .tgz download?
Say you installed using the Debian package, but now (for whatever reason, maybe you need features or fixes only present in a later upstream release), you want to use the .tgz installation of the upstream DokuWiki project, which is not Debian policy compatible. Here are steps to move your content over:
First, get the latest DokuWiki tarball by following their Debian installation instructions. Then copy or move your content from the Debian-specific locations:
Put your old /var/lib/dokuwiki/data content into the data directory of your new DokuWiki installation.
- You can also try to restore:
your configuration file(s), under /etc/dokuwiki;
your plugins, under /var/lib/dokuwiki/lib/plugins.
Be aware that configuration and plugins from an older version of DokuWiki, when copied into a newer version, may cause problems. If you receive errors related to themes or CSS, it may help to purge the site's cache. Beyond that, it may be best to try seeking support in the DokuWiki forums first, before using Debian-specific support channels or reporting a bug.
(still verifying which of these questions are valid in the year 2025)
the web path where your wiki is to be available, that is, /dokuwiki, /wiki or whatever;