1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-02-12 19:22:24 +00:00

Merge pull request #3448 from cwivagg/patch-2

Several updates to make Matomo experience cleaner
This commit is contained in:
A Holt 2022-12-29 12:43:24 -05:00 committed by GitHub
commit 61f9919426
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 21 additions and 8 deletions

View file

@ -41,13 +41,6 @@ Log in to your IIAB's full Matomo URL, e.g. http://box.lan/matomo, as arranged a
Take a look at Matomo's official guides to further set this up: https://matomo.org/guides/
WARNING: If your IIAB URL is *not* http://box.lan, you may run into a big orange warning from Matomo that it has been configured to run from a different address. Here are the steps to fix this problem.
1. Copy the IP address listed in the box below "How do I fix this problem and how do I log in again?" For example, I see `trusted_hosts[] = "192.168.64.10"`, so I copy `"192.168.64.10"`.
2. Run `sudo nano /library/www/matomo/config/config.ini.php` to edit Matomo's config file.
3. Paste or type the IP address from Step 1 to replace `"box.lan"` in the `trusted_hosts` line, which should be about line 13. When I'm done, my line 13 says `trusted_hosts[] = "192.168.64.10"` instead of `trusted_hosts[] = "box.lan"`.
4. Refresh the Matomo homepage and the warning should be gone.
5. Optionally, see the https://forum.matomo.org/t/trusted-hostname/11963[advanced tips] in https://forum.matomo.org/[Matomo's Forum].
WARNING: Matomo won't show any traffic statistics until after 1 day or reboot (which are the events that trigger the log scraper!)
@ -65,6 +58,9 @@ Below the *Visitors* button is a second button, *Behavior*. Click on the *Pages*
2. One thing Matomo can't track correctly is navigation within KA Lite (Khan Academy) pages. If your users are spending a lot of time here, it won't be visible in the Matomo statistics.
3. Time Zones: The Matomo installer's default behavior in "Configure Matomo to track IIAB" is to pick up the system time zone when none is supplied. If this doesn't work, you can set the time zone to whatever you prefer from the Matomo home page. In testing, Matomo picked up the system time zone on a regular Multipass Ubuntu instance. However, it was unable to do so on a VirtualBox Ubuntu instance. Thus, we provide a fallback behavior "Fallback Configure Matomo to track IIAB" that picks an arbitrary time zone. The fallback fires only when the form with an empty time zone is submitted and returns a 200 status code instead of 302, indicating that form submission failed.
== Credits
Carl Wivagg

View file

@ -10,6 +10,17 @@
# TASK [matomo : HTTP Get Welcome] ***************************************************************************************************************************************
# fatal: [127.0.0.1]: FAILED! => {"cache_control": "private, no-cache, no-store", "changed": false, "connection": "close", "content_type": "text/html; charset=utf-8", "date": "Wed, 15 Jun 2022 05:07:41 GMT", "elapsed": 0, "expires": "Thu, 19 Nov 1981 08:52:00 GMT", "msg": "Status code was 500 and not [200]: HTTP Error 500: Internal Server Error", "pragma": "no-cache", "redirected": false, "server": "nginx/1.18.0 (Ubuntu)", "set_cookie": "MATOMO_SESSID=psak3aem27vrdrt8t2f016600f; path=/; HttpOnly; SameSite=Lax", "status": 500, "transfer_encoding": "chunked", "url": "http://box.lan/matomo/index.php?action=welcome", "x_matomo_request_id": "fbfd2"}
# https://matomo.org/faq/on-premise/matomo-requirements/
- name: Install Matomo's recommended PHP extensions
package:
name:
- php{{ php_version }}-curl
- php{{ php_version }}-gd
- php{{ php_version }}-cli
- php{{ php_version }}-mysql
- php{{ php_version }}-xml
- php{{ php_version }}-mbstring
- name: Start MariaDB
#action: service name=mysql state=started
systemd:
@ -211,6 +222,12 @@
owner: "{{ apache_user }}"
group: "{{ apache_user }}"
- name: Don't Check for Trusted Host
ini_file:
path: "{{ matomo_path }}/matomo/config/config.ini.php"
section: General
option: enable_trusted_host_check
value: 0
# RECORD Matomo AS INSTALLED

View file

@ -12,6 +12,6 @@ location ~ ^/matomo(.*)\.php(.*)$ {
fastcgi_param PATH_INFO $2;
}
location ~ ^/matomo/ {
location ~ ^/matomo(/)? {
root /library/www;
}