Installation

Get the source code

Using git

cd /var/www
git clone https://git-repo.iml.unibe.ch/iml-open-source/healthmonitor.git

This creates the folder /var/www/healthmonitor/.

Download archive

Go to https://git-repo.iml.unibe.ch/iml-open-source/healthmonitor and on top right click [Code] to select your favourite package format (Zip, tar, ..).

This is an example for tgz format:

cd /var/www
mkdir healthmonitor
cd healthmonitor
wget https://git-repo.iml.unibe.ch/iml-open-source/healthmonitor/-/archive/main/healthmonitor-main.tar.gz

tar -xzf healthmonitor-main.tar.gz
rm -f healthmonitor-main.tar.gz

Set webroot

The webroot is located in the subdir public_html. This you need to setup for document root in your apache.

<VirtualHost>
  ...
  DocumentRoot /var/www/healthmonitor/public_html
  ...

</VirtualHost>

Protect /admin

Protect the administration web ui by securing to the /admin/ folder. You can protect it with any method: SSO, ip restriction, basic auth.

For small test locally or a small network the basic authentication is a good choice.

It will be created by the web installer.

Basic auth with openLDAP

This is just an example for Basic auth with LDAP (requires enabled authnz_ldap_module + ldap_module in Apache httpd).

<VirtualHost>
...
  <Location "/admin">

    Require valid-user
    AuthType Basic
    AuthName "Healthmonitor Backend"
    AuthBasicProvider ldap

    AuthLDAPURL "ldaps://ldap.example.com:636/ou=?uid?sub?(objectClass=posixAccount)(memberOf=cn=Healthmonitor Backend Users,ou=...)" SSL
    AuthLDAPBindDN "<Bind user>"
    AuthLDAPBindPassword "<Bind password>"

  </Location>
</VirtualHost>

Create an API user

Create an connection specific api user on IML Appmonitor.

Edit public_html/server/config/appmonitor-server-config.json and go to the section “users”. Add a new key (=username) with a secret and the role [“api”]:

    ... 
    "users": {
        ...
        "api-healthmonitor": {
            "secret": "<Put-a-healthmonitor-secret-here>",
            "comment": "Healthmonitor API",
            "roles": [ "api" ]
        }
    }
    ... 

Create config file

Go back to the Healtmonitor project.

Create the config file by copying the delivered .dist file.

cd public_html/config/
cp settings.php.dist settings.php

Edit the file and add in section “monitor”:

    ...
    'monitor' => [
        'apiurl'=>'https://appmonitor.example.com/api/v1',
        'user'=>'api-healthmonitor',
        'secret'=>'<Put-a-healthmonitor-secret-here>',
    ],
    ...

Go to section “acl -> groups -> global -> admin”. Add The username you will use in Basic Authentication here.

    ...
    'acl'=>[
        ...
        // ---------- GROUPS
        'groups'=>[

            // ----- global admins for all apps
            'global'=>[
                'admin'=>[
                    '<your-userid-here>',
                ],
            ],
        ],
    ],
    ...