Difference between revisions of "Moodle VPL Server Setup"

From dftwiki3
Jump to: navigation, search
(Motherboard/Processor/Video)
(Server Software Setup)
Line 22: Line 22:
 
<br />
 
<br />
  
=Server Software Setup=
+
=Hard Server Setup=
 
* setup Server '''hadoop0''' (Legacy name, call yours with your favorite name) as Ubuntu 14.04 server with '''LAMP''' + '''OpenSSH''' services.
 
* 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
 
* Install as root some required packages
Line 43: Line 43:
 
   sudo apt-get update && sudo apt-get install virtualbox-4.3 -y
 
   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
 
   wget http://download.virtualbox.org/virtualbox/4.3.10/Oracle_VM_VirtualBox_Extension_Pack-4.3.10-93012.vbox-extpack
   adduser ''yourName'' vboxusers
+
   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.
 
* copy Oracle_VM_VirtualBox_Extension_Pack-4.3.10-93012.vbox-extpack to you home directory and double-click on it to install it.
Line 50: Line 50:
 
* Put Ubuntu Server iso in dvd
 
* Put Ubuntu Server iso in dvd
 
* Start virtualbox on your server
 
* Start virtualbox on your server
 +
<br />
 +
==Moodle Server Setup==
 +
<br />
 
* create a new VM
 
* create a new VM
* name moodleServer ''(or whatever name you want to name it)''
+
* name it moodleServer ''(or whatever name you want to name it)''
 
* 4 GB Ram
 
* 4 GB Ram
 
* 20 GB Hard disk
 
* 20 GB Hard disk
Line 59: Line 62:
 
* request LAMP and Open-SSH services
 
* request LAMP and Open-SSH services
 
* apt-get some applications when first-time in the system:
 
* apt-get some applications when first-time in the system:
** ddclient: name it with your favorite name
+
** ddclient ''(same comment as before.  Useful if your Ips change from time to time)''
 
** phpmyadmin
 
** phpmyadmin
 
** emacs24
 
** emacs24
 
** git
 
** git
 
+
* For installation, follow reference: http://docs.moodle.org/23/en/Installing_Moodle
==Install/Setup Moodle==
 
 
 
* Reference: http://docs.moodle.org/23/en/Installing_Moodle
 
 
* setup php curl:
 
* setup php curl:
 
   
 
   
Line 88: Line 88:
  
 
* Mysql
 
* Mysql
Database on moodleServer: moodle, collation utf8_general_ci
+
Database on moodleServer: moodle, collation utf8_general_ci
user: mooduser, localhost, password 1ntheCSm00dle
+
user: mooduser, localhost, password ''typeYourPasswordHere''
Setup Moodle (follow directions from http://docs.moodle.org/23/en/Installing_Moodle
+
 
admin account: admin
+
* Setup Moodle (follow directions from http://docs.moodle.org/23/en/Installing_Moodle
admin password: 1ntheCSm00dle
+
admin account: admin
type value, press Enter to use default value (en)
+
admin password: ''typeYourPasswordHere''
:  
+
type value, press Enter to use default value (en)
-------------------------------------------------------------------------------
+
:  
== Data directories permission ==
+
-------------------------------------------------------------------------------
type value, press Enter to use default value (2777)
+
== Data directories permission ==
:  
+
type value, press Enter to use default value (2777)
-------------------------------------------------------------------------------
+
:  
== Web address ==
+
-------------------------------------------------------------------------------
type value
+
== Web address ==
: http://moodleServer.dyndns.org/moodle
+
type value
-------------------------------------------------------------------------------
+
: http://moodleServer.dyndns.org/moodle
== Data directory ==
+
-------------------------------------------------------------------------------  
type value, press Enter to use default value (/var/www/moodledata)
+
== Data directory ==
: /usr/local/moodledata
+
type value, press Enter to use default value (/var/www/moodledata)
-------------------------------------------------------------------------------
+
: /usr/local/moodledata
== Choose database driver ==
+
-------------------------------------------------------------------------------
 +
== Choose database driver ==
 
  mysqli  
 
  mysqli  
 
  mariadb  
 
  mariadb  
type value, press Enter to use default value (mysqli)
+
type value, press Enter to use default value (mysqli)
:  
+
:  
-------------------------------------------------------------------------------
+
-------------------------------------------------------------------------------
== Database host ==
+
== Database host ==
type value, press Enter to use default value (localhost)
+
type value, press Enter to use default value (localhost)
:  
+
:  
-------------------------------------------------------------------------------
+
-------------------------------------------------------------------------------
== Database name ==
+
== Database name ==
type value, press Enter to use default value (moodle)
+
type value, press Enter to use default value (moodle)
:  
+
:  
-------------------------------------------------------------------------------
+
-------------------------------------------------------------------------------
== Tables prefix ==
+
== Tables prefix ==
type value, press Enter to use default value (mdl_)
+
type value, press Enter to use default value (mdl_)
:  
+
:  
-------------------------------------------------------------------------------
+
-------------------------------------------------------------------------------
== Database port ==
+
== Database port ==
type value, press Enter to use default value ()
+
type value, press Enter to use default value ()
:  
+
:  
-------------------------------------------------------------------------------
+
-------------------------------------------------------------------------------
== Unix socket ==
+
== Unix socket ==
type value, press Enter to use default value ()
+
type value, press Enter to use default value ()
:  
+
:  
-------------------------------------------------------------------------------
+
-------------------------------------------------------------------------------
== Database user ==
+
== Database user ==
type value, press Enter to use default value (root)
+
type value, press Enter to use default value (root)
: mooduser
+
: mooduser
-------------------------------------------------------------------------------
+
-------------------------------------------------------------------------------
== Database password ==
+
== Database password ==
type value
+
type value
: 1ntheCSm00dle
+
: ''typeYourPasswordHere''
-------------------------------------------------------------------------------
+
-------------------------------------------------------------------------------
== Full site name ==
+
== Full site name ==
type value
+
type value
: CompSci Moodle
+
: CompSci Moodle
-------------------------------------------------------------------------------
+
-------------------------------------------------------------------------------
== Short name for site (eg single word) ==
+
== Short name for site (eg single word) ==
type value
+
type value
: CSMoodle
+
: CSMoodle
-------------------------------------------------------------------------------
+
-------------------------------------------------------------------------------
== Admin account username ==
+
== Admin account username ==
type value, press Enter to use default value (admin)
+
type value, press Enter to use default value (admin)
: admin
+
: admin
-------------------------------------------------------------------------------
+
-------------------------------------------------------------------------------
== New admin user password ==
+
== New admin user password ==
type value
+
type value
: 1ntheCSm00dle
+
: ''typePasswordHere''
-------------------------------------------------------------------------------
+
-------------------------------------------------------------------------------
== Copyright notice ==
+
== Copyright notice ==
Moodle  - Modular Object-Oriented Dynamic Learning Environment
+
Moodle  - Modular Object-Oriented Dynamic Learning Environment
Copyright (C) 1999 onwards Martin Dougiamas (http://moodle.com)
+
Copyright (C) 1999 onwards Martin Dougiamas (http://moodle.com)
 
+
This program is free software: you can redistribute it and/or modify
+
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
+
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
+
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
+
(at your option) any later version.
 
+
This program is distributed in the hope that it will be useful,
+
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
+
See the Moodle License information page for full details:
+
See the Moodle License information page for full details:
http://docs.moodle.org/dev/License
+
http://docs.moodle.org/dev/License
 
+
Have you read these conditions and understood them?
+
Have you read these conditions and understood them?
type y (means yes) or n (means no)
+
type y (means yes) or n (means no)
: y
+
: y
 
+
 
+
<br />
[edit]Install/Setup VPL Module
+
===Install/Setup VPL Module===
 
+
<br />
[edit]VPL Module
+
* VPL Module
Download from http://vpl.dis.ulpgc.es/index.php/en/download
+
* Download from http://vpl.dis.ulpgc.es/index.php/en/download
sudo unzip module in /var/www/moodle/mod
+
* sudo unzip module in /var/www/moodle/mod
Go to notification in Admin Menu of moodle, and click on update database. ==> Success!
+
* Go to notification in Admin Menu of moodle, and click on update database. ==> Success!
[edit]VPL Jail System
+
<br />
Follow the directions at http://vpl.dis.ulpgc.es/index.php/en/documentation/75-how-to-install-vpl-jail-system
+
=Install VPL Jail System=
 +
<br />
 +
* 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, go to ~/Downloads and download vpl_jail_system-latest.tar.gz
 
sudo -i
 
sudo -i

Revision as of 16:22, 10 June 2014

--D. Thiebaut (talk) 16:15, 10 June 2014 (EDT)



MoodleVPLLogo.png


This tutorial illustrates how to setup a Ubuntu server for Moodle and VPL. 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 VPL.


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

 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
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



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

  1. 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

  1. If you just change the port or add more ports here, you will likely also
  2. have to change the VirtualHost statement in
  3. /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]