We’ll learn how to install DokuWiki on Ubuntu 20.04 in this guide.
DokuWiki is an essential and easy-to-use open-source wiki that doesn’t require a database. It’s great to find something that doesn’t need any storage space. Let’s emphasise it even further.
We require this wiki software because it is simple to install and use, does not require specialised system requirements such as disc space or RAM, supports a large number of languages, is open-source, and is device-independent.
Apart from DokuWiki, there are additional options like confluence, click, idea, XWiki, bloomfire, yext, guru, and many more.
Installing DokuWiki on Ubuntu 20.04
DokuWiki is easy to install on a Debian-based system because it is available in the Debian repository, although it is not the ideal way to do so. The following are the reasons:
The packages discovered may be out of date.
Some of Dokuwiki’s internal libraries are replaced by boxes, leading to conflicts.
Debian has a different directory structure than Ubuntu, which can cause compatibility issues with some plugins.
Prerequisites
- Apache webserver
- Ubuntu 20.04
- basic understanding of the command line
1.Update system repositories
The best method to begin installing any programme is to execute system updates to bring repositories up to date and avoid issues throughout the installation process.
$ sudo apt update && apt upgrade -y
We can now install apache2 after the updates and upgrades are completed.
2.Install Apache2
We need Apache because we need a safe, efficient, and extensible server that can provide HTTP services that comply with current HTTP standards.
To install Apache, check this article: How to Install Apache, MYSQL, PHP on Ubuntu 20.04.
$ sudo apt install apache2 -y
Enable and start Apache service on start.
# start $ sudo systemctl start apache2 # enable $ sudo systemctl enable apache2 # status $ sudo systemctl status apache2
# status apache2.service - The Apache HTTP Server     Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)     Active: active (running) since Thu 2022-02-24 17:45:58 UTC; 2min 13s ago       Docs: https://httpd.apache.org/docs/2.4/   Main PID: 15564 (apache2)      Tasks: 55 (limit: 1132)     Memory: 5.2M     CGroup: /system.slice/apache2.service             ├─15564 /usr/sbin/apache2 -k start             ├─15566 /usr/sbin/apache2 -k start             └─15567 /usr/sbin/apache2 -k start
The next step is to configure the firewall to accept HTTP and HTTPS traffic. Run the following command to give Apache complete control:
$ sudo ufw allow "Apache Full."
3.Install DokuWiki dependencies.
Some requirements, such as apache-mod-PHP, must be installed before DokuWiki can be installed. Run the following command to install those dependencies.
$ sudo apt install php libapache2-mod-php php-xml
The apache server must then be restarted for the changes to take effect.
$ sudo systemctl restart apache2
4.Download the latest release of DokuWiki.
Dokuwiki will be downloaded and extracted from the archive. Let’s start with the wget command.
# cd into www directory $ cd /var/www # download dokuwiki $ sudo wget https://download.dokuwiki.org/src/dokuwiki/dokuwiki-stable.tgz
After the download is complete, extract it from the archives
$ sudo tar xvf DokuWiki-stable.tgz
The extracted archive must then be moved to the DokuWiki directory.
$ sudo mv dokuwiki-*/ dokuwiki
We’ll also need to update the read and write permissions to execute whenever we want.
$ sudo chown -R www-data:www-data /var/www/dokuwiki
The next thing is to change the document root in Apache to point to /var/www/dokuwiki
$ sudo vim /etc/apache2/sites-enabled/000*.conf
We need to replace DocumentRoot /var/www/html with DocumentRoot /var/www/dokuwiki.
NB: If you want to host a DokuWiki server on localhost for testing purposes, do NOT change the content of /etc/apache2/sites-enabled/000*.conf, create a new file in /etc/apache2/sites-available with the following code. Because mine is for testing purposes, I will go this route.
$ sudo touch apache2-DokuWiki.conf
Input the following content onto the file
<VirtualHost 127.0.0.1>        DocumentRoot /var/www/dokuwiki            ServerName localhost </VirtualHost>
Then we need to enable the new project by placing it into /etc/apache2/sites-enabled
$Â sudo a2ensite apache2-DokuWiki
Reload apache2 again
$ sudo systemctl reload apache2
Lastly is to allow overrides settings on Apache 2 to use .htaccess files for security.
$ sudo vim /etc/apache2/apache2.conf
In the directory /var/www/, replace Allowoveride None with Allowoveride All and restart Apache2.
$ sudo systemctl restart apache2
When all those are over, visit HTTP://<your_IP_Address>/install.PHP to run your configurations.
Conclusion
Thank you for following along with me during this session; I hope you learned something new. If you run into any problems, please contact us or refer to the DokuWiki wiki for more information.
nice man thanks