DokuWiki Install

There are official DokuWiki instructions, you can find them at External Link
What I have created here is a guide to remind myself of some of the steps I took, and what commands I used (they are not in the DokuWiki guide)
So if you use a combination of my notes, and the official install guide, then you will get a working installation :)

Update and Upgrade your Pi

Even if you just install the latest build of Linux for your Pi, it's probably a bit out of date, to update it, run these two commands.

sudo apt-get update
sudo apt-get upgrade

The update is used to re-synchronize the package index files from their sources. The indexes of available packages are fetched from the location(s) specified in /etc/apt/sources.list(5). An update should always be performed before an upgrade or dist-upgrade.
The upgrade performs a software upgrade according to the list of updated packages obtained from the apt-get update command.

Install Apache, PHP and ImageMagick

To run your own copy of DokuWiki you will need the following:
1. Webserver supporting PHP (we are going to use Apache, but there are others) Required to host the Wiki
2. PHP5 - DokuWiki runs on PHP
3. Imagemagick - Used by DokuWiki for image handling.

To install Apache web server, use the following command:
sudo apt-get install apache2

To install PHP use the following command:
sudo apt-get install php5

To install ImageMagick, use the following command:
sudo apt-get install imagemagick

Download and Copy DokuWiki to your webserver and Extract

To download the DokuWiki software, navigate to the https://www.dokuwiki.org website and hit the download button

Copy docuwiki.tar.gz to pi /home/pi

Alternatviely, you can just download the DokuWiki tar file on the Pi
For this example, I am going to use the home folder, assuming that you are logged in as the Pi user

tar -xvf dokuwiki.tgz

This will extract all the files to a folder in your home location, so you should end up with this folder:
/home/pi/dokuwiki

Setup Apache Security

You can skip this step if you are only using your wiki internally. But if it will be on the internet, this is a must.
First we need to edit the /etc/apache2/apache2.conf file.

sudo nano /etc/apache2/apache2.conf

Add this section
<Directory /home/pi/>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>

ENSURE TO CHANGE AllowOverride to All (default) is none

You should have a section that looks like this:

<Directory />
Options FollowSymLinks
AllowOverride All
</Directory>
<Directory /home/pi/dokuwiki>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from al
</Directory>

For some reason I also had to duplicate this in the following file:
/etc/apache2/sites-enabled/000-default.conf
Change the DocumentRoot line to /home/pi/dokuwiki

Don't forget to restart Apache before testing these changes\\
sudo /etc/init.d/apache2 restart

To test the Apache settings, navigate to the following page:
http://yourserver.com/data/pages/wiki/dokuwiki.txt

If you see the page, then your security is not right, if you get an access error, then the apache security is working.
Now you can navigate to your IP Address, and you should see an error, with a link that says to run the installer, click this link
You will see some errors regarding folder access
{DOCUMENT_ROOT}/conf/ is not writable by DokuWiki. You need to fix the permission settings of this directory! •{DOCUMENT_ROOT}/data is not writable by DokuWiki. You need to fix the permission settings of this directory! •{DOCUMENT_ROOT}/data/pages is not writable by DokuWiki. You need to fix the permission settings of this directory! •{DOCUMENT_ROOT}/data/attic is not writable by DokuWiki. You need to fix the permission settings of this directory! •{DOCUMENT_ROOT}/data/media is not writable by DokuWiki. You need to fix the permission settings of this directory! •{DOCUMENT_ROOT}/data/media_attic is not writable by DokuWiki. You need to fix the permission settings of this directory! •{DOCUMENT_ROOT}/data/media_meta is not writable by DokuWiki. You need to fix the permission settings of this directory! •{DOCUMENT_ROOT}/data/meta is not writable by DokuWiki. You need to fix the permission settings of this directory! •{DOCUMENT_ROOT}/data/cache is not writable by DokuWiki. You need to fix the permission settings of this directory! •{DOCUMENT_ROOT}/data/locks is not writable by DokuWiki. You need to fix the permission settings of this directory! •{DOCUMENT_ROOT}/data/index is not writable by DokuWiki. You need to fix the permission settings of this directory! •{DOCUMENT_ROOT}/data/tmp is not writable by DokuWiki. You need to fix the permission settings of this directory!
You have to chmod each of these folders, it is good practice to work out the exact permissions required, but for testing purposes you can give all rights which is 777

So for the first error, {DOCUMENT_ROOT}/conf/ is not writable by DokuWiki
chmod -R 777 /conf

You need to repeat this for each line.

Click the Restart installer button, and if you see the setup page then you are ready to roll :)

DONT FORGET TO RUN THE MYSQL SECURE INSTALLATION
[[http://wiki.alanwalker.eu/doku.php?id=run_security_after_install]]