Saturday, November 16, 2024
Google search engine
HomeGuest BlogsInstall and Configure DokuWiki on CentOS 7 | CentOS 8

Install and Configure DokuWiki on CentOS 7 | CentOS 8

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 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 dnf module reset php -y
sudo dnf module install php:8.0 -y
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-php80
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 8.0.20 (cli) (built: Jun  8 2022 00:33:06) ( NTS gcc x86_64 )
Copyright (c) The PHP Group
Zend Engine v4.0.20, Copyright (c) Zend Technologies
    with Zend OPcache v8.0.20, Copyright (c), by Zend Technologies

Step 4: Download Dokuwiki

Now download and install DokuWiki

wget https://download.dokuwiki.org/src/dokuwiki/dokuwiki-stable.tgz
sudo tar zxvf dokuwiki-stable.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.

dokuwiki configure

That’s all. You can then add skins and plugins available on the admin dashboard.

Recommended Linux Books  to read:

Similar guides:

RELATED ARTICLES

Most Popular

Recent Comments