ILIAS-Tricks not only for Schools
Tutorial: Installing ILIAS 5.3 @ Ubuntu LTS 16.04
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:
- Serverinstallation and login via VirtualBox
- Installation of all needed packages via apt
- Activation of the needed Apache modules
- Configuration of PHP 7
- Installation of ILIAS
- Configuration of Memcached
- Configuration of the new Chatserver including a script for auto (re-) start and Node
- Configuration of the Lucene-RPC server including start-stop-script
- Activation of the ILIAS cronservice
- Activation of the Webaccess-Checker
- 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
- Run the following steps to resolve this issue:
- 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 bya2enmod 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 | [client] |
- Save and exit with STRG + x
/etc/init.d/mysql stop
/etc/init.d/mysql start
Configure PHP 7 for ILIAS
- Now we do some settings in the file
/etc/php/7.0/apache2/php.ini
- More details are available at http://www.ilias.de/docu/goto_docu_pg_6531_367.html
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 | <? |
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:
- If you installed it via apt-get install node node-legacy npm you run in the following problem:
- The version auf node 4.2.x is to low for the actual mathjax version and for etherpad-lite
- Hint for Plesk users: Please create a backup image bevor proceed (believe me, it`s important)
node --version
nodejs --version
npm --version
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 | #!/bin/bash |
- Quit with
CTRL + o
andCTRL + 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 | #!/bin/bash |
- Change the values in lines 28-35. Do not forget the node path (
whereis node
). - Save and exit the file with
CTRL+o
andCTRL+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 | #Line for Chat-Server: checks every 5 minutes if sevice is up |
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 | [Server] |
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 | #!/bin/bash |
- 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 | #!/bin/bash |
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:
- Trigger the ILIAS cronjobs by running it every hour
- Trigger the chatserver script - it checks every x minutes, if the service is up and if not, starts it (we already add this)
- 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 | #Line that triggers the ILIAS-cronjobs. Read explanation below. |
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 | <VirtualHost *:80> |
- 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 | var server = require('./node_modules/mathjax-server/index.js'); |
- 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 withwhereis 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 | #!/bin/bash |
- 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 | #Mathjax |
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 | #!/bin/bash |
- Add a cronjob that will run early in the morning:
1 | #Check righs |
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 | RewriteEngine On |
- The lines 1-3 are very important for webdav.
Next steps
- Run ILIAS completely under SSL/HTTPS for free
- Install these plugins:
- Install EtherpadLite (but do not install node again!!!)
- Install didactical templates in ILIAS->Administration->didactical templates
- Update ILIAS
- To get a mailservice, consider the installation of SSMTP (very simple) or Postfix (advanced but not to complicated). ILIAS 5.3 (Feb. 2018) will allow you to use a mailservice like gmx or gmail (smtp-settings-page).
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