ILIAS-7-Install-Tutorial for Ubuntu 20.04

Way I: Portforwarding to 443

Creating server.cfg

  • cd /opt/iliasdata/clientname/chatroom
  • nano server.cfg
  • Paste this code in:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
{
"protocol": "http",
"port": "8080",
"address": "127.0.0.1",
"cert": "",
"key": "",
"dhparam": "",
"log": "\/opt\/iliasdata\/log\/chat.log",
"error_log": "\/opt\/iliasdata\/log\/chaterror.log",
"sub_directory": "",
"deletion_mode": "1",
"deletion_unit": "days",
"deletion_value": "10",
"deletion_time": "22:30"
}
  • Change the following lines so that they fit to your installation:
    • 8-9: Check if this path really exists!
    • 10: Leave empty

Create Startscripts

  • Btw: Every ILIAS-instance needs a separate startscript that starts the chatserver with its own unique internal port (eg. 8080). It follows, that every instance needs its own server.cfg.
  • Remember: info is the clientname of my ILIAS instance (the clientname was set in the json file) and can be found here:
    • nano /var/www/html/ilias/data/info/client.ini.php
    • Its normally the same as stated in the client.cfg. However it must be the same like in client.cfg
  • nano /etc/init.d/ilchat
  • Fill in the following code:
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
#!/bin/bash
### BEGIN INIT INFO
# Provides: ilchat3
# Author: Wolfgang Hubesch wolfgang.huebsch@gmx.de
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: ILIAS-Chatserver nodebased
### END INIT INFO
 
# Do NOT "set -e"
 
PATH=/sbin:/usr/sbin:/bin:/usr/bin
DESC="ilchat"
NAME=ilchat
#DAEMON=/usr/sbin/$NAME
#DAEMON_ARGS="--options args"
 
SCRIPTNAME=/etc/init.d/$NAME
ilroot=/var/www/html/ilias
ildata=/opt/iliasdata
client=info
url=127.0.0.1
chatport=8080
code="404"
USER=www-data
node_path=/usr/bin/node
 
#################################################
status=$(curl -s --head ${url}:${chatport} | head -n 1)
 
case "$1" in
start)
 
if [[ $status == *${code}* ]];
then
 
echo "Chat-Server for client ${client} on port ${chatport} seems to be running"
else
echo "Chat-Server for client ${client} on port ${chatport} seems to be DOWN. Try to start..."
sudo -H -u $USER bash -c "${node_path} ${ilroot}/Modules/Chatroom/chat/chat.js ${ildata}/${client}/chatroom/server.cfg ${ildata}/${client}/chatroom/client.cfg" &
 
sleep 5
status=$(curl -s --head ${url}:${chatport} | head -n 1)
if [[ $status == *${code}* ]];
then
echo "Chatserver for client ${client} on port ${chatport} is up!"
exit
 
else
echo "Sorry, I was not able to start the Chatserver for client ${client} on port ${chatport}. Try user root instead of ${USER} (edit line 28 of this script)"
exit
fi
 
 
 
 
fi
 
;;
 
stop)
 
if [[ $status == *${code}* ]];
then
echo "Chatserver for client ${client} on port ${chatport} is running...try to stop..."
kill $(ps aux | grep chat.js | awk '{print $2}') > /dev/null 2>&1
exit
 
else
echo "Chatserver for client ${client} on port ${chatport} is already down..."
exit
fi
 
;;
 
status)
 
if [[ $status == *${code}* ]];
then
echo "Chatserver is running...exit now..."
exit
 
else
echo "Chatserver is down...exit now..."
exit
 
fi
 
;;
 
*)
echo "Usage: $0 {start|stop|status}"
exit 1
esac
 
exit 0
  • Change line 23 so that the client name fits to your installation and client (here info)
  • Exit nano with STRG+x
  • chmod +x /etc/init.d/ilchat

  • Create client.cfgYou can create this file via the ILIAS frontend in Administration->Repository/Objects-> Chat with ticking the "save" button in the registercard "Settings"
  • The file is to be found inย /opt/iliasdata/clientname/chatroom

Start the server

  • chmod 555 /opt/iliasdata/clientname/chatroom/*
  • Check if Node is installed
  • Thats enough to start the chatserver. You can do this manually:ย /etc/init.d/ilchat start|stop|status
  • Check if there are any messages in the errorlog that would indicate a false configuration: nano /opt/iliasdata/log/chaterror.logย 

Crontab setting

  • Crontab shall check if the chatserver runs every 5 minutes:
    • nano /etc/crontab
    • Ad a line like thisย 
1
2
#Line for Chat-Server:  checks every 5 minutes if sevice is up
*/5 * * * * root /etc/init.d/ilchat start >/dev/null 2>&1

Connect the Server to the ILIAS-Database

  • As I said before, the chatserver may run but the chat will still not work. So please copy the slightly modifiedย content of server.cfg to the right table of the database as described here (JSON or PHPMyAdmin method)
  • Slightly modified content:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
{
"protocol": "https",
"port": "443",
"address": "chat.bbs-ilias.de",
"cert": "",
"key": "",
"dhparam": "",
"log": "\/opt\/iliasdata\/log\/chat.log",
"error_log": "\/opt\/iliasdata\/log\/chaterror.log",
"sub_directory": "",
"deletion_mode": "1",
"deletion_unit": "days",
"deletion_value": "10",
"deletion_time": "22:30"
}
  • As you can see, the lines 2-4 are different to the content of server.cfg. This is OK because of the port rewrite that comes now
  • Edit line 4 accordingly to your chat-subdomain
  • Check, if paths in lines 8 und 9 really exists

Configure Subdomains

  • You need for every ILIAS instance a subdomain
  • Every client needs a Name (can be but must not the client name)
  • Every client needs a port.ย 
  • An example at a glance:

Subdomain

Name

Internal Port

External Port

chat.bbs-ilias.de

info

8080

443

chat2.bbs-ilias.de

coronademo

8081

443

Create the vhosts

  • Every client needs its own subdomain
  • cd /etc/apache2/sites-available
  • nano chat.bbs-ilias.conf
  • Fill in the following code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
<VirtualHost chat.bbs-ilias.de:80>
LoadModule proxy_module /usr/lib/apache2/modules/mod_proxy.so
LoadModule proxy_http_module /usr/lib/apache2/modules/mod_proxy_http.so
LoadModule headers_module /usr/lib/apache2/modules/mod_headers.so
LoadModule deflate_module /usr/lib/apache2/modules/mod_deflate.so

ProxyVia On
ProxyRequests Off
ProxyPass / http://127.0.0.1:8080/
ProxyPassReverse / http://127.0.0.1:8080/
ProxyPreserveHost on

<Proxy *>
Options FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Proxy>

</VirtualHost>
  • Adjust line 1, 9 and 10 (the port in line 9 and 10)
  • Activate subdomain: a2ensite chat.bbs-ilias.conf
  • systemctl reload apache2
  • Get the SSL certificate and SSL-vhost-file for the subdomain: certbot


No comment has been posted yet.