ILIAS 8 Install Tutorial for Ubuntu 22.04

Chatserver Install using port 443

Prepare Apache

  • a2enmod proxy_http proxy_http2 proxy proxy_balancer lbmethod_byrequests proxy_wstunnel
  • systemctl restart apache2

Subdomain creation

  • Create a subdomain chat.bbs-ilias.de and link it with the ip of bbs-ilias.de (your server)
  • cd /etc/apache2/sites-available
  • nano chat.bbs-ilias.conf
  • Paste this 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
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
<VirtualHost chat.bbs-ilias.de:80>
ServerName chat.bbs-ilias.de
 
# Module laden
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
 
# Proxy-Einstellungen
ProxyVia On
ProxyRequests Off
ProxyPreserveHost On # Beibehalten des Host-Headers
 
# Weiterleitung zum internen Server
ProxyPass / http://127.0.0.1:8080/ connectiontimeout=5 timeout=30
ProxyPassReverse / http://127.0.0.1:8080/
 
# WebSocket-Unterstรผtzung
RewriteEngine On
RewriteCond %{HTTP:Upgrade} websocket [NC]
RewriteRule /(.*) ws://127.0.0.1:8080/$1 [P]
 
RewriteCond %{QUERY_STRING} transport=polling [NC]
RewriteRule /(.*) http://127.0.0.1:8080/$1 [P]
 
# Sicherheits-Einstellungen fรผr Proxy
<Proxy *>
Require all granted
</Proxy>
 
# GZIP-Kompression
<Location />
SetOutputFilter DEFLATE
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
Header append Vary User-Agent
</Location>
 
# KeepAlive Einstellungen
KeepAlive On
MaxKeepAliveRequests 100
KeepAliveTimeout 5
 
# Sicherheitsheader
Header always append X-Frame-Options SAMEORIGIN
Header set X-XSS-Protection "1; mode=block"
Header set X-Content-Type-Options nosniff
 
# Protokollierung
ErrorLog ${APACHE_LOG_DIR}/chat.kivinet.de_error.log
CustomLog ${APACHE_LOG_DIR}/chat.kivinet.de_access.log combined
</VirtualHost>
  • Edit line 1
  • a2ensite chat.bbs-ilias.conf
  • systemctl restart apache2
  • Optain a SSL certificate for this domain: certbot
    • Please dot NOT choose option 2 - redirect

Adding an ILIAS-Client - Creation of client.cfg and server.cfg

  • Client means here the name of the ILIAS instance
  • Create a chatobjekt in ILIAS-Repository: Repository->Repository Home->Add new Item->Chatroom->Chat1
  • ILIAS->Administration->System Settings and Maintenance ->Repository and Trash->Chat1
    • Settings
      • Enable Chat: Check
      • Choose all options you want
      • Name: info (what ever you want)
      • Press "Generate Keys"
      • Klick Save
  • ls /opt/iliasdata/info/chatroom
  • There should be to files now:
    • server.cfg
    • client.cfg

Configuration of server.cfg

  • As described here update the JSON file and run the update script:
    • nano /opt/scripts/clients/clientname1.json
  • Important: Leave values for cert, key and dhparam empty
  • Example content:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
"chatroom" : {
"address" : "chat.bbs-ilias.de",
"port" : 443,
"https" : {
"cert" : "\/etc\/letsencrypt\/live\/chat.bbs-ilias.de\/fullchain.pem",
"key" : "\/etc\/letsencrypt\/live\/chat.bbs-ilias.de\/privkey.pem",
"dhparam" : "\/etc\/letsencrypt\/live\/chat.bbs-ilias.de\/dhparam.pem"
},
"log" : "/opt/ilasdata/log/chat.log",
"log_level" : "warning",
"error_log" : "/opt/iliasdata/log/chaterror.log",
 
"deletion_interval" : {
"deletion_unit" : "months",
"deletion_value" : "6",
"deletion_time" : "23:45"
}
},
  • It is not neccessary that the files in the lines 5-7 are realy there. Its just a dummy information. The HTTPS comes via Apache and Certbot. We redirect 127.0.0.1 to the Subdomain chat.bbs-ilias.de
  • Update the ILIAS database:
    • cd /var/www/html/ilias
    • sudo -u www-data php setup/setup.php install /opt/scripts/clients/clientname1.json
    • If this appear, ignore it:
      • This means the script was not able to overwrite an existing /opt/iliasdata/clientname/chatroom/server.cfg file which is good for us.
  • As result there should be a new or altered file called server.cfg
  • Its also possible that server.cfg is wirte protected allready. In this case. you read the red message aboth.ย 
    • ls /opt/iliasdata/info/chatroom
    • If the file is missing (due to write permission problems eg.), no problem: You can create it with the content below
  • Check, if all entrys are OK:
    • nano /opt/iliasdata/info/chatroom/server.cfg
    • Example:
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": "\/opt\/iliasdata\/clientname\/chatroom\/ilchatdummy",
"key": "\/opt\/iliasdata\/clientname\/chatroom\/ilchatdummy",
"dhparam": "\/opt\/iliasdata\/clientname\/chatroom\/ilchatdummy",
"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"
}
  • Must not exist: \/opt\/iliasdata\/clientname\/chatroom\/ilchatdummy
  • Please understand that we have to change the file (again), because we run the server not with chat.bbs-ilias.de but instead with the internal IP 127.0.0.1 for redirection porposes

Changing values of server.cfg (maybe again, this is the trick)

  • Change lines 2-3 like shown below
    • You can leave lines 5-7 as they are - its not important because we use http and not https by now
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": "\/opt\/iliasdata\/clientname\/chatroom\/ilchatdummy",
"key": "\/opt\/iliasdata\/clientname\/chatroom\/ilchatdummy",
"dhparam": "\/opt\/iliasdata\/clientname\/chatroom\/ilchatdummy",
"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"
}

Protect server.cfg

  • Problem: server.cfg will be overwritten if you execute the json file again with chat.bbs-ilias.de
  • Solution: The trick is to edit the chatserver section with false attributes, so that nothing will happen:
  • nano /opt/scripts/clients/yourfile.json
  • Change
    • "chatroom" : {
  • to
    • "chatroomX" : {
  • because we do not want any changes due execution the json file
  • Also a good protection idea: chmod 444 /opt/iliasdata/clientname/chatroom/server.cfg

Create logfiles

  • sudo -u www-data mkdir /opt/iliasdata/log
  • sudo -u touch /opt/iliasdata/log/chat.log
  • sudo -u touch /opt/iliasdata/log/chaterror.log

Create the Startscripts for the client

cd /etc/systemd/system
touch ilchat.info.service
chmod +x ilchat.info.service
nano ilchat.info.service
#Paste this in:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
[Unit]
Description=ILIAS onscreenchat
After=syslog.target network.target
 
[Service]
EnvironmentFile=-/etc/environment
Type=simple
User=www-data
Group=www-data
WorkingDirectory=/var/www/html/ilias/Modules/Chatroom/chat/
ExecStart=/bin/sh -c "/usr/bin/node /var/www/html/ilias/Modules/Chatroom/chat/chat.js \
/opt/iliasdata/clientname/chatroom/server.cfg \
/opt/iliasdata/clientname/chatroom//client.cfg"
Restart=always
RestartSec=3
 
[Install]
WantedBy=multi-user.target
#Enable Service:
systemctl enable ilchat.iliasschoolmaster.service
systemctl daemon-reload
 
#How to use the startscript:
systemctl start ilchat.iliasschoolmaster
systemctl stop ilchat.iliasschoolmaster
systemctl restart ilchat.iliasschoolmaster
systemctl status ilchat.iliasschoolmaster
 
#How to remove the service
systemctl status disable ilchat.iliasschoolmaster
rm ilchat.iliasschoolmaster.service
 
#Check if service runs:
ps aux |grep chat.js
 
#Kill all chat processes:
pkill -f chat

Check the instance

  • curl -s --head https://chat.bbs-ilias.de:443
    • should give:
1
2
3
4
5
6
7
8
9
HTTP/1.1 404 Not Found
X-Powered-By: Express
Content-Security-Policy: default-src 'none'
X-Content-Type-Options: nosniff
Content-Type: text/html; charset=utf-8
Content-Length: 140
Date: Fri, 17 Nov 2023 19:39:05 GMT
Connection: keep-alive
Keep-Alive: timeout=5
  • ps aux |grep chat.js
    • should give:
1
2
root       88327  0.1  2.9 840324 60080 ?        Sl   19:35   0:00 /usr/bin/node /var/www/html/ilias/Modules/Chatroom/chat/chat.js /opt/ilchatserver/server.cfg /opt/ilchatserver/info.cfg
root 88512 0.0 0.1 9608 2088 pts/3 S+ 19:40 0:00 grep --color=auto chat.js
  • Check errorlog:
    • cat /opt/iliasdata/log/chaterror.log
    • cat /opt/iliasdata/log/chat.log


No comment has been posted yet.