Server configuration
We'll host Minerva using a server based on Ubuntu, we strongly suggest to use the latest LTS Server version.
Step 1 - updates and software installation
Open a shell and execute the following commands that will update and upgrade the system.
sudo apt-get update && sudo apt-get upgrade
After you completed the update process, install the following packages.
sudo apt-get install -y python3 python3-pip python3-venv unzip
We assume you were running the previous commands as root, please create a new user called 'minerva' as running Flask web apps as root is not recommended. To do that run the following command and follow the instructions
adduser minerva
Then add the previously created user to the 'sudo' group,
usermod -aG sudo minerva
Now log out and proceed with the user minerva.
We'll use Waitress as web server.
Step 2 - Creating the Minerva environment
First we need to create the directory for Minerva:
mkdir /mnt/minerva && cd /mnt/minerva
Then we download the latest version of it from GitHub (you need to update the URL according to the current version)
wget https://github.com/paghos/poleis-minerva/latest.zip
And we unzip it
unzip latest.zip
Before proceeding, remove the downloaded zip
rm -rf latest.zip
Check if the files were extracted
ls
If everything looks like this, you're good to go!
app.py assets creadb.py creaautoritagiudiziarie.py instance minervaconf.py requirements.txt static templates
Configure Minerva as described in this guide
Create the virtual environment
python3 -m venv venv
And activate it
source venv/bin/activate
Install all the necessaries libraries for Minerva
pip install /mnt/minerva/requirements.txt
Step 3 - Test the functionality
Before continuing we want to check if what we have done so far works. To do that we'll run Minerva to check if everything works.
waitress-serve --host 0.0.0.0 app:app
Then, using a web browser open the following IP: machineip:8080.
If you see Minerva home everything works as expected.
After you've done that, desconnect from the virtual environment by giving the following command.
deactivate
Step 4 - Configure autostart
Download the latest version of the execution script from here and put it in /opt
cd /opt
And download the execution script
sudo wget http://downloads.poleis.cloud/exec.sh
After you've done this, set it to be executed at every boot.
Edit the crontab file by giving the following command:
crontab -e
Select 'nano' as text editor, and add the following line at the bottom of the file:
@reboot bash /opt/exec.sh
Save by giving 'Control + X' and confirm with Y.
Done!
Reboot the system and everything should work as expected.
Your Ubuntu Server is now configured to work with Minerva.
Minerva should be available at MACHINE_IP:8080, if not please do some troubleshooting and do these steps again or, send us an email.