Posted under » PHP on 17 Apr 2025
I have tried installing Moodle using docker but I find it too 'restrictive' or complicated.
So let's try do it the 'normal' way. The normal way requires that your OS meet the requirements. For Moodle version 5, they are
Of course you need a web server like Apache too. Set up as usual ie. prepare a blank mysql database. On first access, you will be faced with install.php and you need to fill in the data.
What is new is that it requires you to give a folder name called 'moodledata' which I assume where the static files are stored. You may have to create the folder manualy if the www-data fails.
You will be asked to write protect a newly created file. 'config.php' which I recommend that you create a backup copy. The config contains important data such as MySQL config and www host name.
My setup is a reverse proxy getting a source from a web server on port 8080. If you set the reverse proxy as `On', make sure you comment out your port 8080 server and put the proxy server on the config.php like so
# $CFG->wwwroot = 'http://poodle.edu.sg:8080'; $CFG->wwwroot = 'http://moodle.edu.sg';
There will be a time when you have to run in production environment and SSL or if you are using a proxy or load balancer, depending on your setup you may need to set $CFG->sslproxy to 1, and not use SSL on the Moodle server. Then the load balancer or proxy server can communicate directly to your Moodle site, but serve to the clients over SSL.
$CFG->wwwroot = 'https://moodle.edu.sg'; $CFG->sslproxy = 1;
If there is an update version of moodle, download the zip file and upload to server. Unzip it to a new folder.
Copy over the changed files to the new server eg. config.php. When you run the first check the min requirements and if pass, you can proceed to update the database file.