Server Installation Guide
#
Setting up the ServerThis tutorial will walk you through the steps to set up an instance of the ISLE server program to serve your students.
#
PrerequisitesRunning the server requires the following software tools:
The ISLE server should run on a POSIX-based system (preferably a Linux distribution). For this guide, we assume that you are on the latest Ubuntu LTS release. The steps will be similar for other distributions (e.g., Debian or CentOS), but might need to be slightly adapted.
#
Installing Node.jsWe will use nvm
(“Node.js Version Manager”) to install Node.js, the JavaScript runtime used by the ISLE server. nvm
allows you to install the newest versions of Node.js (which are not currently available through apt
) and manage multiple installations at once. Following the official nvm
documentation, we can use curl
or wget
to download and run a script to install nvm
in your home directory (specifically to ~/.nvm
):
To use nvm
right away, you need to either log out and in again or source the ~/.profile
file again:
To ensure that nvm
is up and running, we can print its version
We can now install the latest LTS release of Node.js via
(Tip: running nvm ls-remote
will print a list of all available versions)
This will also install npm
, the official package manager used by Node.js to install external dependencies.
#
Installing MongoDBLet's first run the following command to update the packages list to ensure that you have the most recent version of the listings:
To install MongoDB, we can use apt
since Ubuntu's package repositories include an up-to-date version of MongoDB:
After installation, the database server should automatically be started. To check, run
#
Installing gitYou can install Git by running
Afterwards, you can clone the git repository to acquire the source code:
After changing into the new directory
we can install its external dependencies via
#
ConfigurationYou will now need to make a few changes to the contents of the isle-server
directory. For example, you might have noticed that the files in the credentials
folder have been encrypted (or rather transcrypted) to protect sensitive information. Please get in touch in case you would like to get access to our configuration.
Otherwise, you want to override the JSON files in this folder.
By default, we use Mailgun to send email notifications. The mailgun.json file should look as follows:
where <user>
and <pass>
are your Mailgun credentials.
The tokens.json file is a JSON file with two keys:
The <instructor_key>
should be replaced with a chosen key that can be handed to faculty to obtain instructor access to the server on the isle-dashboard. The <passphrase>
can be any confidential string. It is used to sign the JSON web tokens used for user authentication.
Finally, you want to change the etc/config.json
file. It looks like this:
You should change the server
field to the server address from where your requests will be processed. Since ISLE requires HTTPS, you will need a SSL certificate and key. The paths for the certificate and key should be entered into the certificate
and key
fields, respectively. You will need to receive these files from a certificate authority. Let's Encrypt is a popular certificate authority which generates certificates for free. You can leave the mongodb
field as-is unless you desire to host your MongoDB instance on a separate database server than your ISLE application server.
#
Setting up nginxWe suggest to use nginx as the web server for the ISLE server program. You can obtain a recent version of the software via apt
:
The isle-server
repository contains server configuration files for use with nginx in the /etc/nginx sub-directory. To use the contents of this configuration directory in place of the existing nginx confinpm install -g npmguration directory, you can copy the contents of the configuration directory to /etc
.
Warning: you might want to backup an existing /etc/nginx
directory first via sudo mv /etc/nginx /etc/nginx-backup
.
After editing the ISLE server configuration located in sites-available
to point to the correct certificate locations and changing the server name, create a symlink to enable it:
Finally, restart nginx.
#
Serving Compressed FilesTo reduce the amount of data sent over the wire, we enable the lossless brotli compression algorithm, a successor to gzip. The latter is newer and not supported in nginx by default. To install brotli, run the following:
To enable the Brotli module, we uncomment the following commands in /etc/nginx/nginx.conf
:
We can then add Brotli compression by adding the following:
#
Start the ISLE server programNavigate again into the isle-server directory. To start the server program in the background, we advise to use a program like pm2 to ensure that the process runs continuously. As sudo
, install it with the command
With pm2
, we can start the server as follows:
#
Automatically restart on rebootTo restart the ISLE server on system reboot, initialize the pm2
startup script via:
You can save the currently running pm2
processes to the startup script via
The ISLE server should now be up and running and accept requests!
Afterwards, you will want to install the isle-dashboard on your remote server and locally install the isle-editor to author lessons.