ILIAS-Tricks not only for Schools
Tutorial: Run ILIAS completely under SSL/HTTPS for free
- ILIAS 5.2 or greater
- Tested with Debian 8 and Ubuntu 14.04 LTS
- Status of the tutorial: Seems to work
- Contact: wolfgang.huebsch@gmx.de
- Version: 0.2a, last change 02.03.2018
- This tutorial shows how to encrypt your entire ILIAS installation with https/SSL with a valid SSL certificate for free and without any warnings. That means:
- Your entire site, like bbs-ilias.de will be reachable only under https://bbs-ilias.de
- This includes the ILIAS chatsystem
- This includes also a optional Etherpad-Lite installation
I assume that you allready activated your chatsystem like described here: Tutorial: Installing ILIAS 5.2 @ Ubuntu LTS 16.04. Remember that in this older tutorial the chatserver runs @ port 8080 and that`s not the same like 443 (SSL). So before you start with https, install the chat running your site successfully @http and port 8080! If everything works fine with http, start here - if not, go back!
Please check all paths and other specifications of my scripts to make them fit to your installation!
When SSL-setup is done, adjust the file ilias.ini.php in /var/www/html/ilias accordingly with your new https-settings. Example:
[server]
http_path = "https://bbs-ilias.de/info"
What we will do
- We will get some SSL certificates for free from https://letsencrypt.org/
- We will redirect everything from port 80 to 443, that means from http://bbs-ilias.de to https://bbs-ilias.de
- We will redirect the chatport 8080 to https://chat.bbs-ilias.de @ port 443
- We will redirect the Etherpad-Lite port 9001 to https://pad.bbs-ilias.de @ port 443
General server settings to activate SSL
Go to ILIAS->Administration->Privacy and Security->Security->General Settings->HTTPS-handling. Set it to disabled. If not, there is a redirect-login-error possible (solution at the end of this tutorial).
- Check, which sites are running under https:
ls /etc/apache2/sites-enabled
- Disable all SSL-confs (recommended). Example:
a2dissite bbs-ilias-ssl.conf
- Now we create all vhost-files that we need. In this case:
cd /etc/apache2/sites-available
- For the whole site (I think this file allready exists because you created it in the tutorial before):
touch bbs-ilias.conf
- For Etherpad:
touch pad.bbs-ilias.conf
- For ILIAS-Chat-System:
touch chat.bbs-ilias.conf
- If you don`t use similar vhost files allready, you can choose my examples. Just edit some lines so it will fit to your installation:
Change the first 10 lines if necessary
1 | <VirtualHost bbs-ilias.de:80> |
Change the first line and line 20, if necessary
1 | <VirtualHost pad.bbs-ilias.de:80> |
Change the first line and line 21, if necessary
1 | <VirtualHost chat.bbs-ilias.de:80> |
Do not forget to enable these new Vhost files, so that there are visible in /etc/apache2/sites-enabled
- No we create the Certificates for all domains and subdomains:
- Got to https://certbot.eff.org/
- Choose your system, in my case Apache2@Debian8
- Enable Backports like described
- Choose automated install like described and follow the menu
- After the prompt "which names would you like to activate HTTPS for?" , choose the names, like 1 2 3 4, give your e-mail and so on ...
- Recommended: Choose 2: "Secure - Make all requests redirect to secure HTTPS access"
- After all, there should appear something like this:
- "Congratulations! You have successfully enabled https://bbs-ilias.de,https://chat.bbs-ilias.de, https://pad.bbs-ilias.de, andhttps://www.bbs-ilias.de"
- Check, if everything works like expected: https://bbs-ilias.de
Special server settings: Let`s activate the ILIAS-Chatsystem@SSL
We activated the subdomain https://chat.bbs-ilias.de, but if we call it, we will be redirected to https://bbs-ilias.de. That`s because some settings are missing. Here we go :-)
Btw.: The mother of this part can be found here: http://www.ilias.de/docu/goto_docu_frm_1875_2242.html
- I assume that you allready activated your chatsystem like described here: https://bbs-ilias.de/info/goto.php?target=blog_62_13&client_id=info.
- Remind: SSL will only work if you have a real FQDN like bbs-ilias.de.
- Go to ILIAS-Administration->Chat Room->Chatserver-Settings. Complete the form like this:
- IP-Address/FQN of Chat Server:
chat.bbs-ilias.de
(of course you take your own FQDN...) - Port of Chat Server:
443
- Protocol:
https
- Certificat:
/opt/ilias/ilchatdummy
- Key:
/opt/ilias/ilchatdummy
- Diffie-Hellman Parameter:
/opt/ilias/ilchatdummy
- Btw.: A file called
/opt/ilias/ilchatdummy
must not exist. - Now we have to edit the file server.cfg:
- Go to the location where the chatconfig files exist. You can find it in your datadirectory:
cd /opt/iliasdata/clientname/chatroom
- Open the file server.cfg:
nano server.cfg
- The file should look like this, but it will not ^^:
- Go to the location where the chatconfig files exist. You can find it in your datadirectory:
- IP-Address/FQN of Chat Server:
1 | "protocol": "http", |
- That`s because we did other settings in ILIAS before. These settings are used to have a communication from outside to the server@SSL. However, here we need settings that are necessary for the communication inside the server (without SSL) .
- So please change lines 2 and 3 of the file
server.cfg
accordingly like the example above. This is necessarry because the chatserver must run with the ip 127.0.0.1 at port 8080 and second a special rewrite will later point to https://pad.your.domain. That`s the trick. - Because it`s possible to overwrite these settings in ILIAS, you have to prevent this with this rightsettings:
chown root:root server.cfg
chmod 444 server.cfg
- Now we check the vhost file that is responsible for the redirect:
cd /etc/apache2/sites-available
- Have a look at the vhost-file thats called like this:
nano chat.bbs-ilias.de-le-ssl.conf
- Check if the settings are the same like in server.cfg. It may look like this (line 2 has your own FQDN):
Edit the line 2 and the lines 21 etc. so that they fit to your installation
1 | <IfModule mod_ssl.c> |
- Check also, if this file is activated. It should appear here:
ls /etc/apache2/sites-enabled
- The last step is to fit your startscript which may be located in /opt/scrips/ilchat or whatever:
nano /etc/init.d/ilchat
- It should look like this (lines 3-7):
- Edit the lines 28-35 so that they fit to your installation, but:
- Do not change
IP url=127.0.0.1
!!! - Do not change
chatport=8080
!!! - Do not change
code="404"
!!!
- Do not change
1 | #!/bin/bash |
- Try the script. The server should run like expected:
/etc/init.d/ilchat
may give: Chat-Server seems to be running
Special Settings: Etherpad-Lite@SSL
- Normally, you run Etherpad-Lite with port 9001. Thats not longer possible, because we put everthing behind 443. The first step is to stop Etherpad-Service. @BBS-ILIAS, this is done like this:
/etc/init.d/etherpad-lite stop
- Now we check if the SSL-vhost-entry is correct:
nano /etc/apache2/sites-available/pad.bbs-ilias.de-le-ssl.conf
- This should give something like this: (please check also, if you see the site in /etc/apache2/sites-enabled)
1 | <IfModule mod_ssl.c> |
- Start etherpad-lite:
/etc/init.d/etherpad-lite start
- Wait a moment. It should be reachable under https://pad.bbs-ilias.de
- Now we have to change some settings in the plugin-config from ILIAS (Administration->Plugins). Check it like this (right side):
HTTP | HTTPS | |
Host | pad.bbs-ilias.de | pad.bbs-ilias.de |
Port | 80 | 443 |
Domain | .bbs-ilias.de | .bbs-ilias.de |
Https | Unchecked | Checked |
Valid SSL-Cert: | - | Checked |
Path | Leave empty | Leave empty |
Troubleshooting
If you forgot to disable https in ILIAS:
Deactivate in ILIAS->Administration->Privacy and Security->Security->General Settings->HTTPS-handling. This must be set to disabled. If not, there is a redirect-login-error possible. In that case you have to disable the permanent redirect to https in your vhost responsible for port 80 (bbs-ilias.conf).
- Look for lines like below and put a # before them. Restart apache and deactivate HTTPS-handling in ILIAS.
- Delete the # to have full SSL-encryption again.
RewriteCond %{SERVER_NAME} =bbs-ilias.de
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,QSA,R=permanent]
If you get an error while calling pad.bbs-ilias.de
- The server may not understand localhost, so try 127.0.0.1 instead. Example:
1 | ProxyVia On |
Comments
- ch
[chabm]
Hello,
We are trying to get our chat working completely under SSL, following this guide under proxy configuration. Chat is functioning, but we encountered the following problems: emotes are not showing in the chat, some of the icons and images. Those images will display if I uncomment WAC rule in .htaccess.
I hope anyone has some ideas about where I should look at?
There is a thread in the ILIAS forums as well: https://docu.ilias.de/ilias.php?ref_id=1875&cmdClass=ilobjforumgui&thr_pk=5955&cmd=viewThread&cmdNode=uo:2w&baseClass=ilRepositoryGUI
Created on6. Aug 2019