ManagedCloud Servers

High performance handled and monitored by us 24/7/365. A complete solution to provide you with our in house expertise 24/7 tailored to your specific needs. We'll setup a bespoke server for your site using the latest tehnologies so you can get the most out of your hardware and get your website loading quickly and reliably. Find out more..

cPanelCloud Servers

Recommended - High performance cloud servers with no technical knowledge required. If you're hosting multiple websites already and you're looking to consolidate, or if you're looking to isolate yourself from the shared hosting environment but you don't have the time or knoweldge to manage a server, then the Managed cPanel Servers are for you. Find out more..

UnmanagedCloud Servers

Our unmanaged range gives you complete control at rock bottom prices and our cloud platform boasts super fast multipath 40Gb/s network, the latest Intel Xeon V3 CPUs and enterprise grade redundant SSDs. If you're a sysadmin look no further, we offer some of the best specification to price ratio servers available. Find out more..

Want your very own server? Get our 1GB memory, Xeon V4, 20GB SSD VPS for £10.00 / month.

View Plans

How to Install DokuWiki on CentOS 7

Dokuwiki is a free and open source wiki software. It is written in PHP and doesn't require a database. Dokuwiki is popular because it is very simple, easy to use and has a very clean and readable syntax. It has built-in access control lists and supports over 50 languages.

In this tutorial, we will install DokuWiki on CentOS 7 server.

Requirements

DokuWiki does not require any special hardware requirements. It can be installed on servers with a small amount of RAM. All the required dependencies will be installed throughout the tutorial. You will need a minimal installation of CentOS 7 with root access on it. If you are logged in as a non-root user, you can run sudo -i to switch to root user.

Installing DokuWiki

Before installing any package it is recommended that you update the packages and repository using the following command.

yum -y update

Once you have your system updated, you can proceed to install the Apache web server.

yum -y install httpd

DokuWiki can be installed on any version of PHP greater than 5.6. You can install PHP 7 for high performance. PHP 7 is not included in default YUM repository, hence you will need to add the Webtatic repository in your system. Webtatic repository requires EPEL repository to work. Run the following command to install EPEL repository.

yum -y install epel-release yum -y update

Now install the Webtatic repository using the following commands.

rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm yum -y update

To install PHP 7.1 and all of the required PHP modules, run the following command.

yum -y install php71w php71w-curl php71w-cli php71w-gd

Once you have PHP installed, you can check the version of PHP using the following command.

php -v

You should get output similar to this.

[root@liptan-pc ~]# php -v
PHP 7.1.3 (cli) (built: Mar 19 2017 15:31:52) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.1.0, Copyright (c) 1998-2017 Zend Technologies

You will also need to enable Mod_rewrite in Apache web server by editing /etc/httpd/conf/httpd.conf using your favorite text editor.

nano /etc/httpd/conf/httpd.conf

Find the following line.

<Directory "/var/www/html">
AllowOverride None

Change it to AllowOverride All.

Now start the Apache web server and enable it to start at boot time using the following command.

systemctl start httpd systemctl enable httpd

As we have all the dependencies ready, we can now download the install package from the DokuWiki site.

cd /var/www/html wget https://download.dokuwiki.org/src/dokuwiki/dokuwiki-stable.tgz

The above command will always download the latest installer archive. Extract the archive using the following command.

tar -xvzf dokuwiki-stable.tgz

The above command will extract the package in a folder with similar name as dokuwiki-2017-02-19b. For ease of access, you can rename the directory using the following command.

mv dokuwiki-20* dokuwiki

Now create a virtual host for the wiki application. Run the following command to do one.

nano /etc/httpd/conf.d/wiki.yourdomain.com.conf

Paste the following lines into the file.

<VirtualHost *:80>
    ServerAdmin me@liptanbiswas.com
    DocumentRoot "/var/www/html/dokuwiki"
    ServerName wiki.yourdomain.com
    ServerAlias www.wiki.yourdomain.com
    ErrorLog "/var/log/httpd/wiki.yourdomain.com-error_log"
    CustomLog "/var/log/httpd/wiki.yourdomain.com-access_log" combined
</VirtualHost>

Replace wiki.yourdomain.com with any domain or subdomain you want to use to access the application. Save the file and exit from the editor. Run the following command to restart your Apache server.

systemctl restart httpd

Now you will need to provide the ownership of the application to the web server user using the following command.

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

You may also need to allow HTTP traffic on port 80 through the firewall if you are running one. Run the following commands to do so.

firewall-cmd --zone=public --permanent --add-service=http firewall-cmd --reload

You will also need to disable SELinux. To temporarily disable SELinux without restarting the server, run the following command.

setenforce 0

To completely disable the SELinux you will need to edit /etc/selinux/config file.

nano /etc/selinux/config

Find the following line:

SELINUX=enforcing

Change it to:

SELINUX=disabled

Now complete the installation using a web browser, go to the following link using your favorite web browser.

http://wiki.yourdomain.com

You will see the following page asking for administrator account creation.

Provide the name of your Wiki website. Further select the Enable ACL checkbox and provide the administrator credentials. Choose the ACL policy recommended is Public Wiki. Further, choose the license that you want to use with your content. Click Save button once done.

You will need to delete the install.php file now. Run the following command for same.

rm /var/www/html/dokuwiki/install.php

Once done, you can now access your wiki, it will look like shown below.

Conclusion

In this tutorial, we installed Dokuwiki on CentOS 7. You can now log in to your wiki using administrator credentials and add the content in it.

Want your very own server? Get our 1GB memory, Xeon V4, 20GB SSD VPS for £10.00 / month.

View Plans