Translations of this page?:

Package Manager Installation

As of Ubuntu 11.04 Natty Narwhal, the version of dokuwiki packaged with ubuntu is rather outdated (2010.12.25). You may be ahead to follow the generic Install instructions using the tarball instead.

sudo apt-get install dokuwiki

Fix an installer issue that would prevent you from starting DokuWiki:

sudo nano /etc/apache2/conf.d/dokuwiki.conf

locate the line

Alias /dokuwiki /usr/share/dokuwiki/

Now remove the extra slash after /usr/share/dokuwiki, it should look like this:

Alias /dokuwiki /usr/share/dokuwiki

Do ctrl-X to quit nano and save when asked. Now restart the Apache2 server with:

sudo /etc/init.d/apache2 restart

You are almost ready to go. Visit: http://localhost/dokuwiki/doku.php
Remember, that default configuration prevents you from visiting you dokuwiki outside localhost.

The initial DokuWiki setup is actually done when DokuWiki is installed. If you wish to redo the initial setup (http://localhost/dokuwiki/install.php) you have to do the following:

sudo chown -R www-data /usr/share/dokuwiki/conf/
sudo rm /usr/share/dokuwiki/conf/users.auth.php
sudo rm /usr/share/dokuwiki/conf/acl.auth.php
sudo nano /usr/share/dokuwiki/install.php

Find the following lines of code

  // main dokuwiki config file (conf/dokuwiki.php) must not have been modified
  $installation_hash = md5(preg_replace("/(\015\012)|(\015)/","\012",
                           @file_get_contents(DOKU_CONF.'dokuwiki.php')));
  if (!in_array($installation_hash, $dokuwiki_hash)) {
        $error[] = sprintf($lang['i_badhash'],$installation_hash);
        $ok = false;
    }

Change

$ok = false;

to

$ok = true;

Run the initial configuration with

http://localhost/dokuwiki/install.php

Alternative Easier Custom Installation

The version of DokuWiki that comes with Ubuntu is generally slightly older. Installing it via the package manager also does not seem to work very well. You can easily install the latest version by following these steps (tested on Ubuntu 9.04):

  • Make sure you have apache2 and PHP installed. If you do not have those up already, there are lots of instructions for installing them. You can test if you have Apache installed by navigating your browser to http://localhost/
  • Make sure you have the utility wget installed. Run the Synaptic Package Manager (click System, Administration, Synaptic Package Manager) and search for wget. It is very small so it is quick to install.
  • Go to the DokuWiki downloads page and get the link for the version you want to use. It will be something like: http://www.splitbrain.org/_media/projects/dokuwiki/dokuwiki-2010-11-07.tgz

Now click Applications, Accessories, Terminal. Then enter these commands:

cd /var/www
sudo wget http://www.splitbrain.org/_media/projects/dokuwiki/dokuwiki-2011-05-25a.tgz
sudo tar xvf dokuwiki-2011-05-25a.tgz
sudo mv dokuwiki-2011-05-25a dokuwiki
sudo chown -R www-data:www-data /var/www/dokuwiki

The last line is the bit of magic that will fix the write and access permissions and make apache2 find the files. Incidentally, nearly the same recipe can be successfully used to install other Apache applications such as Joomla, Drupal, etc. Needless to say, update the above command by changing the names slightly if you choose to download a different version of DokuWiki.

If you do not have wget, simply click in your browser to download the the DokuWiki file. Then do this:

cd /var/www
sudo mv ~/Desktop/dokuwiki-2009-12-25c.tgz .
(Now continue on with the tar command above)

:!: Dont forget to restart the Apache2 WebServer

sudo service apache2 restart

Now you should be able to navigate to http://localhost/dokuwiki/install.php

With this approach the package manager will not show DokuWiki as installed. To uninstall it again completely, do this:

cd /var/www
sudo rm -r -f dokuwiki

Additional Installation Information

For more information on installing and configuring Dokuwiki on Ubuntu, see debian_ubuntu_extras. Among other things, this covers how to set up nice urls using the htaccess option. It might also be useful to consult the Debian installation page. Paticularly useful is the discussion of the following command:

   dpkg-reconfigure dokuwiki

Installation Steps for Ubuntu Server 10.04LTS/Zentyal 2.2

I used the Zentyal 2.2 (browser based server configuration and management) installer to install Ubuntu 10.04 and these are the command-line steps necessary to get Dokuwiki working. PHP was not installed, so I've included that step. I did this as root (my prompt is 'root@s1:/var/www#', do not include this when copying and pasting), if you are not operating as 'root' you may need to append 'sudo ' before these commands:

# MOVE TO THE DIRECTORY THAT CONTAINS WEB PAGES:
root@s1:/# cd /var/www
 
# DOWNLOAD THE SOFTWARE:
root@s1:/var/www# wget http://www.splitbrain.org/_media/projects/dokuwiki/dokuwiki-2011-05-25a.tgz
 
# UNTAR IT:
root@s1:/var/www# tar xvf dokuwiki-2011-05-25a.tgz
 
# RENAME THE DIRECTORY 'dokuwiki':
root@s1:/var/www# mv dokuwiki-2011-05-25a dokuwiki
 
# CHANGE THE OWNER AND GROUP TO 'www-data':
root@s1:/var/www# chown -R www-data:www-data /var/www/dokuwiki
 
# INSTALL PHP5:
root@s1:/var/www# apt-get install php5 libapache2-mod-php5
 
# RESTART APACHE:
root@s1:/var/www# service apache2 restart

NOTE: loading in 'Firefox' on the Ubuntu machine did not work using 'http://localhost/dokuwiki/install.php', but DID WORK when i changed to 'http://127.0.0.1/dokuwiki/install.php'

Apache configuration for running DokuWiki in ~/public_html

This works with Ubuntu 11.04 natty:

  1. Install apache2 and the php5 module:
    sudo apt-get install apache2 libapache2-mod-php5
  2. Enable the userdir and rewrite modules:
    sudo a2enmod userdir
    sudo a2enmod rewrite
  3. To make your .htaccess work, edit /etc/apache2/mods-enabled/userdir.conf and change the AllowOverride directive to All1)
  4. By default, php is disabled for user directories. To enable it, comment the lines as per instruction in /etc/apache2/mods-enabled/php5.conf
  5. Restart apache with
    sudo service apache2 restart
1) FIXME: someone with more apache savvy than me can probably suggest a “safer” setting for AllowOverride
install/ubuntu.txt · Last modified: 2012/01/12 22:15 by ach
 
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 3.0 Unported
Imprint Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki
WikiForumIRCBugsGitXRefTranslate