1080*80 ad

Install DokuWiki on CentOS Stream

How to Install DokuWiki on CentOS Stream: A Comprehensive Guide

DokuWiki is a powerful and versatile open-source wiki software that stands out for its simplicity and efficiency. Unlike many other content management systems, it doesn’t require a database, making it incredibly lightweight and easy to maintain. It’s an ideal choice for creating knowledge bases, team portals, or personal notebooks.

This guide will walk you through the complete process of installing DokuWiki on a CentOS Stream server, from initial system setup to the final web-based configuration.

Step 1: System Preparation and Updates

Before installing any new software, it’s a crucial first step to ensure your system is fully up to date. This applies the latest security patches and updates package repositories.

Open your terminal and run the following command:

sudo dnf update -y

Step 2: Install Apache Web Server

DokuWiki requires a web server to serve its pages. We will use Apache, a robust and widely used web server, known on CentOS as httpd.

Install Apache using the dnf package manager:

sudo dnf install httpd -y

Once the installation is complete, you need to start the Apache service and enable it to launch automatically on system boot:

sudo systemctl start httpd
sudo systemctl enable httpd

You can verify that Apache is running by checking its status:

sudo systemctl status httpd

Step 3: Install PHP and Required Extensions

DokuWiki is built on PHP. It also relies on several specific PHP extensions to function correctly, such as the gd extension for image manipulation and xml for processing data.

Install PHP and all the necessary extensions with a single command:

sudo dnf install php php-gd php-xml php-json -y

After installing PHP, you must restart the Apache service for the changes to take effect:

sudo systemctl restart httpd

Step 4: Download and Deploy DokuWiki

Now it’s time to download the DokuWiki software itself. You can find the latest stable release on the official DokuWiki download page.

  1. First, navigate to the web server’s root directory:

    cd /var/www/html
    
  2. Use the wget utility to download the DokuWiki archive. Be sure to copy the link for the latest “Stable” version from the official site.

    sudo wget https://download.dokuwiki.org/src/dokuwiki/dokuwiki-stable.tgz
    
  3. Once the download is complete, extract the archive:

    sudo tar -xvzf dokuwiki-stable.tgz
    
  4. This will create a directory with a versioned name (e.g., dokuwiki-2023-04-04a). For easier access and a cleaner URL, let’s rename it to something simple like dokuwiki:
    bash
    sudo mv dokuwiki-*/ dokuwiki

Step 5: Configure File Permissions

For DokuWiki to operate correctly, the Apache web server needs permission to write to its directories. This allows you to upload files, modify pages, and install plugins through the web interface.

Change the ownership of the DokuWiki directory to the Apache user, which is apache on CentOS Stream:

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

This is a critical security and functionality step. If permissions are incorrect, you will encounter errors when trying to save pages or make changes.

Step 6: Configure Firewall and SELinux

By default, CentOS Stream’s firewall will block incoming web traffic. We need to create rules to allow access on the standard HTTP (port 80) and HTTPS (port 443) ports.

sudo firewall-cmd --permanent --add-service=http
sudo firewall-cmd --permanent --add-service=https
sudo firewall-cmd --reload

Additionally, SELinux, a security module in CentOS, may prevent Apache from writing to the DokuWiki directory. To allow this, run the following command:

sudo setsebool -P httpd_can_network_connect 1

Step 7: Complete the Installation via Web Browser

With the server-side configuration complete, the final step is to run the DokuWiki web installer.

  1. Open your web browser and navigate to the installer script. Replace your_server_ip with your server’s actual IP address or domain name:
    http://your_server_ip/dokuwiki/install.php

  2. You will be presented with the DokuWiki installer page. Fill in the required information:

    • Wiki Name: The title of your new wiki.
    • Superuser: Create an administrator username.
    • Full Name & Email: Your administrator details.
    • Password: Choose a strong password for the admin account.
    • Initial ACL Policy: Select the access control policy. “Open Wiki” allows anyone to read and edit, while “Public Wiki” allows anyone to read but only registered users to edit. Choose the one that best fits your needs.
  3. After filling out the form, click “Save”.

Important Final Security Step

Once the installation is successful, you must delete the installer file to prevent it from being misused. DokuWiki will display a prominent warning about this.

Remove the install.php file from your server with this command:

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

Congratulations! You have successfully installed and secured DokuWiki on your CentOS Stream server. You can now log in with your superuser account and begin building your knowledge base.

Source: https://kifarunix.com/install-dokuwiki-on-centos-8/

900*80 ad

      1080*80 ad