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
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):
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
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
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'
This works with Ubuntu 11.04 natty:
sudo apt-get install apache2 libapache2-mod-php5
sudo a2enmod userdir sudo a2enmod rewrite
.htaccess work, edit /etc/apache2/mods-enabled/userdir.conf and change the AllowOverride directive to All1)/etc/apache2/mods-enabled/php5.confsudo service apache2 restart
: someone with more apache savvy than me can probably suggest a “safer” setting for AllowOverride