Moodle VPL Server Setup
--D. Thiebaut (talk) 16:15, 10 June 2014 (EDT)
These are rough notes detailing the installation of two virtual Ubuntu servers on a Hardware Ubuntu 14.04 server. The notes are intended to provide general guidelines, and not precise step-by-step instructions. The main Ubuntu server runs two virtual servers, one a LAMP server that hosts Moodle, the other a regular Ubuntu server used for the jail-system required by the Virtual Programming Lab module of Moodle (VPL).
Versions
- Ubuntu 14.04
- Moodle Version 2.7 + (Build: 20140529)
- Virtual Programming Lab (VPL) Version 3.0.1. VPL is a Moodle module that can be found on this page.
Hardware Server Setup
Motherboard/Processor/Video
- ASUS M5A97 R2.0 AM3+ AMD 970 SATA 6Gb/s USB 3.0 ATX AMD Motherboard ($84.99)
- Corsair Vengeance 16GB (2x8GB) DDR3 1600 MHz (PC3 12800) Desktop Memory (CMZ16GX3M2A1600C10) ($120.22)
- AMD FX-8150 8-Core Black Edition Processor Socket AM3+ FD8150FRGUBOX ($175)
Hard Server Setup
- setup Server hadoop0 (Legacy name, call yours with your favorite name) as Ubuntu 14.04 server with LAMP + OpenSSH services.
- Install as root some required packages
apt-get install gparted xorg gnome-core gnome-system-tools gnome-app-install apt-get install ddclient (optional, but will allow you to ssh to your server using a domain name rather than an Ip address) apt-get install emacs24 apt-get install git apt-get install phpmyadmin
- Install virtualbox: follow directions from http://www.n00bsonubuntu.net/content/install-virtualbox-ubuntu-14-04/:
wget http://releases.ubuntu.com/trusty/ubuntu-14.04-server-amd64.iso wget -q http://download.virtualbox.org/virtualbox/debian/oracle_vbox.asc -O- | sudo apt-key add - sudo apt-get update && sudo apt-get install virtualbox-4.3 -y sudo apt-get selfupdate sudo apt-get update wget http://download.virtualbox.org/virtualbox/4.3.12/virtualbox-4.3_4.3.12-93733~Ubuntu~raring_amd64.deb wget -q http://download.virtualbox.org/virtualbox/debian/oracle_vbox.asc -O- | sudo apt-key add - sudo apt-get update && sudo apt-get install virtualbox-4.3 -y wget http://download.virtualbox.org/virtualbox/4.3.10/Oracle_VM_VirtualBox_Extension_Pack-4.3.10-93012.vbox-extpack adduser yourLoginName vboxusers
- copy Oracle_VM_VirtualBox_Extension_Pack-4.3.10-93012.vbox-extpack to you home directory and double-click on it to install it.
mv Oracle_VM_VirtualBox_Extension_Pack-4.3.10-93012.vbox-extpack /tmp
- Put Ubuntu Server iso in dvd
- Start virtualbox on your server
Moodle Server Setup
- create a new VM
- name it moodleServer (or whatever name you want to name it)
- 4 GB Ram
- 20 GB Hard disk
- Bridged NAT network
- user yourUserName/yourPassword
- set the root password for mysql
- request LAMP and Open-SSH services
- apt-get some applications when first-time in the system:
- ddclient (same comment as before. Useful if your Ips change from time to time)
- phpmyadmin
- emacs24
- git
- For installation, follow reference: http://docs.moodle.org/23/en/Installing_Moodle
- setup php curl:
sudo apt-get install curl libcurl3 libcurl3-dev php5-curl
- get and install moodle
sudo -i git clone -b MOODLE_27_STABLE git://git.moodle.org/moodle.git cd /var/www/html mv /root/moodle . chown -R root moodle chmod -R 0755 moodle/ find moodle -type f -exec chmod 0644 {} \;
- setup moodledata directory:
sudo -i mkdir /usr/local/moodledata chmod 777 /usr/local/moodledata
- Mysql
Database on moodleServer: moodle, collation utf8_general_ci user: mooduser, localhost, password typeYourPasswordHere
- Setup Moodle (follow directions from http://docs.moodle.org/23/en/Installing_Moodle
admin account: admin admin password: typeYourPasswordHere type value, press Enter to use default value (en) : ------------------------------------------------------------------------------- == Data directories permission == type value, press Enter to use default value (2777) : ------------------------------------------------------------------------------- == Web address == type value : http://moodleServer.dyndns.org/moodle ------------------------------------------------------------------------------- == Data directory == type value, press Enter to use default value (/var/www/moodledata) : /usr/local/moodledata ------------------------------------------------------------------------------- == Choose database driver == mysqli mariadb type value, press Enter to use default value (mysqli) : ------------------------------------------------------------------------------- == Database host == type value, press Enter to use default value (localhost) : ------------------------------------------------------------------------------- == Database name == type value, press Enter to use default value (moodle) : ------------------------------------------------------------------------------- == Tables prefix == type value, press Enter to use default value (mdl_) : ------------------------------------------------------------------------------- == Database port == type value, press Enter to use default value () : ------------------------------------------------------------------------------- == Unix socket == type value, press Enter to use default value () : ------------------------------------------------------------------------------- == Database user == type value, press Enter to use default value (root) : mooduser ------------------------------------------------------------------------------- == Database password == type value
- typeYourPasswordHere
------------------------------------------------------------------------------- == Full site name == type value : CompSci Moodle ------------------------------------------------------------------------------- == Short name for site (eg single word) == type value : CSMoodle ------------------------------------------------------------------------------- == Admin account username == type value, press Enter to use default value (admin) : admin ------------------------------------------------------------------------------- == New admin user password == type value : typePasswordHere ------------------------------------------------------------------------------- == Copyright notice == Moodle - Modular Object-Oriented Dynamic Learning Environment Copyright (C) 1999 onwards Martin Dougiamas (http://moodle.com) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Moodle License information page for full details: http://docs.moodle.org/dev/License Have you read these conditions and understood them? type y (means yes) or n (means no) : y
Install/Setup VPL Module
- VPL Module
- Download from http://vpl.dis.ulpgc.es/index.php/en/download
- sudo unzip module in /var/www/moodle/mod
- Go to notification in Admin Menu of moodle, and click on update database. ==> Success!
Install VPL Jail System
- Follow the directions at http://vpl.dis.ulpgc.es/index.php/en/documentation/75-how-to-install-vpl-jail-system
sudo, go to ~/Downloads and download vpl_jail_system-latest.tar.gz sudo -i cd /Users/dominique/Downloads wget vpl_jail_system-latest.tar.gz tar -xzvf vpl_jail_system-latest.tar.gz cd vpl_jail_system-2.0 ./install-vpl-sh ( yes to certificate) ( yes to development software) ( no to extra development software) ( no to remove apache2) Got some errors, ServerName and not able to bind... Turns out VPL listens to port 80 and 443, which conflicts with Apache2. No wonder it asks if apache should be removed during installation. I guess it's because VPL could be installed on a server that is not a LAMP server... So, edited several files: /etc/hosts: 127.0.0.1 localhost 127.0.1.1 moodleServer
- The following lines are desirable for IPv6 capable hosts
- 1 localhost ip6-localhost ip6-loopback
ff02::1 ip6-allnodes ff02::2 ip6-allrouters
/etc/apache2/apache2.conf (add at end of file): ServerName localhost
/etc/apache2/ports.conf
- If you just change the port or add more ports here, you will likely also
- have to change the VirtualHost statement in
- /etc/apache2/sites-enabled/000-default.conf
Listen 80 443
reboot ==> now apache works, and can loggin to Moodle [edit]June 4 2014
figured out that VPL jail should be its own virtual server! [edit]Create new Virtual Server: VPLServer
created new Ubuntu 14.04 virtual server on Hadoop0 VPLServer dominique/sevenseas... bridged Network install emacs install VPL server
wget http://vpl.dis.ulpgc.es/releases/vpl_jail_system-2.0.1.tar.gz
select no for wildcard certificates install ddclient (current IP=131.229.102.20) setup vplserver.dyndns.org as name of machine reboot start/stop/start vpl (won't work), reboot and start vpl, and it works!
sudo reboot sudo service vpl-jail-system start
Test. Plug these URL in browser and get OK message in blank page: http://vplserver.dyndns.org/OK https://vplserver.dyndns.org/OK [edit]Update Moodle to use VPLServer
Switch to moodleServer where Moodle is installed login as admin (in the mood password) go to http://moodleServer.dyndns.org/moodle/admin/search.php?query=vpl Set Execution Server List to http://vplserver.dyndns.org
MoodleVPLServerLine.png
[edit]Error: PHP needs XMLRPC
To test if Moodle sees the VPL server, go to a VPL activity created in a course, and select it. Open it There should be a VPL Administration menu in Moodle opening up. Pick Advanced Settings and Check execution servers to see what happens. I first got PHP needs CMLRPC error, even for the default VPL server set in Spain. Solution: install php5-xmlrpc on moodleServer and vplserver sudo apt-get install php5-xmlrpc
Then repeat the test and see the result of Check execution servers in Moodle:
MoodleVPLServerChecked.png
[edit]June 5, 2014
[edit]Backup
create a backup of the /home/dominique with deja-dup. Just start the "Backup" black vault app in the favorites. output folder is /media/1_5TB/Backups/deja-dup/ Backup performed every day Used Clonezilla to make a duplicate of 1TB boot disk. Now second 1TB contains exact copy and can be booted from. Disks labeled inside the case (Boot/Backup). The backup disk is off line and off power for now. The boot disk has ID WD-WCAU4C220157 The backup disk has ID WD-WCAU4C208949 Used the GUI, but can run this command from Clonezilla shell to go faster:
/usr/sbin/ocs-onthefly -g auto -e1 auto -e2 -j2 -r -f sdb -t sdc
[edit]