install dokuwiki on apache in debian


This guide i am going to demonstrate just how to install and configure the version that is latest DokuWiki CMS platform on Debian 9.2 release, in order to create online documentation websites.

DokuWiki is a free open source wiki application written completely in the PHP programming language and often deployed in Linux under Apache/Nginx web servers and PHP.

DokuWiki software platform requires no RDBMS SQL database to run. In exchange, it uses simple text that is plain as backend so that you can keep all information. DokuWiki is a straightforward and platform that is flexible a clean syntax that can be successfully used to deploy powerful and collaborative documentation websites.


  • Minimal installation of debian 9 on a server that is bare-metal or on a virtual personal host.
  • sudo root privileges for an area or account that is remote direct access to root account.
  • A static IP address configured for one of your system network interfaces cards.
  • A domain name, private or public, depending on your deployment, with the proper DNS records configured for web services. The website via your server IP address.( if don’t have a valid or a registered domain name you can perform the installation and access************) (you should have a running mail server properly configured at your premises with remote access to its .IMAP and SMTP services.
  • If you want to use website registration, mail order confirmations and other features,************)


Before starting to install and configure DokuWiki from sources in your server that is own guarantee the machine satisfies all computer software demands for compiling and setting up the applying. Into the step that is first update your system repositories and software packages by issuing the following command.

apt update

apt upgrade

On the next step, execute the following command in order to install some necessary utilities that will be used to further manage your system from the command line.

apt install wget bash-completion zip unzip curl

After the system has been fully updated and the required utilities to manage your server have been installed, setup the name for your system by executing the following command (replace your hostname variable accordingly).

hostnamectl set-hostname

Verify machine hostname and hosts file by issuing the below commands.


cat /etc/hostname

hostname –s

hostname –f

 Next, install the ImageMagick software, required by DokuWiki to create image thumbnailing by issuing the command that is following

apt install imagemagick

 Finally, reboot Debian host in purchase to use kernel updates and the hostname modifications precisely.

init 6

DokuWiki is a web-based CMS wiki platform written in PHP programming language that is server-side. A web server, such as Apache HTTP server, and a PHP processing gateway must be installed and operational in the system in order to execute the PHP file scripts of the application.  To be able to install Apache internet host and PHP interpreter alongside all needed PHP modules required by the applying to perform precisely, issue the command that is following your server console.

apt install apache2 libapache2-mod-php7.0 php7.0 php7.0-curl php7.0-gd php7.0-opcache php7.0-json php7.0-mbstring php7.0-intl php-imagick php7.0-xml

After Apache and PHP has been installed, test if the web server is up and running and listening for network connections on port 80 by issuing the command that is following root privileges.

netstat –tlpn

In instance the netstat community energy is perhaps not set up by standard on your own Debian system, perform the command that is following install it.

apt install net-tools

By inspecting the netstat command output you can see the Apache web server is listening for incoming network connections on port 80. For the task that is same you may want to make use of the ss demand, which can be immediately set up automagically in Debian 9.

ss- tulpn

In instance you’ve got a firewall enabled on your own system, such as for example UFW firewall application, you ought to include a brand new guideline allowing HTTP traffic to feed the firewall by issuing these demand.

ufw enable WWW


ufw enable 80/tcp

If you’re utilizing iptables natural guidelines to handle Firewall guidelines on your own Debian host, include these guidelines allowing slot 80 incoming traffic regarding firewall to make certain that site visitors can browse your wiki application.

apt-get install -y iptables-persistent

iptables -I INPUT -p tcp –destination-port 80 -j ACCEPT

iptables -I INPUT -p tcp –destination-port 22 -j ACCEPT

netfilter-persistent save

systemctl restart netfilter-persistent

systemctl status netfilter-persistent

systemctl enable netfilter-persistent.service

Next, enable and use the Apache that is following module by the the web application to activate the weboot  .htaccess files. Run the following commands:

a2enmod rewrite

systemctl restart apache2

Finally, test if the Apache web server default web page can be displayed in your client’s browsers by visiting your machine that is debian IP or your domain title or host FQDN via HTTP protocol, as shown within the image below. In the event that you don’t understand your device’s ip, execute ifconfig or ip a demand to show the ip of the host.


Just how to Install DokuWiki with Apache on Debian 9 13

In purchase to put in and access DowuWiki internet admin panel backend and frontend internet site via HTTPS protocol that’ll secure the traffic for the customers, issue these demand make it possible for Apache internet host SSL module and SSL website setup file.

a2enmod ssl

a2ensite default-ssl.conf

Next, available Apache standard SSL website setup file with a text editor and enable rewrite that is URL by adding the following lines of code after DocumentRoot directive. Run the command that is following******)

nano /etc/apache2/sites-enabled/default-ssl.conf

SSL website setup file excerpt:

<Directory /var/www/html>
  choices +FollowSymlinks
  AllowOverride All
  need all issued

Also, make the following modification to VirtualHost line making it look such as the means it is shown in the excerpt below:

<VirtualHost *:443>

Just how to Install DokuWiki with Apache on Debian 9 14

Close the SSL Apache file and start the*****************************************************************************************************************)-default.conf that is/etc/apache2/sites-enabled file for editing and add the URL that is same rewrite for SSL setup file. Insert the lines of rule after DocumentRoot declaration as shown within the example that is following

<Directory /var/www/html>
  Options +FollowSymlinks
  AllowOverride All
  Require all granted

Just how to Install DokuWiki with Apache on Debian 9 15

Finally, restart Apache daemon to apply all rules configured so far and visit your domain via the HTTP protocol. A certificate that is untrusted by the browser, an error warning should be displayed in the browser.( because you’re using the automatically Self-Signed certificates pairs issued by Apache at installation******)

systemctl restart apache2


Just how to Install DokuWiki with Apache on Debian 9 16

Accept the caution so that you can accept the certificate that is untrusted continue to be redirected to Apache default web page, as illustrated in the image below.

Just how to Install DokuWiki with Apache on Debian 9 17

In case the UFW firewall application blocks network that is incoming to HTTPS slot, you ought to include a brand new guideline allowing HTTPS traffic to feed firewall by issuing these demand.

ufw enable ‘WWW Full’


ufw enable 443/tcp

If iptables may be the standard firewall application set up to guard your Debian system during the community degree, add the rule that is following allow port 443 inbound traffic in the firewall so that visitors can browse your domain name.

iptables -I INPUT -p tcp –destination-port 443 -j ACCEPT

netfilter-persistent save

systemctl restart netfilter-persistent

systemctl status netfilter-persistent

On the next step, we need to make some further changes to PHP default configuration file in order to assure that the following PHP variables are enabled and the PHP timezone setting is correctly configured and matches your system location that is geographical.  Start /etc/php/7.0/apache2/php.ini declare modifying while making certain that the lines that are following setup as shown. Also, initially, make a backup of the PHP configuration file.

cp /etc/php/7.0/apache2/php.ini{,.backup}

nano /etc/php/7.0/apache2/php.ini

 Search, edit and alter the variables that are following php.ini configuration file:

file_uploads = On
default_charset = UTF-8
memory_limit = 128M
max_execution_time = 300
upload_max_filesize = 100M
short_open_tag = Off
output_buffering = Off
output_handler =
zlib.output_compression = Off
implicit_flush = Off
max_input_time = 60
max_input_vars = 10000
error_reporting = E_ALL & ~E_NOTICE
display_startup_errors = Off
log_errors = On
variables_order = “EGPCS”
register_argc_argv = Off
session.use_cookies =***************************)date.timezone that is 1 = Europe/London

Increase upload_max_file_size adjustable as suitable to aid file that is large and replace the variable accordingly to your physical time by consulting the list of time zones provided by PHP docs at the link that is following*********************)

If you intend to raise the load rate of the internet pages via OPCache plugin designed for PHP7, append these OPCache settings at the end regarding the PHP interpreter setup file, as detail by detail below:


Close the php.ini setup and restart apache daemon to use the brand new modifications by issuing the command that is following

systemctl restart apache2

Finally, create a PHP info file by executing the following command and check if the PHP time zone has been correctly configured by visiting the PHP info script file from a browser at the following URL, as illustrated in the image that is below. Scroll right down to date establishing to check on PHP right time zone configuration.

echo ‘<?php phpinfo(); ?>’| tee /var/www/html/info.php


Just how to Install DokuWiki with Apache on Debian 9 18

Install DokuWiki

After all system requirements are met for installing your wiki documentation CMS, visit DokuWiki official download page at and grab the latest stable zip package compressed archive in your system by issuing the following command.


After the zip archive download finishes, extract the DokuWiki zip archive file to your working that is current directory list the extracted files by issuing these commands. Additionally, take away the standard index.html file set up by Apache internet host to also webroot path and delete the info.php file created earlier.

tar xzvf dokuwiki-stable.tgz


rm /var/www/html/index.html

rm /var/www/html/info.php

The installation files of DokuWiki are located in your current working directory in dokuwiki-2017-20-19e directory. Issue the ls command to list the extracted directory files. Copy all the content of the directory that is extracted your on line host document root course by issuing the demand below. Additionally, ensure you copy the file that is hidden to HTTP server webroot path.

ls dokuwiki-2017-02-19e/

cp -rf dokuwiki-2017-02-19e/* /var/www/html/

cp dokuwiki-2017-02-19e/.htaccess.dist /var/www/html/

Next, execute the commands that are following purchase to give Apache runtime individual with complete write permissions towards internet root course. Utilize the ls command to record permissions for application’s set up files found in the directory that is/var/www/html/

chown -R www-data:www-data /var/www/html/

ls –al /var/www/html/

Next, proceed with DokuWiki installation process by opening a browser and navigate your server’s IP address or domain name or server FQDN via HTTPS protocol and install.php that is open script.


On the installation that is first, add the name of your wiki platform and check Enable ACL. Supply a wiki superuser account name, the name that is real and current email address regarding the superuser account, and select a good password to guard the superuser account.

Next, choose general public Wiki (look over for everybody, compose and upload for users) as your initial ACL policy and uncheck Allow users to join up on their own so that you can wiki that is disable process for visitors. Also, select your content that is favorite license the displayed choices and uncheck the choice to deliver anonymous information to DokuWiki designers once per month.

whenever you complete, hit on Save switch to use the setup.

Just how to Install DokuWiki with Apache on Debian 9 19

On the screen that is next the installer will inform you that your previous configurations had been successfully saved to the DokuWiki configuration file located in your web server document root path, and you can delete the installation file.

Just how to Install DokuWiki with Apache on Debian 9 20

Before logging in to your wiki CMS backend admin panel, return to the server console and issue the following commands to delete the installation file and DokuWiki that is secure system files.

rm -rf /var/www/html/install.php

chown -R root:root /var/www/html/

chown -R www-data:root /var/www/html/data/

chown -R www-data:root /var/www/html/lib/plugins/

chown -R www-data:root /var/www/html/lib/tpl/

chown -R www-data:root /var/www/html/conf/local.php*

chown -R www-data:root /var/www/html/conf/users.auth.php

chown -R www-data:root /var/www/html/conf/acl.auth.php

chown -R www-data:root /var/www/html/conf/plugins.local.php*

In purchase to see your wiki application frontend, simply navigate towards host ip or domain title via HTTPS protocol and standard DokuWiki is going to be shown as illustrated within the screenshot that is below


Just how to Install DokuWiki with Apache on Debian 9 21

To manage the DokuWiki platform, click on top Log In link and use the credentials configured during the installation process in order to log in to DokuWiki backend admin panel – as shown in the screenshot below.

Just how to Install DokuWiki with Apache on Debian 9 22

To further configure your wiki platform, hit on top Admin button and use the Administration links to manage users, ACL, extensions, template style settings or other custom settings.

Just how to Install DokuWiki with Apache on Debian 9 23

Finally, to force visitors to browse the wiki website and to access the backend securely screen via HTTPS protocol so that you can encrypt the traffic between your host and customer browsers, go back to your server’s terminal and start the .htaccess file based in your document that is website root, by issuing the following commands.

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

nano /var/www/html/.htaccess

Then, edit the .htaccess file and at the bottom of the file, you can change the PHP that is native server aided by the under designs. Modify the PHP settings to fit your very own host resources and designs.

 .htaccess file excerpt:

# Modify PHP settings
php_value session.use_trans_sid 0
php_value register_globals 1
php_value upload_max_filesize 100M
php_value post_max_size 100M

Finally, include these guidelines within the .htaccess File in order to redirect domain traffic automatically to HTTPS.

# Redirect to HTTPS for all pages including the web that is main
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https{://%{SERVER_NAME}/$1|%{SERVER_NAME}/$ that is} [R,L]

Options -Indexes


 In instance you intend to redirect to https just the login, profile and admin pages, change the above mentioned redirect guidelines aided by the people shown below. The main page of your wiki website will not be redirected to https protocol.( in this case******)

# Switch to HTTPS on login, profile and admin actions
RewriteEngine On
RewriteCond %{HTTPS} !on
RewriteCond %{QUERY_STRING} do=(log|profile|admin)
RewriteRule ^(.*) https://%{HTTP_HOST}/$1 [R,QSA,L,NE]

That’s all! You have got effectively configured and installed DokuWiki platform in Debian 9.2. However, because the Apache HTTP server uses Self-Signed certificates to encrypt the traffic between the server and visitors’ browsers, a message that is warning often be produced and shown inside their browsers. This caution is detrimental to your reputation that is website and. In this case, you should buy a certificate issued by a trusted Certificate Authority or get a certificate that is free from Let’s Encrypt CA.

For other customized designs regarding DokuWiki, go to the paperwork web page during the after target:

How exactly to Install Kloxo control interface Centos 6.5 /7.0

Previous article

How exactly to produce an Encrypted File System on a DigitalOcean Block space amount

Next article

You may also like


Leave a Reply

More in Apache