ILIAS-7-Install-Tutorial for Ubuntu 20.04

Use rightsetting Script

Check rights by script

Its a good idea to check the rightsetting by a script at night:
  • nano /opt/scripts/checkrights
  • Put these lines 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
#!/bin/bash
www=/var/www/html
iliaswwwdir=/var/www/html/ilias
opt=/opt
optilias=/opt/iliasdata
webu=www-data:www-data

client1=iliasschoolmaster
client2=stackschule

chown -R ${webu} ${www}
chmod -R 775 ${www}
chown -R ${webu} ${opt}
chmod -R 750 ${opt}
chmod 775 /opt

find ${iliaswwwdir}/data -type d -exec chmod 755 {} \;
find ${iliaswwwdir}/data -type f -exec chmod 644 {} \;

find ${optilias} -type d -exec chmod 750 {} \;
find ${optilias} -type f -exec chmod 640 {} \;

chmod 700 ${iliaswwwdir}/data/${client1}/client.ini.php
chmod 700 ${iliaswwwdir}/data/${client2}/client.ini.php
chmod 700 ${iliaswwwdir}/ilias.ini.php

chmod 440 ${optilias}/${client1}/chatroom/server.cfg
chmod 440 ${optilias}/${client1}/chatroom/client.cfg

chmod 440 ${optilias}/${client2}/chatroom/server.cfg
chmod 440 ${optilias}/${client2}/chatroom/client.cfg

chmod 775 /opt
chown -R etherpad:etherpad /opt/etherpadlite
  • chmod +x /opt/scripts/checkrights
  • Add a cronjob that will run early in the morning: nano /etc/crontab
1
2
#Check rights
1 4 * * * root /opt/scripts/checkrights > /dev/null 2>&1

Special script to protect ini files

Its a good idea to chek rightsettings of the ini files every 3 minutes:
  • touch /opt/scripts/protectinis
  • chmod +x /opt/scripts/protectinis
  • nano /opt/scripts/protectinis
  • Put these lines in:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/bin/bash
www=/var/www/html
iliaswwwdir=/var/www/html/ilias
opt=/opt
optilias=/opt/iliasdata
webu=www-data:www-data

client1=iliasschoolmaster


chmod 700 ${iliaswwwdir}/data/${client1}/client.ini.php

chmod 700 ${iliaswwwdir}/ilias.ini.php


#If chatservice is runing
#chmod 440 ${optilias}/${client1}/chatroom/server.cfg
  • Now we set a cronjob:
    • nano /etc/crontab
    • Add this line:
1
2
#Protect ini-files
*/3 * * * * root /opt/scripts/protectinis


No comment has been posted yet.