The operations described on this page may render your MoodleBox unusable, requiring the complete wiping of the SD card and the loss of all data (course contents, installed plug-ins, custom configurations, etc.). Do this only if you know exactly what you are doing. In any case, no support is provided on this subject.
We accept no responsibility for any direct or indirect damage caused by the use of the MoodleBox, in particular following a change of domain name.
How to proceed
The example below shows how to change the domain name of a MoodleBox, which will allow a local device to reach it with a new URL. The example shows how to give the MoodleBox the domain name learn.example.com.
This operation has no influence on access to the MoodleBox from an Ethernet network or from the Internet: the MoodleBox will remain accessible only from the Wi-Fi network it provides, from the devices that have connected to it.
Step 1: Change the host name (hostname)
In the last line of the
/etc/hosts file, replace
moodlebox with learn.example.com.
/etc/hostname file, replace
moodlebox with learn.example.com (this modification is not necessary, but highly recommended).
Step 2: Adapt the configuration of the nginx web server
Change the file
moodlebox with the full domain name (FQDN) learn.example.com in the
Step 3: Adapt the DNS server masquerading configuration
Change the file
home by learn.example.com in the two lines that start with
local. Comment out or delete completely the line starting with
Step 4: Adapt the Moodle configuration (Moodle URL)
In the file
/var/www/moodle/config.php, on the line beginning with
$CFG->wwwroot, replace the URL
http://learn.example.com. Do not add a slash at the end of the URL.
Step 5: Restart the MoodleBox
In order to apply these changes, restart your MoodleBox.
Step 6: Replace Moodle URLs
Access your MoodleBox through your browser using the new address
http://learn.example.com/ and use the URL replacement tool at
http://learn.example.com/admin/tool/replace/index.php to replace URLs in the Moodle database.
Step 7: Replace SSL certificates (optional)
If you want to use HTTPS, you’ll have to get your own SSL certificates, as those provided by the MoodleBox won’t work with your custom domain name learn.example.com. Don’t forget to change the URL too.