Table of Contents

Install www.brimble.com on Ubuntu 20.04 LTS as Unraid Virtual Machine

This will guide you through the setup of brimble.com on an installation of Ubuntu 20.04 LTS as an Unraid Virtual Machine.

VM Settings

Install to Virtual Machine

Size Location Notes
4 GB swap (primary) should be min sqrt(RAM) and max double RAM
6 GB / (logical) current install uses about 2.6 GB
5 GB /home (logical) current install uses about 45 MB
1 GB /boot (logical) current install uses about 145 MB
19.498 GB /var (logical) current install uses about 9.3 GB
4 GB /tmp (logical) current install uses about 21 MB

Setup

Update Packages

sudo apt-get update
sudo apt-get dist-upgrade

Install SSH Server

sudo apt-get install openssh-server

Mount Unraid Shares

Install ex-fat (for USB drives or FAT formats)

sudo apt-get install exfat-fuse exfat-utils

Reboot

sudo reboot -h now

Create ssh-rsa key auth

Reboot

sudo reboot -h now

Install Tomcat

sudo apt-get install tomcat9

Copy webpage files

sudo rm -rf /var/lib/tomcat9/webapps/ROOT
sudo cp -a /mnt/backup/webpage/webapps/. /var/lib/tomcat9/webapps/

Allow Directory Browsing

sudo vim /etc/tomcat9/web.xml
<init-param>
  <param-name>listings</param-name>
  <param-value>true</param-value>
</init-param>

Install MySql (if not using a docker)

sudo apt-get install mysql-server

Import database dump

sudo mysql -u root -p < dumpfile.sql

Create mysql user

sudo mysql -u root -p
CREATE USER 'dirk'@'localhost' IDENTIFIED BY 'password';
show databases;
GRANT ALL PRIVILEGES ON *.* TO 'dirk'@'localhost';
exit

Allow write access for user

GRANT FILE ON *.* TO 'dirk'@'localhost';
exit

Allow mysql to write to files

sudo aa-status
sudo vim /etc/apparmor.d/usr.sbin.mysqld
sudo vim /etc/mysql/mysql.conf.d/mysqld.cnf

Tomcat - Mysql linking / JDK / JAVA cleanup / Activate error page

Install Samba

sudo apt-get install samba
sudo smbpasswd -a dirk
sudo vim /etc/samba/smb.conf
[webapps]
  comment = Webpage Files
    path = /var/lib/tomcat9/webapps
    available = yes
    browsable = yes
    guest ok = yes
    read only = no
    writable = yes
    admin users = dirk

Add football season

LOAD DATA LOCAL INFILE "/home/dirk/2019o.csv" INTO TABLE games COLUMNS TERMINATED BY ',';
UPDATE games SET vscore = NULL where year = 2019;
UPDATE games SET hscore = NULL where year = 2019;

Allow rsync to run on own

sudo visudo -f /etc/sudoers.d/nopass
dirk ALL=(ALL:ALL) NOPASSWD:/usr/bin/rsync

Add cron job for backup

crontab -e
0 3 * * * /home/dirk/scripts/backup

Change timezone

sudo dpkg-reconfigure tzdata