Difference between revisions of "Cool Solution - Install Moodle"

From Univention Wiki

Jump to: navigation, search
 
(33 intermediate revisions by 7 users not shown)
Line 1: Line 1:
{{Cool Solutions Disclaimer|Repository=no|UCS=3.1|school=3.1}}
+
This page has been moved to the Knowledge Base Cool Solutions in the Forum.
  
== Introduction ==
+
[https://help.univention.com/t/cool-solution-install-moodle/12258 Cool Solution - Install Moodle]
This article introduces you to the usage of Moodle. It covers the installation on a dedicated school server, as well as the users authentication with the LDAP. If further integration packages are needed, like loading classes from the LDAP or using the Microsoft Windows authentication for already logged in users, feel free to contact Univention for assistance.
 
 
 
== Installation ==
 
 
 
This section will cover the preparation and installation of Moodle on the system. Please make sure that every command is executed as root user.
 
 
 
For the installation to succeed, some packages must be downloaded from the Univention unmaintained repositories. To activate the Univention unmaintained repository, execute the following command:
 
<pre>
 
ucr set repository/online/unmaintained=yes
 
</pre>
 
 
 
To install Moodle and some dependencies, execute the following command:
 
<pre>
 
univention-install php5-pgsql univention-postgresql moodle
 
</pre>
 
 
 
The PostgreSQL database modules must be included in PHP. Add the following two lines into the '''/etc/php5/apache2/php.ini''' file:
 
<pre>
 
extension=pgsql.so
 
extension=gd.so
 
</pre>
 
 
 
To use Moodle effectively, it is recommended to raise the maximum size for uploads, e. g. 20 MB, to provide small programs to students. The changes must be done in the '''/etc/php5/apache2/php.ini''' file:
 
<pre>
 
post_max_size = 20M
 
upload_max_filesize = 20M
 
</pre>
 
 
 
For the changes to take effect, the Apache webserver must be restarted:
 
<pre>
 
/etc/init.d/apache2 restart
 
</pre>
 
 
 
 
 
== Configuration ==
 
 
 
This section handles the basic configuration and LDAP connection for Moodle and how to delete users in Moodle that are not in the LDAP anymore.
 
 
 
=== Basic configuration ===
 
 
 
First, Moodle's entry restrictions must be changed. To do so, edit the file '''/etc/moodle/apache.conf''' and edit the following line to match your network settings:
 
<pre>
 
allow from 127.0.0.0/255.0.0.0
 
</pre>
 
 
 
Also check the settings in the '''/etc/moodle/config.php''' file and change the entry '''localhost''' to the server's hostname:
 
<pre>
 
$CFG->wwwroot
 
</pre>
 
 
 
To install with alias, create a symbolic link to apache2:
 
<pre>
 
ln -s /etc/moodle/apache.conf /etc/apache2/conf.d/moodle
 
</pre>
 
 
 
For the changes to take effect, the Apache webserver must be restarted:
 
<pre>
 
/etc/init.d/apache2 restart
 
</pre>
 
 
 
Now the Moodle service can be reached and configured by opening the web page in a webbrowser:
 
<pre>
 
http://<server>/moodle
 
</pre>
 
 
 
 
 
=== LDAP authentification ===
 
 
 
After the basic configuration is done, https should be activated in '''Security''' -> '''HTTP security'''. Next, in '''Users''' -> '''Authentication''' -> '''Manage authentication''' the option '''Email-based self-registration''' should be deactivated and '''LDAP server''' should be activated.
 
 
 
Next, a simple authentication account should be created using the UDM. This account can then be used for an authenticated bind. To find the DN of the account issue the following command on the command line:
 
<pre>
 
udm users/user list --filter username=<NAME of the account> | grep DN
 
</pre>
 
 
 
Now the LDAP connection can be configured under '''Settings'''. The table gives information which default settings must be changed:
 
 
 
{|class="wikitable"
 
!Key
 
!Value
 
|-
 
!colspan="2"|LDAP server settings
 
|-
 
|Host URL
 
|ldap://<school server's FQDN>:7389
 
|-
 
|Version
 
|3
 
|-
 
!colspan="2"|Bind settings
 
|-
 
|Distinguished Name
 
|<DN of the authentication account>
 
|-
 
|Password
 
|<Password of the authentication account>
 
|-
 
!colspan="2"|User lookup settings
 
|-
 
|Contexts
 
|cn=users,ou=<school>,dc=<domain>
 
|-
 
|Search subcontexts
 
|Yes
 
|-
 
|User Attribute
 
|uid
 
|-
 
!colspan="2"|Course creator
 
|-
 
|Creators
 
|cn=lehrer,cn=users,ou=<school>,dc=<domain>
 
|-
 
!colspan="2"|Cron synchronization script
 
|-
 
|Removed ext user
 
|Full delete internal
 
|-
 
!colspan="2"|Data mapping
 
|-
 
|Update local
 
|On Every Login
 
|-
 
|Update external
 
|Never
 
|-
 
|Lock value
 
|Locked
 
|}
 
 
 
''Hint:'' To obtain the LDAP basis, execute the following command on the school server:
 
<pre>
 
ucr get ldap/base
 
</pre>
 
 
 
''Hint:'' To obtain the system's FQDN, execute the following command on the relevant system:
 
<pre>
 
hostname -f
 
</pre>
 
 
 
=== LDAP mapping ===
 
 
 
Furthermore, the following mapping applies for LDAP entries:
 
 
 
{|class="wikitable"
 
!Key
 
!Value
 
|-
 
|First name
 
|givenName
 
|-
 
|Surname
 
|sn
 
|-
 
|Email address
 
|mail
 
|-
 
|Phone 1
 
|telephoneNumber
 
|-
 
|Phone 2
 
|homePhone
 
|-
 
|City/town
 
|l
 
|-
 
|Country
 
|c
 
|}
 
 
 
 
 
Note: Some fields like Email address are mandatory for moodle, so you should make sure all moodle users have a valid email in UCS.
 
 
 
=== Cronjob for deleting users ===
 
 
 
In order for Moodle to remove users from its database that are deleted in the LDAP, a cronjob must be defined in the UDM.
 
 
 
ucr set cron/moodle/command='wget -q -O /dev/null http://localhost/moodle/admin/cron.php'\
 
cron/moodle/time='*/10 * * * *'
 
 
 
== Restrictions ==
 
 
 
#'''OU''': At this time it is not possible for Moodle to search for all users using the LDAP base DN.
 
#'''Class mapping''': This article does not handle mappings between UCS@School classes and Moodle groups. If you need assistance to create the respective mapping or would like to have the setup packaged, feel free to contact Univention for an offer to create either.
 
 
 
== References ==
 
 
 
* Moodle - https://moodle.org/
 
* Moodle LDAP - http://docs.moodle.org/25/en/auth/ldap
 
* Moodle 2.5 Documentation - http://docs.moodle.org/25/en/Main_page
 
  
 +
[[Category:EN]]
 
[[Category:Howtos]]
 
[[Category:Howtos]]
[[Category:EN]]
 

Latest revision as of 12:08, 4 September 2019

This page has been moved to the Knowledge Base Cool Solutions in the Forum.

Cool Solution - Install Moodle

Personal tools