How to install Monica Personal Relationship Manager on Debian 10

How to install Monica Personal Relationship Manager on Debian 10

Monica is an open source personal relationship management (PRM) web application designed to organize interactions with loved ones. Think of it as a CRM (CRM) for your friends or family (a popular tool used by corporate sales teams). Monica allows people to track all important information about their friends and family. Like activities done with them. When you last called someone. What you are talking about will help you remember your child’s name and age. It can also remind you to call someone you haven’t chatted with for a while.

feature

  • Add and manage contacts
  • Define relationships between contacts
  • reminders
  • Automatic birthday reminder
  • Stay connected by sending reminders at given intervals
  • Debt management
  • Ability to add comments to contacts
  • Be able to show how you know someone
  • Event management with contacts
  • Task management
  • Gift management
  • Address management and all the different ways to connect with others
  • Management of contact field types
  • Pet Contact Management
  • Basic journal
  • Able to indicate the passing of the day
  • Upload files and photos
  • Data import and export
  • Export contacts as vCard
  • Ability to set custom gender
  • Ability to define custom activity types
  • Ability to love contacts
  • Track conversations on social media or SMS
  • Multi-user
  • Tags to organize contacts
  • Ability to define what should be displayed on the contact form
  • Multiple currencies
  • multilingual
  • API covering most data

Claim

  • Debian 10.x (Buster)
  • Git
  • NPM (Node Package Manager)
  • PHP 7.1 or higher
  • MySQL
  • HTTP server with PHP support (eg: Apache, Nginx, Caddy …)
  • composer
  • Optional: Redis or Beanstalk

prerequisites

  • A Debian 10 (destructive) operating system.
  • Non-root user with the following permissions sudo privilege.

Preliminary steps

Check your Debian version:

lsb_release -ds# Debian GNU/Linux 10 (buster)

Set time zone:

sudo dpkg-reconfigure tzdata

Update your operating system package (software). This is an essential first step because it ensures that you have the latest updates and security fixes for the operating system’s default packages:

sudo apt update && sudo apt upgrade -y

Install some basic packages that are required for basic management of the Debian operating system:

sudo apt install -y curl wget vim git unzip socat bash-completion apt-transport-https libpng-dev

Step 1-install PHP

Install PHP and required PHP extensions:

sudo apt install -y php php-cli php-fpm php-common php-mbstring php-xml php-mysql php-curl php-zip php-intl php-bcmath php-gd php-json php-gmp

To display PHP compiled in the module, run:

php -mctypecurlexiffileinfo. . .. . .

Check PHP version:

php --version# PHP 7.3.11-1~deb10u1 (cli) (built: Oct 26 2019 14:14:18) ( NTS )# Copyright (c) 1997-2018 The PHP Group# Zend Engine v3.3.11, Copyright (c) 1998-2018 Zend Technologies# with Zend OPcache v7.3.11-1~deb10u1, Copyright (c) 1999-2018, by Zend Technologies

The PHP-FPM service starts automatically on Debian 10 systems and is enabled on restart, so there is no need to manually start and enable it. We can move on to the next step.

Step 2-Install the acme.sh client and obtain the “Let’s Encrypt” certificate (optional)

There is no need to protect your website using HTTPS, but it is a good practice to secure your website traffic. In order to obtain a TLS certificate from Let’s Encrypt, we will use the acme.sh client. Acme.sh is a simple UNIX shell software for obtaining TLS certificates from Let’s Encrypt with zero dependencies.

Download and install acme.sh:

sudo su - rootgit clone https://github.com/Neilpang/acme.sh.gitcd acme.sh ./acme.sh --install --accountemail [email protected]source ~/.bashrccd ~

Check the acme.sh version:

acme.sh --version# v2.8.2

Gain RSA with ECC / ECDSA Your domain / hostname certificate:

# RSA 2048acme.sh --issue --standalone -d example.com --keylength 2048# ECDSAacme.sh --issue --standalone -d example.com --keylength ec-256

If you want to test with a fake certificate, you can add --staging Mark the above command.

After running the above command, your certificate and key will be located at:

  • For RSA: /home/username/example.com table of Contents.
  • For ECC / ECDSA: /home/username/example.com_ecc table of Contents.

To list the certificates you issued, you can run:

acme.sh --list

Create a directory to store your certificates. We will use /etc/letsencrypt table of Contents.

mkdir -p /etc/letsecnrypt/example.comsudo mkdir -p /etc/letsencrypt/example.com_ecc

Install / copy the certificate to the / etc / letsencrypt directory.

# RSAacme.sh --install-cert -d example.com --cert-file /etc/letsencrypt/example.com/cert.pem --key-file /etc/letsencrypt/example.com/private.key --fullchain-file /etc/letsencrypt/example.com/fullchain.pem --reloadcmd "sudo systemctl reload nginx.service"# ECC/ECDSAacme.sh --install-cert -d example.com --ecc --cert-file /etc/letsencrypt/example.com_ecc/cert.pem --key-file /etc/letsencrypt/example.com_ecc/private.key --fullchain-file /etc/letsencrypt/example.com_ecc/fullchain.pem --reloadcmd "sudo systemctl reload nginx.service"

All certificates will be automatically renewed every 60 days.

After obtaining the certificate, exit from the root user and return to the regular sudo user:

exit

Step 3-install MariaDB and create database for Monica

Install MariaDB database server:

sudo apt install -y mariadb-server

Check MariaDB version:

mysql --version# mysql  Ver 15.1 Distrib 10.3.17-MariaDB, for debian-linux-gnu (x86_64) using readline 5.2

Run mysql_secure installation Script to improve MariaDB security and set MariaDB password root user:

sudo mysql_secure_installation

Answer each question:

Would you like to setup VALIDATE PASSWORD plugin? NNew password: your_secure_passwordRe-enter new password: your_secure_passwordRemove anonymous users? [Y/n] YDisallow root login remotely? [Y/n] YRemove test database and access to it? [Y/n] YReload privilege tables now? [Y/n] Y

Connect to MariaDB Shell as root user:

sudo mysql -u root -p# Enter password

Create an empty MariaDB database and user for Monica, and remember the credentials:

mariadb> CREATE DATABASE dbname;mariadb> GRANT ALL ON dbname.* TO 'username' IDENTIFIED BY 'password';mariadb> FLUSH PRIVILEGES;

Exit from MariaDB:

mariadb> exit

Replace dbname, username with password With your name.

Step 4-install and configure NGINX

Monica works on most major web server software that supports PHP, but in this guide we will use NGINX. If you like NGINX, feel free to use Apache.

Install NGINX:

sudo apt install -y nginx

Check NGINX version:

sudo nginx -v# nginx version: nginx/1.14.2

Run sudo vim /etc/nginx/sites-available/monica.conf Command and configure NGINX for Nonica.

server {
    listen 80;
    listen [::]:80;
    listen 443 ssl;    listen [::]:443 ssl;    ssl_certificate /etc/letsencrypt/example.com/fullchain.pem;    ssl_certificate_key /etc/letsencrypt/example.com/private.key;    ssl_certificate /etc/letsencrypt/example.com_ecc/fullchain.pem;    ssl_certificate_key /etc/letsencrypt/example.com_ecc/private.key;
    server_name example.com;
    root /var/www/monica/public;

    index index.php;

    location / {
        try_files $uri $uri/ /index.php?$args;
    }
    
    location ~ .php$ {
        include snippets/fastcgi-php.conf;
        fastcgi_pass unix:/var/run/php/php7.3-fpm.sock;
    }
}

Activate new monica.conf By linking the file to sites-enabled table of Contents:

sudo ln -s /etc/nginx/sites-available/monica.conf /etc/nginx/sites-enabled/

Test the NGINX configuration:

sudo nginx -t

Reload NGINX:

sudo systemctl reload nginx.service

Step 5-install Node.js and npm

Install Node.js:

curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -sudo apt install -y nodejs

Check Node.js and npm versions:

node -v && npm -v# v12.13.0# 6.12.0

Step 6-install Composer

Install Composer:

php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"php -r "if (hash_file('sha384', 'composer-setup.php') === 'a5c698ffe4b8e849a443b120cd5ba38043260d5c4023dbf93e1558871f1f07f58274fc6f4c93bcfd858c6bd0775cd8d1') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"php composer-setup.phpphp -r "unlink('composer-setup.php');"sudo mv composer.phar /usr/local/bin/composer

Check Composer version:

composer --version# Composer version 1.9.1 2019-11-01 17:20:17

Step 7- install and configure Monica

Create an empty document root folder in which Monica should be installed:

sudo mkdir -p /var/www/monica

Navigate to the document root folder:

cd /var/www/monica

Change ownership /var/www/monica Folder for user johndoe:

Don’t forget to replace “johndoe” with your username.

sudo chown -R johndoe:johndoe /var/www/monica

Clone the Monica repository:

git clone https://github.com/monicahq/monica.git .git checkout tags/v2.15.2

Note: Since the master branch may not always be stable, check out the tagged version of Monica. Find the latest official version on the Github release page and update it to the above version number as the latest version.

To create a version of all environment variables needed for the project to run:

cp .env.example .env

Updates .env Meet your specific needs. Don’t forget to set DB_USERNAME with DB_PASSWORD Settings used later. You need to configure the mail server and reminder for registration to work properly.

Run composer install --no-interaction --no-suggest --no-dev Install all packages.

Run php artisan key:generate Generate an application key. This will set APP_KEY Use the correct value automatically.

Run php artisan setup:production -v To run the migration, add seeds to the database and symlink folder.

Set proper ownership and permissions:

sudo chown -R www-data:www-data /var/www/monicasudo chmod -R 775 /var/www/monica/storage

Step 8- complete Monica installation

Now, open a web browser and enter the URL http://example.com. You will be redirected to the following page:

Provide your email address, name and password. Then, click the register button. You should see the Monica dashboard on the following pages:

Monica PRM login

  • https://www.monicahq.com/
  • https://github.com/monicahq/monica

Source

Sidebar