3. Installation

This document describes how to install the VPL-Jail-System. For more details about VPL, visit the VPL home page or the VPL plugin page at Moodle.

3.1. Selecting the hardware

the recommended option is using a dedicated machine. If you can not use a dedicated computer try using a Virtual Machine in a shared one, e.g. using VirtualBox. This approach will provide isolation and limit the resources used by the service. If you decide to install the service in a machine with other uses, beware that the use of resources by the VPL-Jail-System may decrease the performance of the other services. Although no security breach has been reported, the nature of the service (execute external code) carry an intrinsic threat.

3.2. Preparing the system

Install a Linux O.S. as clean as possible. At least install the “en_US.UTF-8” locale and all other locales you want. Notice that the VPL plugin will try to use the locale in use on the moodle, but will use “en_US.UTF-8” as fall back locale if setting the Moodle one fails.

If you have enough resources, you can install a GUI interface. Stop any service that you don’t need as the web server, ssh server, etc. If the O.S. has a firewall, you must configure it (or stop it) to give access to the only two ports needed by the VPL-Jail-System. If you use automatic updates, you must restart the VPL-Jail-System to take into account the update. You can use cron to automate this process.

3.3. Getting VPL-Jail-System

VPL-Jail-System is distributed only as source files. You must get the source package from https://vpl.dis.ulpgc.es/, e.g., using

wget https://vpl.dis.ulpgc.es/releases/vpl-jail-system-[version].tar.gz

or from the GitHub repository, generating the package with

sudo apt-get install g++ make autotools-dev autoconf
aclocal
autoheader
autoconf
automake
./configure
make distcheck

This will generate a package file named vpl-jail-system-[version].tar.gz

3.4. Running the installer

After getting the package, you must decompress it and run the installer.

tar xvf vpl-jail-system-[version].tar.gz
cd vpl-jail-system-[version]
./install-vpl-sh

Note

The “./install-vpl-sh” script must be run as root.

Follow the instructions and wait for the necessary downloads. The installation script will try to install the development software commonly used.

The installer will ask you about:

  • If you want to use Let’s Encrypt, creates a self-signed SSL certificate or use your own certificates.
  • When updating, if you want to replace the configuration file with a fresh one.
  • If you want to install different compilers and interpreters.

Note

If you have your own SSL certificates for the HTTPS and WSS communications, you must copy your public certificate to the “/etc/vpl/cert.pem” file and the private key to the “/etc/vpl/key.pem” file. You also can change the configuration file to tell the system the location of your certificates. If your Certification Authority (CA) is not a root CA you may need to add the intermediate CA certificates to the “cert.pem” file. You may restart the service to apply the modifications.

3.5. Adding the jail/execution server to the VPL plugin at Moodle

The URL of the service is https://yourservername:SECURE_PORT/URLPATH or http://yourservername:PORT/URLPATH

:SECURE_PORT and :PORT can be omitted if using the standard ports numbers.

You can use the jail server URL in the VPL plugin configuration (requiere administration rigths) and, in the local execution server settings of a VPL activity.

3.6. Updating VPL-Jail-System

If you want to update the VPL-Jail-System to a new version, follow the same steps that the first installation. The installer will update the current version to the new one.

3.7. Updating the software in the jail

After installing or updating packages or files in the host system, you must restart the service with

systemctl restart vpl-jail-system

to make available the changes in the jail. If you don’t want to restart the service, you can drop the kernel caches to do the overlayFS file system aware of the changes. To drop the kernel caches run as root

sync; echo 7 > /proc/sys/vm/dropcaches

3.8. Removing VPL-Jail-System

Run uninstall-sh of the current version.