Install and Configure DokuWiki on Alibaba Cloud ECS

By Arslan Ud Din Shafiq, Alibaba Cloud Tech Share Author. Tech Share is Alibaba Cloud’s incentive program to encourage the sharing of technical knowledge and best practices within the cloud community.

DokuWiki is an open source wiki software that lets you build a collaborative app easily. DokuWiki is popular due to its readable syntax, and is also liked by website administrators because it is easy to maintain, manage, backup and integrate.

In this tutorial, we will be installing and setting up DokuWiki using Alibaba Cloud Elastic Compute Service (ECS) with Ubuntu 16.04 installed.

In this tutorial, I will be using Alibaba Cloud Elastic Compute Service (ECS) with Ubuntu 16.04 installed on it.

Prerequisites

  1. You must have Alibaba Cloud Elastic Compute Service (ECS) activated and verified your valid payment method. If you are a new user, you can get a free account in your Alibaba Cloud account. If you don’t know about how to setup your ECS instance, you can refer to this tutorial or quick-start guide. Your ECS instance must have at least 1GB RAM and 1 Core processor.
  2. A domain name registered from Alibaba Cloud. If you have already registered a domain from Alibaba Cloud or any other host, you can update its domain nameserver records.
  3. Domain name must be pointed to your Alibaba Cloud ECS’s IP address
  4. Access to VNC console in your Alibaba Cloud or SSH client installed in your PC
  5. Set up your server’s hostname and create user with root privileges.

Update Your Ubuntu System

Before proceeding with installation of any kind of package, use the following command to update your Ubuntu system. To execute this command, remember to login from non-root user with sudo privileges. After execution of this command, you will be prompted to Is this ok? Type ‘Y’ and hit Enter.

Step 1:

Install PHP

DokuWiki requires atleast installation of PHP 5.6 or newer version of PHP. In this tutorial, you will install PHP 7.2. To install PHP 7.2, execute the following steps.

Install python software properties and software properties common. To do so, execute the command below.

You will need to add repository for newer versions of PHP. To do so, execute the commands below.

Update the package to refresh the available repositories. To do so, execute the command for updating Ubuntu system.

Install PHP 7.2. To install PHP 7.2, execute the following command.

Install Required PHP Extensions

DokuWiki requires the following PHP extensions:

  1. php7.2-cli
  2. php7.2-fpm
  3. php7.2-gd
  4. php7.2-zip
  5. php7.2-xml

To install the above extensions of PHP, execute the following command.

To check PHP installation, you can execute the following command to check installed PHP version.

Install Nginx Server

Before starting installation of Nginx server, you will need to stop apache service. To do so, execute the command below.

Execute the command below to install Nginx server.

Now start Nginx server by executing command below.

To check installation of Nginx server, you can execute the following command.

Create Nginx configuration file for DokuWiki. Execute the following command, a file will be opened in nano text editor.

Copy and paste the following code and save the file.

Now create symlink of newly created file’s configuration to enabled-sites directory. To do so, execute the command below.

Now execute the following command to test the syntax of Nginx configuration file.

Execute the following command to reload the updated configurations.

Install and Configure DokuWiki

To install and configure DokuWiki, follow the steps below.

Navigate to root document directory.

Now download the files of DokuWiki from the DokuWiki official website by executing commands below.

Extract the files from downloaded directory by executing command below.

Now rename the extracted directory to dokuwiki using the command below.

Navigate to /var/www/DokuWiki

Now change the ownership of newly created directory to your username.

Install SSL Certificate

You will use Let’s Encrypt Certbot to install free SSL certificate. Certbot team maintains a PPA for Let’s Encrypt.

Update the package by executing command below.

Now you will need to install software-properties-common by executing command below.

Now add the certbot PPA to repository using the command below.

Now update the package again by executing command below.

Install python-certbot-nginx by executing command below.

To get Let’s Encrypt SSL issued for your domain, execute the command below. Remember to change softpedia.xyz with your own domain name.

Restart php7.2-fpm service by executing the command below.

Reload nginx server to load all settings.

Now you can access DokuWiki via ECS IP address or your domain name. In my case, I have setup domain. After accessing DokuWiki, you will be redirected to the following page.

You will have to make few changes to make DokuWiki work correctly. To do so, follow the steps below.

Navigate to link https://your_domain_name/install.php or http://your_ip_address/install.php

Remember, in case, you don’t have any domain registered, you may buy it from Alibaba Cloud. Otherwise, you will have to skip SSL installation section to avoid errors. In case of using IP address of ECS, you will have to update nginx configuration in doku.conf file.

Select you desired language. DokuWiki supports more than 50 languages.

Fill the following form and save it.

You will see the following screen which shows the configuration was finished successfully.

To continue to your new DokuWiki, you are recommended to delete install.php file from your Alibaba Cloud ECS instance.

Remove install.php File

It is important to remove install.php file to avoid security related problems in future. To do so, follow the steps below.

Connect to your ECS shell via Putty or console and login.

Navigate to /var/www/dokuwiki using the command below.

Execute the following command to see either you are in right folder or not.

Now execute the following command to remove install.php file.

To confirm that either the file has been deleted successfully or not, execute the command below.

You can see in the following screen, there is no file named install.php which means the file has been deleted successfully.

Now you can navigate to https://your_domain_name/doku.php?id=wiki:welcome , you will see the following screen.

That’s it! Your DokuWiki is ready to use.

Reference:https://www.alibabacloud.com/blog/install-and-configure-dokuwiki-on-alibaba-cloud-ecs_594211?spm=a2c41.12345376.0.0

Follow me to keep abreast with the latest technology news, industry insights, and developer trends.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store