Difference between revisions of "Moodle VPL Server Setup"

From dftwiki3
Jump to: navigation, search
(Moodle Server Setup)
 
(7 intermediate revisions by the same user not shown)
Line 8: Line 8:
 
[[Image:MoodleVPLLogo.png]]
 
[[Image:MoodleVPLLogo.png]]
 
|}
 
|}
 +
<br />
 +
----
 +
<center>[[Tutorials#Moodle_Virtual-Programming-Lab_.28VPL.29|Moodle VPL Tutorials]]</center>
 +
----
 +
<br />
 
<br />
 
<br />
 
<bluebox>
 
<bluebox>
Line 72: Line 77:
 
** emacs24
 
** emacs24
 
** git
 
** git
 +
** php5-xmlrpc
 +
 
* For installation, follow reference: http://docs.moodle.org/23/en/Installing_Moodle
 
* For installation, follow reference: http://docs.moodle.org/23/en/Installing_Moodle
 
* setup php curl:
 
* setup php curl:
Line 109: Line 116:
 
  == Web address ==
 
  == Web address ==
 
  type value
 
  type value
  : http://moodleServer.dyndns.org/moodle
+
  : http://moodleServer.''your.Domain.Name''/moodle
 
  -------------------------------------------------------------------------------  
 
  -------------------------------------------------------------------------------  
 
  == Data directory ==
 
  == Data directory ==
Line 147: Line 154:
 
  == Database password ==
 
  == Database password ==
 
  type value
 
  type value
: ''typeYourPasswordHere''
+
: ''typeYourPasswordHere''
 
  -------------------------------------------------------------------------------
 
  -------------------------------------------------------------------------------
 
  == Full site name ==
 
  == Full site name ==
Line 188: Line 195:
 
===Install/Setup VPL Module===
 
===Install/Setup VPL Module===
 
<br />
 
<br />
* 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
Line 196: Line 202:
 
=Install VPL Jail System=
 
=Install VPL Jail System=
 
<br />
 
<br />
* Follow the directions at http://vpl.dis.ulpgc.es/index.php/en/documentation/75-how-to-install-vpl-jail-system
+
* On main server create a '''second VM''' as Ubuntu Server 14.04
sudo, go to ~/Downloads and download vpl_jail_system-latest.tar.gz
+
* Name it vplServer
sudo -i
+
* Only install OpenSSH services on it.
cd /Users/dominique/Downloads
+
* select '''bridged network''' for network
wget vpl_jail_system-latest.tar.gz
+
* apt-get several packages
tar -xzvf vpl_jail_system-latest.tar.gz
+
cd vpl_jail_system-2.0
+
apt-get install emacs24
./install-vpl-sh
+
apt-get install ntp
( yes to certificate)
+
apt-get install php5-xmlrpc
( yes to development software)
+
( no to extra development software)
+
* install VPL jail server
( 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
 
   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)
+
* select no for wildcard certificates
setup vplserver.dyndns.org as name of machine
+
* install ddclient (current IP=131.229.102.20)
reboot
+
* setup vplserver.''your.domain.name'' as name of machine
start/stop/start vpl (won't work), reboot and start vpl, and it works!
+
* reboot
  sudo reboot
+
  sudo service vpl-jail-system start
+
  sudo reboot
Test. Plug these URL in browser and get OK message in blank page:
+
http://vplserver.dyndns.org/OK
+
* then restart vpl-jail system
https://vplserver.dyndns.org/OK
+
[edit]Update Moodle to use VPLServer
+
sudo service vpl-jail-system start
 +
 +
* Test. Plug these URL in browser and get OK message in blank page:
 +
http://vplserver.''your.domain.name''/OK
 +
https://vplserver.''your.domain.name''/OK
  
Switch to moodleServer where Moodle is installed
+
=Make Moodle Server Aware of VPL Server=
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
 
  
 +
* Switch to moodleServer where Moodle is installed
 +
* login as admin and go to http://moodleServer.''your.domain.name''/moodle/admin/search.php?query=vpl
 +
* Set Execution Server List to http://vplserver.''your.domain.name''
  
[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.
+
This concludes the Moodle/VPL server setup.
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:
+
<br />
 
+
<br />
MoodleVPLServerChecked.png
+
<br />
 
+
<br />
[edit]June 5, 2014
+
<br />
 
+
<br />
[edit]Backup
+
<br />
 
+
<br />
create a backup of the /home/dominique with deja-dup. Just start the "Backup" black vault app in the favorites.
+
<br />
output folder is /media/1_5TB/Backups/deja-dup/
+
<br />
Backup performed every day
+
<br />
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.
+
<br />
The boot disk has ID WD-WCAU4C220157
+
<br />
The backup disk has ID WD-WCAU4C208949
+
<br />
Used the GUI, but can run this command from Clonezilla shell to go faster:
+
<br />
  /usr/sbin/ocs-onthefly -g auto -e1 auto -e2 -j2 -r -f sdb -t sdc
+
[[Category:Tutorials]][[Category:Moodle]][[Category:VPL]][[Category:Python]]
[edit]
 

Latest revision as of 20:43, 12 June 2014

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



MoodleVPLLogo.png



Moodle VPL Tutorials



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)


Main-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 as a Ubuntu 14.04 server
  • 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
    • php5-xmlrpc
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.your.Domain.Name/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


  • On main server create a second VM as Ubuntu Server 14.04
  • Name it vplServer
  • Only install OpenSSH services on it.
  • select bridged network for network
  • apt-get several packages
apt-get install emacs24
apt-get install ntp
apt-get install php5-xmlrpc

  • install VPL jail 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.your.domain.name as name of machine
  • reboot
  sudo reboot

  • then restart vpl-jail system
sudo service vpl-jail-system start

  • Test. Plug these URL in browser and get OK message in blank page:
http://vplserver.your.domain.name/OK
https://vplserver.your.domain.name/OK

Make Moodle Server Aware of VPL Server

  • Switch to moodleServer where Moodle is installed
  • login as admin and go to http://moodleServer.your.domain.name/moodle/admin/search.php?query=vpl
  • Set Execution Server List to http://vplserver.your.domain.name


This concludes the Moodle/VPL server setup.