User Tools

Site Tools


dokuwikipi_-_host_your_own_wiki_site_like_this_one

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



Put this at the end, and comment out any other similar entries.

<Directory /home/pi/dokuwiki>
    Options Indexes FollowSymLinks
    AllowOverride All
    Require all granted
</Directory>



      Now edit the following file:
      /etc/apache2/sites-enabled/000-default.conf


<VirtualHost *:80>
        # The ServerName directive sets the request scheme, hostname and port that
        # the server uses to identify itself. This is used when creating
        # redirection URLs. In the context of virtual hosts, the ServerName
        # specifies what hostname must appear in the request's Host: header to
        # match this virtual host. For the default virtual host (this file) this
        # value is not decisive as it is used as a last resort host regardless.
        # However, you must set it for any further virtual host explicitly.
        #ServerName www.example.com

        ServerAdmin al@nwalker.co.uk
        ServerName wiki.alanwalker.eu
        DocumentRoot /home/pi/dokuwiki
        DirectoryIndex doku.php
</VirtualHost>

        # Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
        # error, crit, alert, emerg.
        # It is also possible to configure the loglevel for particular
        # modules, e.g.
        #LogLevel info ssl:warn

        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined

        # For most configuration files from conf-available/, which are
        # enabled or disabled at a global level, it is possible to
        # include a line for only one particular virtual host. For example the
        # following line enables the CGI configuration for this host only
        # after it has been globally disabled with "a2disconf".
        #Include conf-available/serve-cgi-bin.conf

# vim: syntax=apache ts=4 sw=4 sts=4 sr noet


      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]]



dokuwikipi_-_host_your_own_wiki_site_like_this_one.txt · Last modified: 2023/03/10 16:56 by walkeradmin