ILIAS-Tricks not only for Schools

Tutorial: Installing ILIAS 5.3 @ Ubuntu LTS 16.04

[wolfganghuebsch], [iliasadmin1] - 2. Apr 2018, 12:10

About this Tutorial

Changelog

  • 2020, January, 26th: Add utf8-settings to my.cnf
  • 2019, April, 26th: Added minimal better description for script ilserver
  • 2018, November, 3th: Add davfs2
  • 2018, September, 30th: Added packet to install: mailutils
  • 2018, August, 23th: New node install instructions. Added phantomjs (PDF creation)
  • 2018, August, 13th: Increased the number of threads for Lucene search from 1 to 3
  • 2017, December, 23th: Add a hint to fix connection problems for the chat
  • 2017, June, 22th: All startscripts are enhanced. Node install description enhanced.
  • 2017, June, 19th: Includes now Mathjax and the chatserver startscript has been enhanced.
  • 2017, June, 14th: Includes now a new WebDav text
  • 2017, June, 13th: Crontab section includes now the Lucene-Server and there is now a hint for Soap activation
  • 2017, June, 10th: New ilserver startscript to avoid stash problems with git.

This post is about the installation of ILIAS 5.3 with Ubuntu 16.04 LTS including the following components:

  1. Serverinstallation and login via VirtualBox
  2. Installation of all needed packages via apt
  3. Activation of the needed Apache modules
  4. Configuration of PHP 7
  5. Installation of ILIAS
  6. Configuration of Memcached
  7. Configuration of the new Chatserver including a script for auto (re-) start and Node
  8. Configuration of the Lucene-RPC server including start-stop-script
  9. Activation of the ILIAS cronservice
  10. Activation of the Webaccess-Checker
  11. Mathjax

Feel free to contact me (wolfgang.huebsch@gmx.de) or post someting in the ILIAS-Forum :-)

Install the Server

  • Download Ubuntu @ http://releases.ubuntu.com/16.04.2/ubuntu-16.04.2-server-amd64.iso
  • Create a new virtual machine (Linux/Ubuntu) in VirtualBox
    • RAM: 2048 MiB or more - appr. 100 MiB per user, so 2 GiB RAM can be used for appr. 20 simultaneously logged in users.
    • HDD: 30 GiB or more
    • Network: Set the networkadapter to bridged mode
  • Start the machine, select the Ubuntu-ISO-image as bootdevice
  • Select language
  • Choose "Install Ubuntu Server"
  • Choose some other settings, like keyboard-layout
  • Set hostename, e.g. ilias
  • Add user and password, in this case its all ilias
  • Do not encrypt homedir
  • Choose the entire disk for Ubuntu, choose default values
  • Apt installs some packages, choose "no proxy" if you are not behind a proxy
  • Choose only these packages:
    • Standard system utilities
    • Open SSH-Server
  • Install Grubbootloader: Yes
  • Reboot

Login to the Server

  • After reboot, login with username and password (not with root-account)
  • Become root with sudo -s
  • Load new systemupdates: apt-get update
  • Update the system with apt-get upgrade
  • Find out the current IP with ifconfig
  • Now you can log in to your server via SSH. A nice SSH-Client vor Windows is putty. If you are using Mac OS or Linux, try for example: ssh 192.168.2.45 -l ilias

Install all needed apt-packages

  • First become root with sudo -s
  • Install Apache
    • apt-get install apache2 apache2-doc libapache2-mod-xsendfile
    • Activate some Apache modules: a2enmod rewrite dav_fs dav expires headers proxy socache_shmcb ssl vhost_alias dav ssl
    • Restart Apache: /etc/init.d/apache2 restart
     
    • Install PHP
      • apt-get install php7.0 php7.0-gd php7.0-xsl php7.0-ldap php7.0-xmlrpc php7.0-dev php7.0-curl php7.0-cli php7.0-common php7.0-fpm php7.0-soap php7.0-mbstring php7.0-intl php7.0-xml libapache2-mod-php7.0 php7.0-zip
    • Install some additional stuff
      • apt-get install memcached zip git htop wget curl htmldoc imagemagick nano libav-tools php-memcached openjdk-9-jre python phantomjs abiword libreoffice mailutils davfs2
    • Restart Apache: /etc/init.d/apache2 restart

Check the php-apache2-functionality:

  • a2query -m php7.0
  • This should give: php7.0 (enabled by maintainer script)
  • If not, there is a problem with the activation of the PHP-module in apache. This behavior may occure if the installation was upgraded from Ubuntu 14.04 before. For details, check this: http://askubuntu.com/questions/760787/php-rendered-as-text-after-ubuntu-16-04-upgrade
    • Run the following steps to resolve this issue: apt-get install libapache2-mod-php
    • Restart apache: /etc/init.d/apache2 restart
    • Check again: a2query -m php7.0

  • If it still does not work, try a2enmod php7.0
  • Restart apache and check again
  • If it still does not work, try a2dismod mpm_event followed by a2enmod mpm_prefork

Install MySQL

  • apt-get install mysql-server mysql-client
  • apt-get install phpmyadmin php7.0-mysql
  • I choose as root password ilias again
  • Later choose apache2 for phpmyadmin
  • Confirm the dialogs

Set MySQL-Charset

  • nano /etc/mysql/mysql.conf.d/mysqld.cnf
  • Scroll down
  • Paste the follwing:

1
2
3
4
5
6
7
8
9
10
[client]
default-character-set=utf8

[mysql]
default-character-set=utf8

[mysqld]
collation-server = utf8_unicode_ci
init-connect='SET NAMES utf8'
character-set-server = utf8

  • Save and exit with STRG + x
  • /etc/init.d/mysql stop
  • /etc/init.d/mysql start

Configure PHP 7 for ILIAS

  • nano /etc/php/7.0/apache2/php.ini
  • search with ctrl+w for these parameters and change the values like this:
    • max_execution_time = 600
    • max_input_vars = 10000
    • memory_limit = 200M

  • Set these two parameters accordingly to your needs:
    • post_max_size = 60M
    • upload_max_filesize = 40M

  • This setting for error-reporting very important, please do not try other values, because copying may not work in ILIAS:
    • error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT & ~E_NOTICE
    • display_errors = On
  • Sessionhandling
    • session.gc_probability = 1
    • session.gc_divisor = 100
    • session.gc_maxlifetime = 3600
    • session.hash_function = 0
    • session.use_only_cookies = 1
  • To make the settings work, restart apache: /etc/init.d/apache2 restart

Installing ILIAS

  • Creating directories outside webspace:
    • mkdir /opt/iliasdata
    • mkdir /opt/iliasdata/lucene
  • Change to Webserver directory:
    • cd /var/www/html
  • Download ILIAS latest via git:
    • git clone https://github.com/ILIAS-eLearning/ILIAS.git ilias
  • Adjust the rightsettings:
    • chown -R www-data:www-data /var/www/html
    • chown -R www-data:www-data /opt/iliasdata
    • chmod -R 774 /var/www/html
    • chmod -R 770 /opt/iliasdata

  • Call ILIAS-Setup:
    • http://192.168.2.45/ilias/setup/setup.php
    • Here an example for the Basic-Settings-Page:

Creating an ILIAS-Client

  • In ILIAS-setup, click on Create new Client
  • Select databasetype, I choose MyISAM
  • Fill out this form with your own data. Give user root and password from the mysql-server:

  • In a poduction system you should not run the database as root for security reasons. Just add later another user that is only appropriate for the ILIAS database. The user can be added by phpmyadmin. After that, you have to update the textfile iliasdir/data/clientname/client.ini.php with the new credentials.
  • If you do not get a connection to the database, try 127.0.0.1 instead of localhost.

  • In the next step it is very important to choose the collation UTF-8_unicode_ci:

  • Apply all hotfixes
  • If any errors occure go back and check if the db is up to date
  • Choose language
  • Fill out contact-form
  • Set proxy, if necessary
  • Choose memcached as Cache:

  • Give a node like this and after that activate all components

  • Register client, because we need a NIC
  • Login to ILIAS :-)
  • Note: If you get a redirect-error, please reload the control structure in client-settings->tools

Configure a redirect to ILIAS

When people call your domain you may want to redirect them directely to ILIAS:

  • nano /var/www/html/index.php
  • Put these lines in and change them so that it fits to your installation:

1
2
3
4
<?
header("Location: https://bbs-ilias.de/ilias/goto.php?target=root_1&client_id=nurderhsv");
exit();
?>

Enable the ILIAS-Chatsystem

Install Node

The ILIAS-Chatsystem was completely new implemented in 5.2. So lets have a look how to get it work. It runs with node. The problem is: How to install node? There are a lot of pitfalls:

  1. If you installed it via apt-get install node node-legacy npm you run in the following problem:
    1. The version auf node 4.2.x is to low for the actual mathjax version and for etherpad-lite
    2. Hint for Plesk users: Please create a backup image bevor proceed (believe me, it`s important)
The first step is to check if node or npm are already installed.
  • node --version
  • nodejs --version
  • npm --version
To install it run:
  • curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -
  • apt-get install -y nodejs

After the installation, check the versions:

  • Check Node: node --version
  • Check NPM: npm --version
  • Check the nodeapath and keep the result in mind: whereis node - this could give the green nodepath: node: /home/ilias/local/bin/node or /usr/local/bin/node

Configure the chatserver

Now we configure the chatserver itself. In this blogpost I will show how to put the chatserver behind a reverse proxy so that we can use it with port 80 or 443. But for now, we choose a firewall-unfriendly port 8080.

  • Let`s go to Administration->Chat-Room->Chat-Server settings. Fill out the form like the follwing pattern:

Plese note that the chat will not run under https with these settings. Please do not try any https-connection or mod-rewrites to https. You only may use https during the loginprocess. After that, all users must be connected with http, like http://ilias.de/........ NOT https://ilias.de/....

  • Very important: Leave the field Subdirectory empty.

  • In the next step, we configure the client-settings found in the tab General Settings:

  • If we are able to safe everything, there should be two config files client.cfg  and server.cfg. Let`s have a look:
    • ls /opt/iliasdata/nurderhsv/chatroom
  • If node is installed and the 2 config-files are present, we start the chatserver with a little script:
    • cd /opt/scripts
    • nano ilchattest
    • Add this content:

1
2
3
4
5
6
7
#!/bin/bash

ilroot=/var/www/html/ilias
ildata=/opt/iliasdata
client=nurderhsv

node ${ilroot}/Modules/Chatroom/chat/chat ${ildata}/${client}/chatroom/server.cfg ${ildata}/${client}/chatroom/client.cfg

  • Quit with CTRL + o and CTRL + x
  • Make file executable: chmod +x ilchattest
  • Run it: ./ilchattest
  • Login to ILIAS and add a Chatobject or enter the public chat. Works everything fine?

ILIAS-Chat: Troubleshooting

  • If the chat does not work or nothing happens, we first have a look in the error-log:
  • nano /opt/iliasdata/chat_error.log
  • On a vServer with Debian Jessie which I configured lately I saw this logentry: 

[Thu Dec 21 2017 09:20:10 GMT+0100 (CET)] ERROR - {"pid":21901,"uid":0,"gid":0,"cwd":"/opt/scripts","execPath":"/usr/local/bin/node","version":"v6.9.5","argv":["/usr/local/bi$
Error: connect ECONNREFUSED 127.0.0.1:3306
    at Object.exports._errnoException (util.js:1022:11)
    at exports._exceptionWithHostPort (util.js:1045:20)
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1087:14)
    --------------------
    at Protocol._enqueue (/var/www/html/ilias/Modules/Chatroom/chat/node_modules/mysql/lib/protocol/Protocol.js:141:48)
    at Protocol.handshake (/var/www/html/ilias/Modules/Chatroom/chat/node_modules/mysql/lib/protocol/Protocol.js:52:41)
    at PoolConnection.connect (/var/www/html/ilias/Modules/Chatroom/chat/node_modules/mysql/lib/Connection.js:123:18)
    at Pool.getConnection (/var/www/html/ilias/Modules/Chatroom/chat/node_modules/mysql/lib/Pool.js:45:23)
    at Database.connect (/var/www/html/ilias/Modules/Chatroom/chat/Persistence/Database.js:23:9)
    at SetupDatabase (/var/www/html/ilias/Modules/Chatroom/chat/Bootstrap/SetupDatabase.js:14:11)
    at fn (/var/www/html/ilias/Modules/Chatroom/chat/node_modules/async/lib/async.js:746:34)
    at /var/www/html/ilias/Modules/Chatroom/chat/node_modules/async/lib/async.js:1213:16
    at /var/www/html/ilias/Modules/Chatroom/chat/node_modules/async/lib/async.js:166:37
    at /var/www/html/ilias/Modules/Chatroom/chat/node_modules/async/lib/async.js:706:43

  • The problem here is that mysql does not listen on the local IP 127.0.0.1. 
  • Try a mysql login via bash: mysql -h 127.0.0.1 -u root -p
  • The expected output is: ERROR 2003 (HY000): Can't connect to MySQL server on '127.0.0.1' (111)

  • The solution for me was to start the mysql-service: /etc/init.d/mysql start
  • If this does not work for you, try googling the errorcode above with the goal to establish a mysql-connection via bash as described.

Make Chatsystem start automatically

We want to have a reliable chatsystem that can restart itself, if necessary. We can achieve this with a litle script that we call via cron every 5 minutes. It checks if the chatsystem is reachable and - if not - restarts it. Here we go:

  • cd /etc/init.d
  • nano ilchat
  • Copy the follwing in to the file:

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
#!/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 should only include /usr/* if it runs after the mountnfs.sh script
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=nurderhsv
url=192.168.2.45
chatport=8080
code="404"
USER=www-data
node_path=/usr/local/bin/node

#################################################
chown ${USER} ${ilroot}/Modules/Chatroom/chat/chat.js
status=$(curl -s --head ${url}:${chatport} | head -n 1)

case "$1" in
start)

if [[ $status == *${code}* ]];
then

echo "Chat-Server seems to be running"
else
echo "Chat-Server 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 is up!"
exit

else
echo "Sorry, I was not able to start the Chatserver. Try user root instead of ${USER}"
exit
fi




fi

;;

stop)

if [[ $status == *${code}* ]];
then
echo "Chatserver is running...try to stop..."
kill $(ps aux | grep chat.js | awk '{print $2}') > /dev/null 2>&1
exit

else
echo "Chatserver 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 the values in lines 28-35. Do not forget the node path (whereis node).
  • Save and exit the file with CTRL+o and CTRL+x
  • Make it executable: chmod +x /etc/init.d/ilchat
  • Run the script: /etc/init.d/ilchat start
  • Run the script again: /etc/init.d/ilchat start - does it work?
  • Make script start at boot: update-rc.d ilchat defaults 93
  • Open crontab-config: nano /etc/crontab
  • Put in this line before the last #:

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

Be aware that the user www-data must have access to all chatfiles. In any doubt please try root instead of www-data.
You can check the cronjob in the syslog:

  • nano /var/log/syslog
  • Search for something like: Feb 26 12:15:01 ilias CRON[1471]: (www-data) CMD (/opt/scripts/ilchat > /dev/null 2>&1)

  • Restart the linux server and wait up to 5 minutes. The chatsystem should be available after that time.
  • You can also look for the node process using htop.

Note that this configuration will only work with http - not https, because we run the chatserver not under the SSL port 443. If you are using https for your entire site, please check this additional tutorial to make it work

Enable the ILIAS Lucene-RPC search engine

Lucene is a very powerfull searchengine that should be installed.

  • First we create a folder for lucene: mkdir /opt/iliasdata/lucene
  • Now the challenge is to put these two files in /opt/iliasdata/lucene:
    • ojdbc14.jar
    • orai18n.jar
  • You can download the files at oracle.com, just search via google. Unfortunately it is not possible to transfer these files via wget directly from oracle.com. So you have to find a way to to that. Maybe you have to install a ftpserver like proftpd.
  • 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!): nano /opt/iliasdata/lucene/ilServer.properties
  • Make path writable:
    • chmod -R 770 /opt/iliasdata/lucene
    • chown -R www-data:www-data /opt/iliasdata/lucene
  • Put these lines in and change all data accordingly to your system. You find your own NIC under 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/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:

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

New version 7 from 21th June 2017!

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: ilserverstart7
# 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"
libpath="/var/www/html/ilias/Services/WebServices/RPC/lib/" #only the path to ilServer.jar
configpath="/opt/iliasdata/lucene/" #Path to ojdbc14.jar, orai18n.jar, ilServer.properties

USER=www-data
inifile="ilServer.properties" #Name of INI-FIle
enc="-Dfile.encoding=UTF-8"
#######################################################################################################################
code="de.ilias.ilServer"
status=$(ps aux | grep ojdbc)
#$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 "${configpath}ojdbc14.jar:${configpath}orai18n.jar:${libpath}ilServer.jar" de.ilias.ilServer ${configpath}$inifile start &
} &> /dev/null
sleep 5
string=$(ps aux | grep ojdbc)
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 ojdbc | 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 0

  • Make it executable: chmod +x /etc/init.d/ilserver
  • 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
  • Now, the scary things are done and we can do the rest in the ILIAS-Administration of the current client. Go to Administration->General-Settings->Server->Java-Server
    • Give IP and the port that you choose in the file ilServer.properties: 127.0.0.1 and 11111 (5x1!)

  • Activate the Lucene search in Administration->Search. Ignore any errors befor you have updated the searchindex for the 1st time (see following step).

  • Go to Adminstration->General Settings->Crone Jobs and update the Lucene search index:

  • In case it will not work, have a look at the lucene-logfile:
    • nano /opt/iliasdata/lucene.log
    • For example, this appears because the clientname was wrong in the file ilServer.properties: 2017-02-26 13:57:47,124 ERROR main (ClientSettings.java:220) - Error reading client ini file: /var/www/html/ilias/data/ilias/client.ini.php
    • Please ignore all errors before the first run of the lucene cronjob because a lot of errors are caused by a missing searchindex.

The following script was written because the lucene-index broke down sometimes. But I think I solved this problem by using a better ini-file with two extra parameters. However, if you like to run the the script for testing proposals anyway, here it is:

  • If it still do not work, try to index manually:
    • nano /opt/scripts/fixlucene
    • Copy the following script in
      • Change line 2-4 if necessary
      • chmod +x /opt/scripts/fixlucene
      • Start script: /opt/scripts/fixlucene
    • The script runs in the background. Have a look at the cpu load with htop - if it is high, the script is running. After that ILIAS should be able to index itself. It`s just a little start-up aid.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/bin/bash
client_nic=nurderhsv_10848
ilserver=/var/www/html/ilias/Services/WebServices/RPC/lib
config=/opt/iliasdata/lucene
#############################################

rm -R ${config}/${client_nic}*
/etc/init.d/ilserver stop
sleep 5
/etc/init.d/ilserver start
sleep 5

echo Manuelles Indizieren
echo "Open htop. If CPU load is high, indexing is still in progress. May take 3-5 minutes..."
index=createIndex

#Line to update the Lucene-Index

/usr/bin/java -Dfile.encoding=UTF-8 -Dconsole.encoding=UTF-8 -jar ${ilserver}/ilServer.jar ${config}/ilServer.properties ${index} ${client_nic} &

You can also run this script by cron at midnight or something - I do this in my server. Just add this line in your crontab:

  • nano /etc/crontab
  • Add the follwing 2 lines: 

#Fixlucene
30 3    * * *   root   /opt/scripts/fixlucene

Here some error messages that will disappear after manual indexing:

  •  ERROR XML-RPC-0 (RPCIndexHandler.java:206) - Unknown error
  • ERROR XML-RPC-1 (RPCSearchHandler.java:165) - com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: No operations allowed after connection
  • ERROR XML-RPC-0 (RPCSearchHandler.java:165) - java.lang.NumberFormatException: For input string: ""

Set the Cronjobs

We need 3 cronjobs for ILIAS for the following proposes:

  1. Trigger the ILIAS cronjobs by running it every hour
  2. Trigger the chatserver script - it checks every x minutes, if the service is up and if not, starts it (we already add this)
  3. Trigger the Lucene-RPC-server script - it checks every x minutes, if the service is up and if not, starts it
  • This will be done by adding 3 lines to the file /etc/crontab: nano /etc/crontab
  • Put the following lines  in that file before the last #:

You can set all ILIAS cronjobs in Administration->General Settings->Cronjobs.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#Line that triggers the ILIAS-cronjobs. Read explanation below.
0 1 * * * root /usr/bin/php /var/www/html/ilias/cron/cron.php root homer nurderhsv > /dev/null

#Explanation:
#root: Username of cronjob user, you may also use www-data
#homer: Password of root
#nurderhsv: clientname
#Runs at 1 a clock in the morning
# > /dev/null: We won`t get any mails or other (error-) messages about this job.

#Line for Lucene-RPC-Server: checks every 6 minutes if sevice is up
*/6 * * * * root /etc/init.d/ilserver start >/dev/null 2>&1

#Line forChat-Server: checks every 5 minutes if sevice is up
*/5 * * * * root /etc/init.d/ilchat start >/dev/null 2>&1

Activate Webaccess-Checker

The Webaccess-Checker is shipped with ILIAS with we file .htaccess in the ILIAS rootfolder. By default, this file will not load so we change this by adding a new apache-config-file:

  • cd /etc/apache2/sites-available
  • nano ilias.conf
  • Put these lines in:

If you already hava a working vhost file (maybe because you already own a server), use it and add only the sendfile-lines 5 and 6. Do not create a new file.

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
<VirtualHost *:80>
DocumentRoot /var/www/html
KeepAlive on
#ServerName www.domain.tld
#ServerAlias domain.tld
 
XSendFilePath /var/www/html
XSendFilePath /opt/iliasdata
 
<Directory /var/www/html>
Options -Indexes +FollowSymlinks
AllowOverride All
Order allow,deny
allow from all
 
ExpiresActive On
ExpiresByType text/css "access plus 7 day"
ExpiresByType image/gif "access plus 7 day"
ExpiresByType image/jpg "access plus 7 day"
ExpiresByType image/jpeg "access plus 7 day"
ExpiresByType image/png "access plus 7 day"
 
DirectoryIndex index.html
DirectoryIndex index.htm
DirectoryIndex index.php
</Directory>
 
ErrorLog ${APACHE_LOG_DIR}/ilias-error.log
 
CustomLog ${APACHE_LOG_DIR}/ssl_access.log combined
 
</VirtualHost>

  • If you have a domain, change line 1 from *:80 to mydomain.com:80
  • Change lines 2, 5, 6 and 8 if necessary
  • Save and exit
  • Activate the config: a2ensite ilias.conf
  • Deactivate old default-config: a2dissite 000-default.conf
  • Restart Apache: /etc/init.d/apache2 restart

Soap

  • Activate Ssoap to avoid copy problems : ILIAS->Administration->General Webservices

Install Mathjax server

I recommend to run an own mathjax server if you plan to use this service, because this will be the quickest way to run mathjax. The first step is to install node, but be already installed it in the chatserver section above. So we just need to install some npm packages and create a start script.

Node versions < 5 will not work with mathjax. Please update to 6.9.5 or similar like described in the chat section above.

  • mkdir /opt/mathjax
  • cd /opt/mathjax
  • npm install https://github.com/mathjax/MathJax-node/tarball/master
  • npm install https://github.com/tiarno/mathjax-server/tarball/master
  • cd node_modules
  • ln -s mathjax-node MathJax-node
  • mkdir mathjax-node/batik
  • cd mathjax-node/batik
  • You can also choose a higher version: wget http://www-eu.apache.org/dist/xmlgraphics/batik/binaries/batik-bin-1.9.zip
  • unzip batik-bin-1.9.zip
  • ln -s batik-1.9/batik-rasterizer-1.9.jar batik-rasterizer.jar
  • ln -s batik-1.9/lib lib
  • cd /opt/mathjax
  • nano mathjax.js
  • Put these lines in:

1
2
var server = require('./node_modules/mathjax-server/index.js');
server.start(8003);

  • Start the server manually: node mathjax.js - if there is something wrong, you will get: worker 4216 died. If all is fine, you will get: Server listening on port 8003. If this do not work, find out the path of node with whereis node and try the start like this:
    • /usr/local/bin/node mathjax.js
  • Stop the server with STRC+C
  • Now we create the start script: nano /etc/init.d/ilmathjax
  • Copy the following 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
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: ilmathjax2
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: ILIAS-Mathjaxserver nodebased
# 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="ilmathjax"
NAME=ilmathjax

SCRIPTNAME=/etc/init.d/$NAME
USER=www-data

nodepath=/usr/local/bin/node
scriptpath=/opt/mathjax/mathjax.js
code="${nodepath} ${scriptpath}"

#######################################################################################################################
code="${nodepath} ${scriptpath}"
status=$(ps aux | grep ${scriptpath})

case "$1" in
start)
if [[ $status == *${code}* ]];
then
echo "Mathjax is already running...exit now..."
exit

else
echo "Mathjax is down...try to start..."
{
sudo -H -u $USER bash -c "${nodepath} ${scriptpath}" &
} &> /dev/null

status=$(ps aux | grep ${scriptpath})
if [[ $status == *${code}* ]];
then
echo "Mathjax service runs now as user $USER"
exit
else
echo "Fail to start Mathjax with user $USER. Please try user root instead if $USER"
exit
fi

fi
;;

stop)

if [[ $status == *${code}* ]];
then
echo "Mathjax is running...try to stop..."
kill $(ps aux | grep mathjax.js | awk '{print $2}') > /dev/null 2>&1
#kill $(ps aux | grep mathjax | awk '{print $2}') > /dev/null 2>&1
exit

else
echo "Mathjax is already down..."
exit
fi



;;

status)

if [[ $status == *${code}* ]];
then
echo "Mathjax is running...exit now..."
exit

else
echo "Mathjax is down...exit now..."
exit

fi

;;

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

  • Check if the node path in line 5 is correct: whereis node
  • Make the scripts executable: chmod +x /etc/init.d/ilmathjax
  • update-rc.d ilmathjax defaults 93
  • Update crontab: nano /etc/crontab
  • Put the following lines in before the last #:

1
2
#Mathjax
*/5 * * * * root /opt/scripts/ilmathjax start > /dev/null 2>&1

That means, the script checks every 5 minutes if the mathjax server is running. Replace mathjax with root if the script does not run and check the rightsetting.

  • Activate Mathjax in ILIAS-Administration->Third party software->mathjax:

Add better WebDAV description

It`s a good idea to change the default WebDAV text with a better one created by Simon Moor:

  • mkdir /var/www/html/ilias/Customizing/clients
  • cd /var/www/html/ilias/Customizing/clients
  • Create a folder with your clientname: mkdir nurderhsv
  • cd nurderhsv
  • Download the templatefile: wget https://bbs-ilias.de/schulclient/Customizing/clients/iliasschoolmaster/webdavtemplate.htm

Check rights by script

Its a good idea to check the rightsetting by a script at night:

  • nano /var/scripts/checkrights
  • Put these lines in:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/bin/bash

chmod -R 775 /var/www/html
chown -R root:root /var/www/html/ilias
chown -R www-data:www-data /var/www/html/ilias/data
chown -R www-data:www-data /var/www/html/ilias/Customizing
chown www-data:www-data /var/www/html/ilias/ilias.ini.php

chown -R www-data:www-data /opt
chmod -R 770 /opt

#Examples for plesk users
#chown -R rootplesk123:psaserv /var/www/vhosts/kivinet.de/httpdocs/
#chmod -R 775 /var/www/vhosts/kivinet.de
#chown -R rootplesk123:psaserv /opt/ilias
#chmod -R 770 /opt/ilias

  • Add a cronjob that will run early in the morning:

1
2
#Check righs
1 4 * * * root /opt/scripts/checkrights > /dev/null 2>&1

Some hints for plesk users

  • Do never upgrade like this: apt-get uprade - apt-get update is OK.
  • Do never install node, nodejs oder npm via apt
  • To avoid open basdir restriction problems, put in the PHP settings page under openbasedir something like this: {WEBSPACEROOT}{/}{:}{TMP}{/}:/opt/ilias
  • Additional PHP settings could be:

  • The Apache settings page may be set like this in the section Additional directives for HTTP(S):

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
RewriteEngine On
RewriteCond %{HTTP_HOST} kivinet.de
RewriteRule ^(.*)$ - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]

<Directory /var/www/vhosts/kivinet.de/httpdocs>
AllowOverride All
Options -Indexes +FollowSymLinks +MultiViews
# AddDefaultCharset utf-8

</Directory>

<Directory /var/www/vhosts/kivinet.de/httpdocs/ilias>
AllowOverride All
Options -Indexes +FollowSymLinks +MultiViews
# AddDefaultCharset utf-8
XSendFilePath /var/www/vhosts/kivinet.de/httpdocs/ilias
XSendFilePath /opt/ilias/iliasschule
</Directory>

  • The lines 1-3 are very important for webdav.

Next steps


Comments

  • La

    [Laurent]

    I encountered the same problem when installing version 5.3.11. The downloaded files were 0 bytes in size. They can be dropped on ILIAS but when they are then retrieved on a connected workstation then the size is at 0 bytes. After looking everywhere in the configuration I read your comment that helped me a lot! (Thank you very much). Uninstalling libapache2-mod-xsendfile solved this problem. Did you report this problem in Mantis to find out if it is an Ilias bug or a recommendation that should be systematically applied?

    Created on6. Dec 2018
  • Qn

    [Qndrs]

    In a test setup I've encountered a problem with the file download in Ilias. The downloaded files where 0 bytes in size. Uninstalling libapache2-mod-xsendfile however fixed this problem. Is this an Ilias bug and is libapache2-mod-xsendfile needed for any other functionality?

    Created on5. Feb 2018