ILIAS 9 for Ubuntu 22.04

RPC-Server install

What is Lucene RPC?

  • Lucene provides ...
    • a very powerfull searchengine
    • PDF generation for certificates

Set the correct server language

  • export LC_CTYPE=en_EN.UTF-8

or german:

  • export LC_CTYPE=de_DE.UTF-8

Prepare ILIAS Database

Set NIC ID

  • cd /opt/scripts
  • touch setnic
  • chmod +x setnic
  • nano setnic
  • Paste this code in:
#!/bin/bash
 
# Database parameters
DB_HOST="localhost" # Database host
DB_NAME="ildb1" # Name of the database
 
# SQL command with properly quoted values
SQL="UPDATE settings SET value = 1 WHERE module = 'common' AND keyword = 'inst_id';"
 
# Check database connection
if ! mysql -h "$DB_HOST" -u root -e ";" ; then
echo "Error: Could not establish a connection to the database."
exit 1
fi
 
# Execute the SQL command
if ! mysql -h "$DB_HOST" -u root "$DB_NAME" -e "$SQL" ; then
echo "Error executing the SQL command."
exit 1
fi
 
echo "Database successfully updated."
  • Update the script with your db credentials
  • ./setnic
  • Your NIC-ID  value is now 1

Create ilServer.jar

#Since ILIAS 9
apt install maven
chown www-data:www-data /var/www
cd /var/www/html/ilias
cd Services/WebServices/RPC/lib
 
java --version
#openjdk 11.0.24 2024-07-16
 
# java 11
sudo -u www-data mvn clean install -Dmaven.compiler.release=11
 
sudo -u www-data mv target /opt/iliasdata/lucene/
chown -R www-data:www-data /opt/iliasdata/lucene

Install and run the RPC-Server

  • First we create a folder for lucene: mkdir /opt/iliasdata/lucene
# --- ILIAS Lucene: aktuelle Oracle-JDBC-JARs automatisch holen (Maven Central) ---
# Requirements: curl, wget, bash. Läuft als root; Dateien gehören www-data.
#Einfach in die Bash kopieren
 
set -euo pipefail
 
INSTALL_DIR="/opt/iliasdata/lucene"
BASE="https://repo1.maven.org/maven2"
 
# We choose ojdbc11 (JDK 11+) to match ilServer's Build-Jdk=11
OJ_GROUP_PATH="com/oracle/database/jdbc"
OJ_ARTIFACT="ojdbc11"
 
# Oracle NLS i18n companion jar
OR_GROUP_PATH="com/oracle/database/nls"
OR_ARTIFACT="orai18n"
 
# Helper: get latest version from maven-metadata.xml (<release> fallback to last <version>)
latest_ver() {
local group_path="$1" artifact="$2" meta ver
meta="${BASE}/${group_path}/${artifact}/maven-metadata.xml"
ver="$(curl -fsSL "$meta" | sed -n 's:.*<release>\([^<]*\)</release>.*:\1:p' | tail -n1)"
if [ -z "${ver:-}" ]; then
ver="$(curl -fsSL "$meta" | sed -n 's:.*<version>\([^<]*\)</version>.*:\1:p' | tail -n1)"
fi
[ -n "$ver" ] || { echo "Could not determine latest version for ${artifact}" >&2; exit 1; }
echo "$ver"
}
 
OJ_VER="$(latest_ver "$OJ_GROUP_PATH" "$OJ_ARTIFACT")"
OR_VER="$(latest_ver "$OR_GROUP_PATH" "$OR_ARTIFACT")"
 
echo "Using versions: ${OJ_ARTIFACT}=${OJ_VER}, ${OR_ARTIFACT}=${OR_VER}"
 
# Prepare target dir
sudo -u www-data install -d -m 0755 "$INSTALL_DIR"
cd "$INSTALL_DIR"
 
# Download JDBC driver (ojdbc11)
OJ_JAR="${OJ_ARTIFACT}-${OJ_VER}.jar"
OJ_URL="${BASE}/${OJ_GROUP_PATH}/${OJ_ARTIFACT}/${OJ_VER}/${OJ_JAR}"
sudo -u www-data wget -q --show-progress -O "$OJ_JAR" "$OJ_URL"
 
# Download NLS companion (orai18n)
OR_JAR="${OR_ARTIFACT}-${OR_VER}.jar"
OR_URL="${BASE}/${OR_GROUP_PATH}/${OR_ARTIFACT}/${OR_VER}/${OR_JAR}"
sudo -u www-data wget -q --show-progress -O "$OR_JAR" "$OR_URL"
 
# Create stable symlinks expected by legacy guides/configs
sudo -u www-data ln -sfn "$OJ_JAR" ojdbc.jar
sudo -u www-data ln -sfn "$OJ_JAR" ojdbc14.jar # legacy name kept for compatibility
sudo -u www-data ln -sfn "$OR_JAR" orai18n.jar
 
# Optional checksum verify (if you want): compare .sha1 from Maven Central
# curl -fsSL "${OJ_URL}.sha1" | awk '{print $1 " '"$OJ_JAR"'"}' | sha1sum -c -
# curl -fsSL "${OR_URL}.sha1" | awk '{print $1 " '"$OR_JAR"'"}' | sha1sum -c -
 
echo "✅ Downloaded:"
ls -l ojdbc*.jar orai18n*.jar
echo "Symlinks now point to:"
readlink -f ojdbc.jar
readlink -f ojdbc14.jar
readlink -f orai18n.jar
nano /opt/iliasdata/lucene/ilServer.properties 
#Put this in:
[Server]
IpAddress = 127.0.0.1
Port = 11111
IndexPath = /opt/iliasdata/lucene
LogFile = /opt/iliasdata/log/lucene.log
LogLevel = WARN
NumThreads = 4
RamBufferSize = 256
IndexMaxFileSizeMB = 500
maxClauseCount = 10000

[Client1]
ClientId = nurderhsv
NicId = 1
IliasIniPath = /var/www/html/ilias/ilias.ini.php

Deploy a Startscript

nano /etc/systemd/system/ilserver.service
[Unit]
Description=ILIAS Java-Server
After=network.target
 
[Service]
User=www-data
Group=www-data
ExecStart=/usr/bin/java -jar /opt/iliasdata/lucene/target/ilServer.jar /opt/iliasdata/lucene/ilServer.properties start
ExecStop=/usr/bin/java -jar /opt/iliasdata/lucene/target/ilServer.jar /opt/iliasdata/lucene/ilServer.properties stop
TimeoutStopSec=10
 
[Install]
WantedBy=multi-user.target
systemctl daemon-reload
systemctl enable ilserver
systemctl start ilserver
  • In any case of error:
    •  tail -f /opt/iliasdata/log/lucene.log
    • tail -f /opt/iliasdata/log/ilias.log

Connect ILIAS with your Lucene RPC Server

  • Activate the Lucene search in Administration->Search and Find->Settings
    • Check Lucene search
  • Go to Adminstration->General Settings->Crone Jobs and update the Lucene search index:

Best way to start the server

Troubleshooting



No comment has been posted yet.