Monica - Take Three

Monica - Take Three
Photo by Clarisse Meyer / Unsplash

Coming back to this today to try and make some progress. I had a thought last night, that I remember reading that the Monica authors recommend Ubuntu. I wonder if there are additional packages that come pre-loaded with Ubuntu that don't on Debian, hence my struggle. Well that's an easy enough thing to test.

I wipe the virtual hard drive and mount my Ubuntu 21.10 server image. I power up the virtual machine and walk through the installation wizard. Oh, the Ubuntu wizard lets you set a static IP address right in the wizard. Isn't that cool!

I reconfigure the operating system the same way I previously have.

Install LAMP

Steps performed on MONICA-01

  • sudo apt install apache2

Git comes preinstalled on Ubuntu so that is already taken care of for me.

  • apt install software-properties-common
    • Software-properties-common is already the newest version (0.99.13.1)
  • add-apt-repository ppa:indrej/php
    • ERROR:ppa 'indrej/php' not found
  • add-apt-repository ppa:ondrej/php

Success!

  • sudo apt update
  • sudo apt install -y php7.4 php7.4-bcmath php7.4-cli php7.4-curl php7.4-common php7.4-fpm php7.4-gd php7.4-gmp php7.4-intl php7.4-json php7.4-mbstring php7.4-mysql php7.4-opcache php7.4-redis php7.4-xml php7.4-zip

Install Composer

Steps performed on MONICA-01

  • cd /tmp
  • curl -s https://getcomposer.org/installer -o composer-setup.php
  • php composer-setup.php --install-dir=/usr/local/bin/ --filename=composer
    • `Could not open input file: composer-setup.php`

So strange. I ended up running the curl command a number of times, never gave an error and never created the file. Then it just finally did.

  • php composer-setup.php --install-dir=/usr/local/bin/ --filename composer
    • Successfully installed to /usr/local/bin/composer
  • rm -f composer-setup.php

Install Node.js and Yarn

Steps performed on MONICA-01

  • curl fsSL https://deb.nodesource.com/setup_16.x | sudo -E bash -
  • apt install nodejs
  • npm install --global yarn

Install MySQL

Steps performed on MONICA-01

  • sudo apt update
  • sudo apt install mysql-server

Install Monica - Take Three

Steps performed on MONICA-01

  • cd /var/www
  • git clone https://github.com/monicahq/monica.git
  • cd /var/www/monica
  • git fetch
  • git checkout tages/v2.18.0
  • mysql -u root -p
    • CREATE DATABASE monica CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
    • CREATE USER 'monica'@'localhost' IDENTIFIED BY 'strongpassword';
    • GRANT ALL ON monica.* TO 'monica'@'localhost';
    • FLUSH PRIVILEGES;
    • exit
  • cd /var/www/monica
  • cp .env.example .env
  • nano .env
    • Set DB_USERNAME
    • Set DB_PASSWORD
    • Set APP_ENV to production
      Saved
  • composer install --no-interaction --no-dev
    • `Lock file does not contain compatible set of packages. Please run composer update.

Again. Seriously?

  • composer update
  • `Your requirements could not be resolved to an installable set of packages.`

Yup, this error again.

Well I found the problem in the Github issues. The documentation is pointing to an old version of Monica. So I did the following to fix the issue:

  • cd /var/www/monica
  • git fetch
  • git checkout tags/v3.7.0
  • git fetch
  • composer install --no-interaction --no-dev

Success!

  • yarn install

Success!

  • yarn run production

Success!

  • php artisan key:generate

Success!

Well this is farther than I've made it before so I am very happy to stop here for the day.