Install DokuWiki on CentOS 8

In this demo, we will learn how to install DokuWiki on a CentOS 8 server. DokuWiki Is open source software written in PHP that allows users to create and edit pages using a web browser. It works for plain text and does not require a database. Read about the features provided by DokuWiki, see DokuWiki feature page.

Install DokuWiki on CentOS 8

Run system update

First, make sure your system packages are up-to-date.

Install PHP and other required PHP modules

DokuWiki is a PHP-based web application that requires PHP and some other PHP extensions to function properly. These can be installed by running the following commands;

dnf install php php-gd php-xml php-json

Run Apache Web Server

In this demo, we use Apache as the web server for DokuWiki. Apache is installed with PHP.

dnf info httpd
Installed Packages
Name         : httpd
Version      : 2.4.37
Release      : 16.module_el8.1.0+256+ae790463
Architecture : x86_64
Size         : 5.4 M
Source       : httpd-2.4.37-16.module_el8.1.0+256+ae790463.src.rpm
Repository   : @System
From repo    : AppStream
Summary      : Apache HTTP Server
URL          : https://httpd.apache.org/
License      : ASL 2.0
Description  : The Apache HTTP Server is a powerful, efficient, and extensible
             : web server.

If it is not installed for some reason, run the following command to install it.

dnf install httpd

Next, start and enable Apache to run on system boot.

systemctl enable --now httpd

Allow Apache through the firewall

To allow HTTP traffic to the DokuWiki server remotely, you need to open port 80 on the firewall. Otherwise, for HTTPS, open port 443. This demo uses HTTP, so open port 80 / TCP by running the following command; otherwise, use the following command.

firewall-cmd --permanent --add-port=80/tcp
firewall-cmd --reload

Install DokuWiki on CentOS 8

The installation of DokuWiki is as simple as downloading the application itself and placing it in the default web root directory.

Download stable release

Navigation DokuWiki download page And get the latest version. You just need to run the following command to download the current stable release of DokuWiki.

dnf install wget
wget https://download.dokuwiki.org/src/dokuwiki/dokuwiki-stable.tgz

Extract DokuWiki Tarball

After the download is complete, run the following command to extract DokuWiki to the default web root directory, ie /var/www/html In this demo.

dnf install tar
tar xzf dokuwiki-stable.tgz  --strip-components=1 -C /var/www/html/

This will extract DokuWiki and place it in /var/www/html/.

ls /var/www/html/
bin  conf  COPYING  data  doku.php  feed.php  inc  index.php  install.php  lib  README  vendor  VERSION

Create Apache VirtualHost for DokuWiki

Create an Apache VirtualHost for DokuWiki as shown below;

vi /etc/httpd/conf.d/dokuwiki.conf

	ServerName    dokuwiki.kifarunix-demo.com
	DocumentRoot  /var/www/html

	
	    
        	Require all denied
	    
	    
	        Order allow,deny
        	Deny from all
	    
	

	ErrorLog   /var/log/httpd/dokuwiki_error.log
	CustomLog  /var/log/httpd/dokuwiki_access.log combined

Save and exit the configuration file.

Please note, AllowOverride AllTo use htaccess File for more directory access control. This way, rename the DokuWiki .htaccess file as shown below;

cp /var/www/html/.htaccess{.dist,}

Set the ownership of the DokuWiki web root directory to apache.

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

Configure SELinux

If SELinux is running, you need to run the following command to configure SELinux to allow various access to DokuWiki.

dnf install policycoreutils-python-utils
semanage fcontext -a -t httpd_sys_rw_content_t "/var/www/html/conf(/.*)?"
restorecon -Rv /var/www/html/conf
restorecon -Rv /var/www/html/data
setsebool -P httpd_can_network_connect on
setsebool -P httpd_can_sendmail on
semanage fcontext -a -t httpd_sys_rw_content_t "/var/www/html/lib/plugins(/.*)?"
restorecon -Rv /var/www/html/lib/plugins
semanage fcontext -a -t httpd_sys_rw_content_t "/var/www/html/lib/tpl(/.*)?"
restorecon -Rv /var/www/html/lib/tpl

If you are denied access, make sure to check the audit log;

tail -f /var/log/audit/audit.log | grep -i denied

Complete DokuWiki installation

To complete the installation of DokuWiki on CentOS 8, you can now access it from your preferred browser using a URL, http://server-hostname-OR-IP.

Set the name of the wiki, enable ACL and other settings, then click “Save” and proceed to the DokuWiki welcome page.

Install DokuWiki on CentOS 8

You can now log in to DokuWiki as the user created when setting up the ACL.

Install DokuWiki on CentOS 8

If you need any configuration after successful authentication, click the Manage Device icon in the upper right corner.

Install DokuWiki on CentOS 8

This is how to install DokuWiki on CentOS 8.

reference

DokuWiki installation

Other tutorials

Set up LDAP self-service password tool on CentOS 8

Configure SSSD for OpenLDAP authentication on Ubuntu 18.04

Install phpLDAPadmin on CentOS 8

Install Google Chrome Browser on CentOS 8

Implementing an OpenLDAP password policy

.

Sidebar