ILIAS 8 Install Tutorial 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:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/bin/bash

# Datenbank-Parameter
DB_HOST="localhost" # Host der Datenbank
DB_USER="username" # Benutzername für die Datenbank
DB_PASS="password" # Passwort für den Benutzer
DB_NAME="ildb1" # Name der Datenbank

# SQL-Befehl, mit korrekt zitierten Werten
SQL="UPDATE settings SET value = 1 WHERE module = 'common' AND keyword = 'inst_id';"

# Verbindung zur Datenbank überprüfen
if ! mysql -h "$DB_HOST" -u "$DB_USER" -p"$DB_PASS" -e ";" ; then
echo "Fehler: Konnte keine Verbindung zur Datenbank herstellen."
exit 1
fi

# Ausführen des SQL-Befehls
if ! mysql -h "$DB_HOST" -u "$DB_USER" -p"$DB_PASS" "$DB_NAME" -e "$SQL" ; then
echo "Fehler beim Ausführen des SQL-Befehls."
exit 1
fi

echo "Datenbank erfolgreich aktualisiert."
  • Update the script with your db credentials
  • ./setnic
  • Your NIC-ID  value is now 1

Install and run the RPC-Server

  • First we create a folder for lucene: mkdir /opt/iliasdata/lucene
  • Now we create the config file. We do not use a path within the ilias webdir because this can cause problems with git and the are more flexible if we move the installation to another server. We choose our lucene-dir (sic!):
  • touch /opt/iliasdata/lucene/ilServer.properties
  • Make path writable:
    • chmod -R 770 /opt/iliasdata/lucene
    • chown -R www-data:www-data /opt/iliasdata/lucene
    • nano /opt/iliasdata/lucene/ilServer.properties
  • Put these lines in and change all data accordingly to your system. You find your own NIC in Administration->General Settings->Server. IP adress and port should not be changed.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
[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 = 10606
IliasIniPath = /var/www/html/ilias/ilias.ini.php

Next, we want to start the Lucene-Server and this will be done by a start-stop-script:

  • touch /etc/init.d/ilserver
  • chmod +x /etc/init.d/ilserver
  • nano /etc/init.d/ilserver
  • Add the following lines. Change line 29 and 30 if necessary:

New version 9 from 19th December 2020

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
#!/bin/bash
### BEGIN INIT INFO
# Provides: ilserverstart9
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Lucene-ILIAS-Server (Java)
# Description: This file should be used to construct scripts to be
# placed in /etc/init.d.
### END INIT INFO

# Author: Wolfgang Hubesch wolfgang.huebsch@gmx.de
#
# Please remove the "Author" lines above and replace them
# with your own name if you copy and modify this script.

# Do NOT "set -e"

# PATH should only include /usr/* if it runs after the mountnfs.sh script
PATH=/sbin:/usr/sbin:/bin:/usr/bin
DESC="iliasserver"
NAME=ilserverneu
DAEMON=/usr/sbin/$NAME
DAEMON_ARGS="--options args"

SCRIPTNAME=/etc/init.d/$NAME
JAVABIN="/usr/bin/java"
ILIASDIR="/var/www/html/ilias" #only the path to ilServer.jar
CONFIGDIR="/opt/iliasdata/lucene" #Path to ilServer.properties

USER=root
inifile="ilServer.properties" #Name of INI-FIle
enc="-Dfile.encoding=UTF-8"
#######################################################################################################################
code="de.ilias.ilServer"
status=$(ps aux | grep lucene)
#$status > /dev/null 2>&1
string="$status"


case "$1" in
start)

if [[ $string == *${code}* ]];
then
echo "Ilserver is already running...exit now..."
exit

else
echo "Ilserver is down...try to start..."
{
sudo -H -u $USER $JAVABIN $enc -cp "$ILIASDIR/Services/WebServices/RPC/lib/ilServer.jar" de.ilias.ilServer $CONFIGDIR/ilServer.properties start &
} &> /dev/null
sleep 5
string=$(ps aux | grep lucene)
if [[ $string == *${code}* ]];
then
echo "RPC-Service runs as user $USER"
else
echo "RPC start fails with user $USER. Try root instead of $USER"
exit
fi

fi

;;

stop)

if [[ $string == *${code}* ]];
then
echo "Ilserver is running...try to kill..."
kill $(ps aux | grep lucene | awk '{print $2}') > /dev/null 2>&1
else
echo "Ilserver is down at this moment..."
exit
fi


;;

status)
if [[ $string == *${code}* ]];
then
echo "Ilserver is running..."
else
echo "Ilserver is down..."
exit
fi


;;

restart)
$0 stop
sleep 2
$0 start
;;

*)
echo "Usage: $0 {start|stop|status|restart}"
exit 1
esac

exit
  • Start it: /etc/init.d/ilserver start
  • Make it run at boot:
    • cd /etc/init.d
    • update-rc.d -f ilserver remove
    • update-rc.d ilserver defaults 93
  • In any case of error:
    •  nano /opt/iliasdata/log/lucene.log
    • nano /opt/iliasdata/log/ilias.log
  • 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

  • Setup the cronjob 

Troubleshooting



No comment has been posted yet.