Skip to content

Bare Metal

Context

This guide describes the configuration routine for an default server setup. You have the possibility to test WissKI in a cloud or follow a dockerized installation.

Our recommended server setup consists of five parts:

  • Ubuntu 24.04 or higher Linux
  • PHP 8.3 with extensions:
  • php-apcu, php-curl, php-gd, php-json, php-mbstring, php-mysqli, php-xml and php-zip
  • Apache 2.x or higher Web Server
  • MariaDB 11.8 or higher Database
  • GraphDBfree 11 or higher Triplestore

Set up your Server

If you are using a Ubuntu higher than 24.04, we provide an installing script, which helps you to set up everything you need to get a Drupal site ready to install.

Since WissKI is a Drupal module, you need a running Drupal instance first. The installation of Drupal consists of some steps, which we describe in an Ubuntu 24.04 environment as an example. If you want to install Drupal in any other system please consider the install guide for Drupal.

Install software dependencies

Drupal is written in PHP, so make sure you have PHP 8.3 or higher with extensions php-apcu, php-curl, php-gd, php-json, php-mbstring and php-mysqli installed. Since Drupal is a web content management system, you need a webserver (Apache 2 is recommended) and a database to store your content and configs (here: MariaDB). In the further course of the installation we need some additional applications to install and orchestrate drupal modules (composer), get files from the web (wget) and unzip compressed files (unzip).

Apache

Install Apache2 server and dependencies by typing:

sudo apt install apache2 \
libapache2-mod-php -y

Please be sure that no other webserver is using port 80 (like ngnix).

MySQL/ MariaDB Database

You need a MySQL Database Management System. If you have MySQL already installed, that's cool, if not, we recommend MariaDB. Install it with:

sudo apt install mariadb-server -y

Make your MariaDB secure

If you have a fresh installation, you might want to secure it. Run the mysql secure installation script and note your credentials. In most cases, you can just answer y[es] to all questions.

sudo mysql_secure_installation

Add group www-data to your user

You may want to alter files created by the Apache server. Join the www-data group, if you are not already a member.

usermod -aG www-data $USER
newgrp www-data

Install PHP

You need at least PHP 8.3. If you haven't already, add the ppa by

sudo add-apt-repository ppa:ondrej/php

You can install php8.3 by typing:

sudo apt install php8.3 \
    php8.3-apcu \
    php8.3-curl \
    php8.3-gd \
    php8.3-mbstring \
    php8.3-mysql \
    php8.3-xml \
    php8.3-zip -y

Tweak your PHP

Give WissKI some resources to increase the performance; add a file to /etc/php/php-version/apache2/conf.d/99-wisski.ini with the content:

file_uploads = On
allow_url_fopen = On
max_execution_time = 3000
max_input_time = 600
max_input_nesting_level = 640
max_input_vars = 10000
memory_limit = 2560M
post_max_size = 2000M
upload_max_filesize = 2000M
max_file_uploads = 2000
date.timezone = Europe/Berlin

Enable Apache rewrite module

To provide clean URLs enable Apache rewrite module and restart Apache server.

sudo a2enmod rewrite && sudo systemctl restart apache2

Only if your working on a local host: redirect domain

Add your website-name to /etc/hosts, i. e. with

127.0.0.1   wisski.com

Add virtual host to Apache sites

Add a file /etc/apache2/sites-available/website-name.conf with the content

<VirtualHost *:80>
    ServerAdmin <server admin mail>
    DocumentRoot "/var/www/html/<website name>/web"
    ServerName www.<website name>
    ServerAlias <website name>
    ErrorLog "/var/log/apache2/wisski-error_log"
    CustomLog "/var/log/apache2/wisski-access_log" common
        <Directory /var/www/html/<website name>/web>
        Options FollowSymlinks
        AllowOverride All
        Require all granted
        RewriteEngine on
        RewriteBase /
        RewriteCond %{REQUEST_FILENAME} !-f
        RewriteCond %{REQUEST_FILENAME} !-d
        RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
    </Directory>
</VirtualHost>

Enable site

Enable your website-name and restart the Apache server by

sudo a2ensite wisski.com && sudo systemctl restart apache2

Create database and database user

Please be sure that your database-name and database-user not already exists. Create your database with your database-name and/ or database-user, i. e. with

sudo mysql -e "CREATE DATABASE wisski_db ;"
sudo mysql -e "CREATE USER 'wisski'@'localhost' IDENTIFIED BY 'CHANGE_ME';"
sudo mysql -e "GRANT ALL PRIVILEGES ON wisski_db.* TO 'wisski'@'localhost';"
sudo mysql -e "FLUSH PRIVILEGES;"

Adjust permissions of web directory

You need write permissions.

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

Install Drupal and all necessary modules and libraries

If you do not have composer, please visit getcomposer.org, download and install it. The Code below renames the bin to composer and save it to /usr/local/bin.

php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php -r "if (hash_file('sha384', 'composer-setup.php') === '756890a4488ce9024fc62c56153228907f1545c228516cbf63f885e036d37e9a59d27d63f46af1d4d07ee0f76181c7d3') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
php composer-setup.php --filename=composer --install-dir=/usr/local/bin
php -r "unlink('composer-setup.php');"

You may need unzip and wget packages as well:

sudo apt install wget unzip

Install Drupal site with composers recommend project option, this installs your site in website-name/web,

cd /var/www/html
composer create-project drupal/recommended-project wisski.com
cd wisski.com

Change the "minimum-stability" value in your composer.json to "dev" and save.

//rest of your composer.json...
"conflict": {
        "drupal/drupal": "*"
},
"minimum-stability": "dev",
 "prefer-stable": true,
    "config": {
        "allow-plugins": {
// rest of your composer.json...

Install basic module setup.

composer require drupal/devel drush/drush drupal/image_effects drupal/imagemagick drupal/imce drupal/inline_entity_form:^3.0@RC drupal/viewfield drupal/wisski

Adjust permissions of web directory again, with

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

SSL certificates with certbot

This is only necessary if you are installing WissKI on remote production server and not on a local machine. You can get free SSL certificates by installing and using certbot. Please be aware that the following lines replace apt installation with snap! Follow the instructions from certbot to receive and install the certificates.

sudo apt remove certbot -y
sudo snap install core
sudo snap refresh core
sudo snap install --classic certbot
sudo ln -s /snap/bin/certbot /usr/bin/certbot
sudo certbot --apache

Run the Drupal installer

Open your web browser and run the Drupal installer at http://website-name.

Most module and help pages related to Drupal are written in English, so it is convenient to leave the system language as default.

Select Standard as the installation profile.

Use your database-name, your database-user and your database-password at the Database configuration. If you performed a default server setup, the host will be localhost, if you are in a Docker environment it will be your mariadb-service-name.

Wait until Drupal is installed.

On the site configuration form, enter your website-title, site-email-address, website-user-name and website-user-password. Click Save and continue. Congratulations, you installed your Drupal site!

Activate WissKI modules

WissKI consists of several submodules, to be able to use the core functionalities, go to Manage Extend, check

  • WissKI Core
  • WissKI Pathbuilder
  • WissKI SPARQL1.1 Adapter with Pathbuilder
  • WissKI Store Abstraction Layer Zero

and click Install.  

WissKI basis configuration

Navigate to Manage Configuration WissKI Configuration (WissKI section) and check Do you want to use only main bundles for display? and Do you want to use views for navigation? at the Miscellaneous settings and click Save.

SALZ Adapter Configuration

You are now ready to establish the connection to the triplestore.