Skip to content

Installation with Ubuntu Server

Nathan Rowley-Smith edited this page May 9, 2021 · 6 revisions

Items in brackets () refers to a button you should click. If you already have the VM installed go to step 14.

  1. Download Ubuntu Server 18.04.5 (should be a .iso file).
  2. Download Virtual Box.
  3. Create a new Ubuntu 64-bit Virtual-Machine in Virtual Box.
    1. New.
    2. (expert mode)
    3. Set name -> sufst.
    4. Type -> Linux.
    5. Version -> Ubuntu 64-bit.
    6. Memory size -> >=2048MB.
    7. Create a virtual hard disk.
    8. (create)
    9. File size -> >=10.00GB
    10. Hard disk file type -> VDI
    11. Storage on physical disk -> Dynmanically allocated.
    12. (create).
  4. Set the VM Network adapter.
    1. (Settings) on the new VM.
    2. (Network).
    3. Attached to -> Bridged Adapter.
    4. Name -> MAKE SURE IT IS YOUR LOCAL ADAPTER.
  5. (Start) the VM.
  6. (Select start-up disk) menu should appear.
    1. Chose the Ubuntu Server 18.04.5 .iso file downloaded in step 1.
  7. (Start)
  8. Go through the Ubuntu server install.
    1. Most screens are straightforward.
    2. Configure a guided storage layout -> Set up this disk as an LVM group.
    3. Profile setup -> Rest of the guide assumes you put sufst for all fields.
    4. Install OpenSSH server -> Mark to install.
    5. The install of security updates may take a while...
  9. (Reboot) [will appear once all updates are complete].
  10. On reboot it will say Please remove the installation medium.
    1. [If you don't want to assign more CPU] Restart the VM [ON VM WINDOW TOP BAR (machine) -> (reset) -> (Reset)].
    2. [If you want to assign more CPU] Close the VM -> VM Settings -> System -> Processors -> <= 4 -> Start the VM.
  11. Wait for VM to start [Should be a screen that starts with Ubuntu 18.04.5 LTS sufst tty1].
  12. If you know the VM IP Address skip this step, if not, follow below.
    1. Log in -> sufst (enter) sufst (enter)
    2. You should see the VM IP address in the top of the VM screen after you login.
    3. If you can't see the IP, run sudo apt install net-tools and run ifconfig -> The VM IP will be under an inet section on one of the adapters [should be e.g. 192.168.1.232].
    4. The adapter will be named e.g. enp0s3 [should be of a similar form but will be different on each VM].
  13. SSH into the VM.
    1. Open a terminal [IF ON WINDOWS -> I recommend using Windows Terminal which is available on the Windows Store]
    2. ssh sufst@<IP> e.g. ssh sufst@192.168.1.232.
    3. If prompted for yes/no for security then select yes.
  14. Clone the latest version of the Back-End from Git.
    1. [In home directory] -> git clone https://github.com/sufst/intermediate-server.git.
  15. Install Python.
    1. sudo apt update
    2. sudo apt install software-properties-common
    3. sudo add-apt-repository ppa:deadsnakes/ppa (enter)
    4. sudo apt update
    5. sudo apt install python3.7 -> Y
    6. sudo apt install python3-pip -> Y
    7. sudo apt-get install python3-venv -> Y
  16. Set up a Virtual Environment for the Back-end.
    1. [Inside /intermediate-server folder] -> python3 -m venv inter-server-venv
  17. Set up the intermediate-server python environment.
    1. source inter-server-venv/bin/activate -> (inter-server-venv) should now be right of the terminal user account.
    2. pip install wheel.
    3. pip install pipenv.
    4. pipenv install -> Should install all intermediate-server dependencies.
  18. Test the intermediate-server.
    1. [In the intermediate-server directory with inter-server-venv active] -> python server.py.
    2. The Licence should appear with no errors.
    3. ctrl-c -> close the server.
  19. Set up the backend intermediate-server service.
    1. sudo touch /etc/systemd/system/intermediate-server.service.
    2. sudo nano /etc/systemd/system/intermediate-server.service.
    3. Copy the following
[Unit]
Description=SUFST intermediate server service
After=network.target

[Service]
User=sufst
Group=www-data
WorkingDirectory=/home/sufst/intermediate-server
ExecStart=/home/sufst/intermediate-server/inter-server-venv/bin/python3 /home/sufst/intermediate-server/server.py

[Install]
WantedBy=multi-user.target
  1. Start the intermediate-server service.
    1. sudo systemctl daemon-reload. 2 sudo systemctl enable intermediate-server.service
    2. sudo systemctl start intermediate-server.service.
    3. sudo systemctl status intermediate-server.service
    4. There should be no errors in the status of the intermediate-server service.
  2. You can now exit the Python venv using deactivate

Clone this wiki locally