Kiến Thức Linux Linux Nâng Cao

How to Install Tiki Wiki on Ubuntu 20.04

Tiki Wiki

Tiki Wiki is a Free/Libre/Open Source CMS Groupware that can be used as a wiki-based content management system, portal application, and an online office suite. Originally known as a TikiWiki, written in PHP and distributed under the GNU GPL v3.0 license.

In this tutorial, we will show you how to install Tiki Wiki CMS Groupware on Ubuntu 20.04 with Apache web server, MySQL Server, and PHP 7.4. Also, we will secure the Tiki Wiki CMS Groupware with SSL Letsencrypt.

Prerequisites

  • Ubuntu 20.04 server
  • Root privileges
  • Understanding the basic of Ubuntu Server

What will we do?

  • Install Packages Dependencies
  • Install Apache Web Server
  • Install and Configure MySQL Server
  • Install and Configure PHP 7.4
  • Download Tiki Wiki Source Code
  • Generate SSL Letsencrypt for Tiki Wiki
  • Setup Apache Virtual Host for Tiki Wiki
  • Tiki Wiki Post Installation

Step 1 – Install Packages Dependencies

First, we will install some packages dependencies need for the Tiki Wiki installation.

Install packages dependencies using the apt command below.

sudo apt install curl memcached poppler-utils bsdmainutils catdoc elinks man-db odt2txt pstotext unzip

Once all installation is completed, go to the next step.

Step 2 – Install Apache Web Server

For this guide, the Tiki Wiki will be running under the Apache webserver.

To install the Apache webserver packages, run the apt command below.

sudo apt install apache2

Once the installation is completed, start the Apache service and add it to the system boot.

systemctl start apache2
systemctl enable apache2

The Apache web server is up and running, check using the command below.

systemctl status apache2

Below is the result you will get.

Next, open the HTTP and HTTPS services on the ufw firewall as below.

sudo ufw allow http
sudo ufw allow https
sudo ufw allow ssh

Now start and enable the ufw firewall.

sudo ufw enable

Type ‘y‘ and press ‘Enter‘, and the ufw firewall has been enabled.

To verify the installation of Apache web server and ufw firewall configuration, visit the server IP address using your web browser.

http://10.5.5.25/

And you will get the default index.html of Apache webserver.

Step 3 – Install and Configure MySQL Server

In this step, we will install the MySQL database server, set up the password for default MySQL root user, and create a new database and user for the Tiki Wiki installation.

Install MySQL Server packages using the apt command below.

sudo apt install mysql-server mysql-client

Once all installation is completed, start the MySQL service and add it to the system boot.

systemctl start mysql
systemctl enable mysql

And the MySQL service is up and running.

Next, set up the default MySQL root user using the ‘mysql_secure_installation‘ command below.

mysql_secure_installation

Now type the new password for default MySQL root user and type ‘Y’ for all questions related MySQL configurations.

Press y|Y for Yes, any other key for No: 
Please set the password for root here.

New password: 
Re-enter new password:

Remove anonymous users? (Press y|Y for Yes, any other key for No) : Y
Disallow root login remotely? (Press y|Y for Yes, any other key for No) : Y
Remove test database and access to it? (Press y|Y for Yes, any other key for No) : Y
Reload privilege tables now? (Press y|Y for Yes, any other key for No) : Y

And the MySQL root password has been configured.

Next, log in to the MySQL shell and create a new database and user for the Tiki Wiki installation.

Log in to the MySQL shell using the MySQL command below.

mysql -u root -p

Create a new database named ‘tikidb’ and the user ‘tikiuser’ with the password ‘password’ using the MySQL query below.

CREATE DATABASE tikidb CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE USER 'tikiuser'@'localhost' IDENTIFIED BY 'password';
GRANT ALL ON tikidb.* TO 'tikiuser'@'localhost' WITH GRANT OPTION;
FLUSH PRIVILEGES;

Now type ‘EXIT‘ to log out from the MySQL shell.

And as a result, the installation of MySQL database server has been completed, and the MySQL database for the Tiki Wiki installation has been created.

Step 4 – Install and Configure PHP 7.4

After installing the MySQL database server, we will install and configure PHP7.4 packages on the Ubuntu 20.04 Server.

Install PHP 7.4 packages and Composer using the apt command below.

sudo apt install php php-tidy php-pear php-gd php-xmlrpc php-mbstring libapache2-mod-php php-mysql php-apcu php-curl php-intl php-sqlite3 php-zip php-memcache php-pspell php-zip php-memcached php-pear php-common php-intl php7.4-opcache php-xml php-zip composer

Once all installation is completed, go to the ‘/etc/php/7.4/apache2’ directory and edit the ‘php.ini’ configuration using vim editor.

cd /etc/php/7.4/apache2/
vim php.ini

Change the following configuration as below.

date.timezone = Asia/Singapore
memory_limit = 256M
upload_max_filesize = 100M
max_execution_time = 360

Save and close.

Next, restart the Apache service to apply the new PHP configuration.

systemctl restart apache2

Make sure there is no error, and as a result, the PHP 7.4 installation and configuration for Tiki Wiki has been completed.

Step 5 – Download TikiWiki Source Code

To download the Tiki Wiki source code, go to the ‘/var/www/’ directory and download the Tiki Wiki source suing wget command below.

cd /var/www/
wget -q https://sourceforge.net/projects/tikiwiki/files/latest/download -O tikiwiki.zip

After that, extract the Tiki Wiki source code and rename the extracted directory to the ‘tikiwiki’.

unzip tikiwiki.zip
mv tiki-21.1 tikiwiki

Now change the owner of the ‘/var/www/tikiwiki’ directory to the ‘www-data’ user and group.

chown -R www-data:www-data /var/www/tikiwiki

And the Tiki Wiki source code has been downloaded to the ‘/var/www/tikiwiki’ directory.

Step 6 – Generate SSL Letsencrypt

For this tutorial, we will secure the TikiWiki installation using the SSL Letsencrypt. So make sure that you’ve domain name which resolved to your server IP address.

To use the SSL Letsencrypt, we need to generate SSL certificates with the certbot tool.

Install the certbot tool using the apt command below.

sudo apt install certbot -y

After that, stop the Apache2 service and generate the SSL Letsencrypt for your TikiWiki domain name using the following command.

systemctl stop apache2
certbot certonly --rsa-key-size 2048 --standalone --agree-tos --no-eff-email --email [email protected] -d tiki.hakase-labs.to

Make sure to change the email address with your own. Once all is completed, your SSL certificates will be available at the ‘/etc/letsencrypt/live/yourdomain.com‘ directory.

Step 7 – Setup Apache Virtualhost for TikiWiki

In this step, we will set up the Apache virtual host configuration for the Tiki Wiki CMS Groupware.

Go to the ‘/etc/apache2/sites-available’ directory and create a new virtual host configuration ‘tikiwiki.conf’ using vim editor.

cd /etc/apache2/sites-available/
vim tikiwiki.conf

Change the domain name and the path of SSL certificates with your own, then paste the following configuration.

<VirtualHost *:80>
     ServerAdmin [email protected]
     ServerName tiki.hakase-labs.to
     ServerAlias tiki.hakase-labs.to

     # Redirect all to safe connections
     Redirect permanent / https://tiki.hakase-labs.to/
</VirtualHost>

<VirtualHost *:443>
    ServerAdmin [email protected]
    ServerName tiki.hakase-labs.to
    ServerAlias tiki.hakase-labs.to
    DocumentRoot /var/www/tikiwiki/

    SSLEngine On
    SSLCertificateFile /etc/letsencrypt/live/tiki.hakase-labs.to/fullchain.pem
    SSLCertificateKeyFile /etc/letsencrypt/live/tiki.hakase-labs.to/privkey.pem

    ErrorLog ${APACHE_LOG_DIR}/tikiwiki_error.log
    CustomLog ${APACHE_LOG_DIR}/tikiwiki_access.log combined

    <Directory /var/www/tikiwiki>
        Require all granted
        AllowOverride All
    </Directory>

    # Deny all for db/
    <Directory /var/www/tikiwiki/db>
        Order Deny,Allow
        Deny from all
        Options None
        AllowOverride None
    </Directory>

    # Deliver only png, pdf, html, js, css from temp/ folder
    <Directory /var/www/tikiwiki/temp>
        Order Deny,Allow
        Deny from all
        Options Indexes FollowSymLinks
        AllowOverride None
        php_flag engine Off

        <Files ~ "\.(png|pdf|html|js|css)$">
            Order Deny,Allow
            Allow from all
        </Files>
    </Directory>

    # Turn off php and deny some special types
    <Directory ~ "/var/www/tikiwiki/(css|doc|files|img|maps|mods|styles|templates|templates_c|whelp)">
        Options Indexes FollowSymLinks
        AllowOverride None
        Require all granted
        php_flag engine Off

        <Files ~ "\.(php|sql|sh|pl|py)">
            Order allow,deny
            Deny from all
        </Files>
    </Directory>
</VirtualHost>

Save and close.

Next, activate the ‘tikiwiki‘ virtual host and the Apache SSL module using the command below.

a2ensite tikiwiki
a2enmod ssl

Test the Apache configuration and make sure there is no error, then restart the Apache service.

apachectl configtest
systemctl restart apache2

As a result, the configuration of the Apache virtual host for Tiki Wiki has been completed.

Step 8 – TikiWiki Post Installation

Open your web browser and type the domain name of your Tiki Wiki installation on the address bar.

https://tiki.hakase-labs.to/

Now you will get the Welcome Page of the Tiki Wiki installer.

Choose your default language and click ‘Continue‘.

The Tiki Wiki is using the LGPL License. Click ‘Continue‘ to agree to its license agreement.

Now the Tiki Wiki installer will be checking your system as the requirement for the installation.

Make sure all test has green ‘Success‘, then click ‘Continue‘.

For the Database configuration, type details MySQL database and user that you’ve created on top.

Now click the ‘Continue‘ again.

For the default Database Engine for Tiki Wiki, choose the default ‘InnoDB‘ and click ‘Continue‘.

And the Tiki Wiki installation will be starting.

Once all installation is completed, you will get the result as below.

Next, click ‘Continue‘ again to configure your Tiki Wiki installation.

Configure your Tiki Wiki installation as you need and click ‘Continue‘.

And you will get the Tiki Wiki Installation Notes as below.

Click ‘Continue‘ again, and you will get the page as below.

Click the blue button ‘Enter Tiki and Lock Installer‘.

Now you will get the admin user configuration as below.

Type your password for the default ‘admin‘ user and click ‘Apply‘.

And you will get the Tiki Wiki configuration Wizard.

You can click the ‘Close‘ button to close the Tiki Wiki configuration wizard.

Now you will get the Tiki Wiki HomePage as below.

And below is the Tiki Wiki Admin Dashboard looks like.

As can be seen, the installation of Tiki Wiki under the LAMP Stack (Linux, Apache, MySQL, and PHP) on Ubuntu 20.04 has been completed successfully.

Đăng ký liền tay Nhận Ngay Bài Mới

Subscribe ngay

Cám ơn bạn đã đăng ký !

Lỗi đăng ký !

Add Comment

Click here to post a comment

Đăng ký liền tay
Nhận Ngay Bài Mới

Subscribe ngay

Cám ơn bạn đã đăng ký !

Lỗi đăng ký !