28.6 C
Texas

How To Install DokuWiki On Ubuntu 20.04

In this tutorial, you’ll learn that how to install DokuWiki on Ubuntu 20.04. DokuWiki is an open source & most popular application written in PHP. You can create your favourite websites with the help of dockuwiki by just uploading your content to the server. Dokuwiki uses a simple file to store it’s data instead of using a database. It comes with all the features required for a website along with SEO, authentication & much more. Simply follow the below steps for an easy & optimal installation of dokuwiki on Ubuntu 20.04.

Step 1: Update Your System

First of all update your system to have the latest packages installed.

sudo apt update -y
sudo apt upgrade -y

Once updated, reboot your system.

- Advertisement -
sudo reboot

Step 2: Install Apache & PHP on Ubuntu 20.04

Type the following commands in your terminal to install the apache & PHP along with it’s extensions.

sudo apt install apache2 php php-gd php-xml php-json -y

After installing the above packages, hit the below commands to start the apache.

suod systemctl start apache2
sudo systemctl enable apache2

Step 3: Download DokuWiki on Ubuntu 20.04

Get the latest version of DokuWiki with the help of wget command. Run the following command in your terminal.

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

Once completed, create a new folder under /var/www/html/dokuwiki & then extract the dokuwiki.

sudo mkdir /var/www/html/dokuwiki
sudo tar -xvzf dokuwiki-stable.tgz -C /var/www/html/dokuwiki/ --strip-components=1

And then copy the sample .htaccess file by running

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

And finally give proper permissions to dokuwiki.

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

Step 4: Configure Apache for DokuWiki

Now create a new Apache virtualhost config by typing

sudo nano /etc/apache2/sites-available/dokuwiki.conf

And then add the below content into the file.

<VirtualHost *:80>
         ServerName    dokuwiki.osradar.com
         DocumentRoot  /var/www/html/dokuwiki

<Directory ~ "/var/www/html/dokuwiki/(bin/|conf/|data/|inc/)">
<IfModule mod_authz_core.c>
AllowOverride All
                 Require all denied
</IfModule>
<IfModule !mod_authz_core.c>
Order allow,deny
                 Deny from all
</IfModule>
</Directory>

ErrorLog   /var/log/apache2/dokuwiki_error.log
         CustomLog  /var/log/apache2/dokuwiki_access.log combined
</Virtualhost>

Finally save & exit the file.

Next, enable dokuwiki site & restart apache.

suod a2ensite dokuwiki.conf
sudo systemctl reload apache2

Step 5: Secure DokuWiki wit Let’s Encrypt SSL

It is good practice to keep in mind the security practice. Install the certbot with the help of below command.

sudo apt install certbot python3-certbot-apache -y

And type the given command to fetch SSL certificates for your domain.

certbot --apache -d dokuwiki.osradar.com

Provide the asked details & you’re all set.

Step 6: Access DokuWiki On Ubntu 20.04

Now, you can access the DokuWiki on Ubuntu 20.04 by typing https://yourdomain.com/install.php. Here I’ll perform it on localhost.You’ll see the installation page.

Fill the required fields & finally press “Save” button. You’ll be redirected to the similar page.

Press on “You new dokuwiki”. You’ll see the similar page.

Now, click “Login” button. You’ll be redirected to the login page. Provide the main username & password given in 1st step to login.

And then you’ll be redirected to the dokuwiki dashboard.

So, this is how you can install DokuWiki on Ubuntu 20.04

- Advertisement -
Everything Linux, A.I, IT News, DataOps, Open Source and more delivered right to you.
Subscribe
"The best Linux newsletter on the web"

1 COMMENT

  1. Hi, very good tutorial!! It was a great help for me to install apache, php and dokuwiki. But im step 5 I have a problem with th command “sudo certbot –apache -d dokuwiki.osradar.com”. I provide my email adresse, agreed to register and to share my email but after that some challenges have failed for the domain dokuwiki.osradar.com. It seems to be some DNS problems “NXDOMAIN looking up A for doku.osradar.com – check that a DNS record exists for this domain.”
    I don’t have acces to the homepage dokuwiki.osradar.com/install.php
    Could you help me? Where did I do a mistake?

LEAVE A REPLY

Please enter your comment!
Please enter your name here



Latest article