-
Notifications
You must be signed in to change notification settings - Fork 64
How to create a Moodle instance and join it to your ViSH instance
The steps are easy to follow, you need a Moodle instance and if you already have one, go to step 2 directly. Steps:
To install Moodle we have used a server with:
- Ubuntu 16.04 server 64bits (also works with previous editions)
- 2GB RAM (this will depend on the number of concurrent users you expect
- 2GHz dual core
Follow the official installation guide, depending on the version of Moodle you want to install.
We recommend Moodle 2.9 https://docs.moodle.org/29/en/Installing_Moodle
This section presents the steps that we had to apply following the official instalation guide.
The instalation guide gives a lot of options for the server software (apache, Nginx, IIS, ...). We have chosen Apache2, postgresql, php.
These are the commands to install this software in Ubuntu 16.04 server:
sudo apt-get update
sudo apt-get install apache2 php postgresql postgresql-contrib
sudo apt-get install libapache2-mod-php php-pgsql php-gd php-curl graphviz aspell php-pspell php-intl php-xmlrpc php-ldap
Edit php.ini (usually located at /etc/php/7.0/apache2/php.ini), and change the following:
post_max_size = 20M
upload_max_filesize = 20M
At this point you should be able to see the apache default page if you go with a browser to the IP or hostname of your server.
Download moodle from https://download.moodle.org/releases/latest/ or https://download.moodle.org/releases/supported/
Copy the downloaded moodle package to your server, so form your local machine exec something like (command will vary depending on your Moodle version and server IP):
scp moodle-latest-33.tgz root@YOURSERVERIP:.
In your server uncompress the package. This will create a "moodle" directory:
tar -xvzf moodle-latest-33.tgz
Now it is time to configure postgres
su - postgres
psql
\password postgres
ENTER YOUR PASSWORD
CREATE USER moodleuser WITH PASSWORD 'yourpassword';
CREATE DATABASE moodle WITH OWNER moodleuser;
Now create the moodledata directory:
mkdir /path/to/moodledata
chmod 0777 /path/to/moodledata
Finally start Moodle instalation:
cd /path/to/moodle
sudo chown www-data .
cd admin/cli
sudo -u www-data /usr/bin/php install.php
In this last command you will be asked a lot of questions, most of them you only have to hit enter, except for the database configuration, postgres uses port 5432, choose localhost for the database server. User and password the one you have chosen (usually moodledata and your password).
And prepare the files with the adequate permissions:
cd /path/to/moodle
chown -R root .
chmod -R 0755 .
find . -type f -exec chmod 0644 {} \;
chown -R www-data mod
chmod -R u+w mod
chown -R www-data theme
chmod -R u+w theme
If your apache server will only be serving this moodle site you can remove the apache default file /var/www/index.html and move your moodle folder content to /var/www if you are in an apache server that server multiple pages, you will have to add a new virtual host (help)
At this point you should be able to see your moodle default home page if you visit http://YOURSERVERIP
Moodle has a lot of options to configure. You can read a lot of documentation at http://moodle.org to properly customize your site.
For example you will have to choose a theme or install one. We recommend the essential theme that is based in Bootstrap Link
In this section we expose the minimum configuration to start working with your Moodle instance.
-
Administration > Site administration > Plugins > Message Outputs > Email: Set your smtp server and authentication if required (so your Moodle site can send emails). The support contact for your site is also set on this page.
-
Administration > Site administration > Server > HTTP: If you are behind a firewall you may need to set your proxy credentials in the 'Web proxy' section.
-
Administration > Site administration > Location > Update timezones: Run this to make sure your timezone information is up to date. (more info Location)
-
Configure Cron: Moodle's background tasks (e.g. sending out forum emails and performing course backups) are performed by a script which you can set to execute at specific times of the day. This is known as a cron script. Please refer to the Cron instructions.
-
Check mail works: Create a test user with a valid email address and send them a message. Do they receive an email copy of the message? If not, check the settings in Settings > Site administration > Plugins > Message outputs > Email. Don't be tempted to skip this step (clue: email is used to recover lost passwords, including the administrator password when you forget it!)
After this Installation is complete :)
To join a Moodle instance to your ViSH instance you will have to properly configure your application_config.yml.
For this you have to add "Course" to models[available]
And add the option moodle_url with the URL of your moodle instance.
If you need extra help please read this page You can see an example of configuration of this file in application_config.yml.example in the repository