How can I install DokuWiki on CentOS 7 / CentOS 8?. In this tutorial, I’m going to work you through all the steps needed to have the latest version of DokuWiki up and running on CentOS 7 base system.

DokuWiki is a simple to use and highly versatile Open Source wiki software that doesn’t require a database. The fact that DokuWiki doesn’t use database makes it easier to do maintenance and backups

DokuWiki also has built-in access controls and external authentication connectors which makes it useful in the enterprise context. Also, the large number of plugins contributed by its vibrant community allow for a broad range of use cases beyond a traditional wiki.

Step 1: Update System

Start by updating your system.

sudo yum -y update

Step 2: Install Apache httpd web server

To install Apacheon CentOS 7, use the following command:

sudo yum -y update
sudo yum -y install httpd

If using firewalld, make sure http port is open on the firewall, also add https is using ssl encryption.

sudo firewall-cmd --permanent --zone=public --add-service={http,https}
sudo firewall-cmd --reload

Step 3: Install PHP & Extensions

Now install PHP and other extensions

CentOS 8:

sudo yum -y install php php-{cli,common,gd,mbstring,mysqlnd,xml}

CentOS 7

sudo yum -y install http://rpms.remirepo.net/enterprise/remi-release-7.rpm
sudo yum -y install epel-release
sudo yum -y install yum-utils
sudo yum-config-manager --disable remi-php54
sudo yum-config-manager --enable remi-php72
sudo yum clean all
sudo yum makecache fast
sudo yum -y install php php-{cli,common,gd,mbstring,mysqlnd,xml}

Check php version:

$ php -v
PHP 7.2.11 (cli) (built: Oct  9 2018 15:09:36) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies

Step 4: Download Dokuwiki

Now download and install DokuWiki

wget https://github.com/splitbrain/dokuwiki/archive/release_stable_2020-07-29.tar.gz -O dokuwiki.tgz
sudo tar zxvf dokuwiki.tgz -C /var/www/html/ --strip-components=1

Above command will download and extract dokuwiki archive to /var/www/html. Replace the path with a valid one if you need to.

Step 5: Configure httpd and DokuWiki

Next thing to do is secure DokuWiki using .htaccess.

cd /var/www/html
sudo cp .htaccess.dist .htaccess

Configure httpd.conf

Now tell Apache to restrict access to /var/www/html using .htaccess file defined

sudo vi /etc/httpd/conf/httpd.conf

Modify as below:

<Directory />
    AllowOverride none
    Require all denied
</Directory>

DocumentRoot "/var/www/html"

<Directory "/var/www">
    AllowOverride None
    Require all granted
</Directory>


# Further restrict access to the default document root:
<Directory "/var/www/html">
    Options Indexes FollowSymLinks MultiViews
    AllowOverride all
    Order allow,deny
    allow from all
</Directory>

Set permissions for DokuWiki DocumentRoot:

sudo chown -R apache:apache /var/www/html

Step 6: Configure SELinux

For SELinux in enforcing mode, run the following commands

sudo yum -y install policycoreutils-python
sudo chcon -Rv --type=httpd_sys_rw_content_t /var/www/html/conf/
sudo chcon -Rv --type=httpd_sys_rw_content_t /var/www/html/data/
sudo semanage fcontext -a -t httpd_sys_rw_content_t /var/www/html/data/
sudo semanage fcontext -a -t httpd_sys_rw_content_t /var/www/html/conf
sudo restorecon -v /var/www/html/conf/
sudo restorecon -v /var/www/html/data/
sudo setsebool -P httpd_can_network_connect on

Start httpd daemon

sudo systemctl start httpd && sudo systemctl enable httpd

You’re done with the installation section, the next thing is to configure DokuWiki.

Open your browser and go to:

http://dokuwiki-server-hostname/install.php

Answer initial questions accordingly, set superuser, enable ACL and login to DokuWiki dashboard.That’s all. You can then add skins and plugins available on the admin dashboard.

Similar guides:

How To Install Gollum Wiki on Ubuntu 18.04 LTS

How To Install Wiki.js on Ubuntu 18.04 / CentOS 7

How To Install GLPI on CentOS / RHEL 8

Your support is our everlasting motivation,
that cup of coffee is what keeps us going!


As we continue to grow, we would wish to reach and impact more people who visit and take advantage of the guides we have on our blog. This is a big task for us and we are so far extremely grateful for the kind people who have shown amazing support for our work over the time we have been online.

Thank You for your support as we work to give you the best of guides and articles. Click below to buy us a coffee.

LEAVE A REPLY

Please enter your comment!
Please enter your name here