{"id":16366356,"url":"https://github.com/centminmod/centminmod-matomo","last_synced_at":"2026-02-02T20:42:21.948Z","repository":{"id":251724050,"uuid":"837957576","full_name":"centminmod/centminmod-matomo","owner":"centminmod","description":null,"archived":false,"fork":false,"pushed_at":"2024-08-10T12:52:47.000Z","size":123,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-03T16:10:53.252Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/centminmod.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-08-04T14:44:55.000Z","updated_at":"2025-02-21T18:44:37.000Z","dependencies_parsed_at":"2024-08-10T14:00:47.187Z","dependency_job_id":"79b28bdf-e631-40e9-a9ff-17fb0561df66","html_url":"https://github.com/centminmod/centminmod-matomo","commit_stats":null,"previous_names":["centminmod/centminmod-matomo"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/centminmod/centminmod-matomo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/centminmod%2Fcentminmod-matomo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/centminmod%2Fcentminmod-matomo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/centminmod%2Fcentminmod-matomo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/centminmod%2Fcentminmod-matomo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/centminmod","download_url":"https://codeload.github.com/centminmod/centminmod-matomo/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/centminmod%2Fcentminmod-matomo/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264505263,"owners_count":23618911,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-11T02:46:08.789Z","updated_at":"2026-02-02T20:42:16.917Z","avatar_url":"https://github.com/centminmod.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# Centmin Mod Matomo Installation Guide\n\n* [Requirements](#requirements)\n* [Web Hosting](#web-hosting)\n* [Prepare](#prepare)\n* [Letsencrypt Setup](#letsencrypt-setup)\n* [Update Nginx](#update-nginx)\n* [Create Nginx Vhost Site](#create-nginx-vhost-site)\n* [Update Nginx Vhost Site Matomo Rules](#update-nginx-vhost-site-matomo-rules)\n* [Install Matomo](#install-matomo)\n* [Setup Matomo](#setup-matomo)\n* [Setup Matomo Auto-Archiving Cron Task](#setup-matomo-auto-archiving-cron-task)\n* [Matomo Optimizations](#matomo-optimizations)\n* [Matomo Notes](#matomo-notes)\n\n## Requirements\n\nMatomo and Centmin Mod both have their respective system requirements. For Centmin Mod LEMP stack, recommended would be at least 4GB memory and 4GB swap disk with AlmaLinux or Rocky Linux version 8 or 9 on x86_64 (non-Arm based) servers. \n\nFor Matomo, start with at least 2 to 4 CPU cores and 4-8GB memory with 4GB swap disk and at least 150-200GB of disk space. Read the relevant link for Matomo recommended requirements based on traffic.\n\n* https://matomo.org/faq/on-premise/matomo-requirements/\n* https://centminmod.com/install.html\n\n## Web Hosting\n\nFor Centmin Mod some recommended and tested web hosts for VPS and dedicated servers include:\n\n* [Hetzner](https://centminmod.com/hetzner/) - below example was installed on Hetzner Cloud dedicated AMD CPU VPS instance - 4x CPU, 16GB memory and 160GB disk storage.\n* [Upcloud](https://centminmod.com/upcloud/)\n* [Linode](https://centminmod.com/linode/)\n* [Vultr](https://centminmod.com/vultr/)\n* [DigitalOcean](https://centminmod.com/digitalocean/)\n* [Hivelocity](https://centminmod.com/hivelocity/)\n\nBelow example install on [Hetzner Cloud](https://centminmod.com/hetzner/) dedicated AMD CPU VPS server running Centmin Mod 140.00beta01 on AlmaLinux 9.4.\n\n```\ncat /etc/centminmod-release \n140.00beta01.b085\n```\n```\ncat /etc/os-release \nNAME=\"AlmaLinux\"\nVERSION=\"9.4 (Seafoam Ocelot)\"\nID=\"almalinux\"\nID_LIKE=\"rhel centos fedora\"\nVERSION_ID=\"9.4\"\nPLATFORM_ID=\"platform:el9\"\nPRETTY_NAME=\"AlmaLinux 9.4 (Seafoam Ocelot)\"\nANSI_COLOR=\"0;34\"\nLOGO=\"fedora-logo-icon\"\nCPE_NAME=\"cpe:/o:almalinux:almalinux:9::baseos\"\nHOME_URL=\"https://almalinux.org/\"\nDOCUMENTATION_URL=\"https://wiki.almalinux.org/\"\nBUG_REPORT_URL=\"https://bugs.almalinux.org/\"\n\nALMALINUX_MANTISBT_PROJECT=\"AlmaLinux-9\"\nALMALINUX_MANTISBT_PROJECT_VERSION=\"9.4\"\nREDHAT_SUPPORT_PRODUCT=\"AlmaLinux\"\nREDHAT_SUPPORT_PRODUCT_VERSION=\"9.4\"\nSUPPORT_END=2032-06-01\n```\n```\nlscpu\nArchitecture:            x86_64\n  CPU op-mode(s):        32-bit, 64-bit\n  Address sizes:         40 bits physical, 48 bits virtual\n  Byte Order:            Little Endian\nCPU(s):                  4\n  On-line CPU(s) list:   0-3\nVendor ID:               AuthenticAMD\n  BIOS Vendor ID:        QEMU\n  Model name:            AMD EPYC-Milan Processor\n    BIOS Model name:     NotSpecified\n    CPU family:          25\n    Model:               1\n    Thread(s) per core:  2\n    Core(s) per socket:  2\n    Socket(s):           1\n    Stepping:            1\n    BogoMIPS:            4890.80\n    Flags:               fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdt\n                         scp lm rep_good nopl cpuid extd_apicid tsc_known_freq pni pclmulqdq ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt aes xsave avx f16\n                         c rdrand hypervisor lahf_lm cmp_legacy cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw topoext perfctr_core ssbd ibrs ibpb stibp vmmcal\n                         l fsgsbase bmi1 avx2 smep bmi2 erms invpcid rdseed adx smap clflushopt clwb sha_ni xsaveopt xsavec xgetbv1 xsaves clzero xsaveerptr wbnoinv\n                         d arat umip pku ospke rdpid fsrm\nVirtualization features: \n  Hypervisor vendor:     KVM\n  Virtualization type:   full\nCaches (sum of all):     \n  L1d:                   64 KiB (2 instances)\n  L1i:                   64 KiB (2 instances)\n  L2:                    1 MiB (2 instances)\n  L3:                    32 MiB (1 instance)\nNUMA:                    \n  NUMA node(s):          1\n  NUMA node0 CPU(s):     0-3\n```\n```\nfree -mlt\n               total        used        free      shared  buff/cache   available\nMem:           15355        3894        4664         176        7296       11460\nLow:           15355       10690        4664\nHigh:              0           0           0\nSwap:           4095           0        4095\nTotal:         19451        3894        8760\n```\n```\ndf -hT\nFilesystem     Type      Size  Used Avail Use% Mounted on\ndevtmpfs       devtmpfs  4.0M     0  4.0M   0% /dev\ntmpfs          tmpfs     7.5G     0  7.5G   0% /dev/shm\ntmpfs          tmpfs     3.0G   94M  3.0G   4% /run\n/dev/sda1      ext4      151G   15G  130G  10% /\n/dev/sda14     vfat       64M  7.1M   57M  12% /boot/efi\ntmpfs          tmpfs     1.5G     0  1.5G   0% /run/user/0\ntmpfs          tmpfs     7.5G  588K  7.5G   1% /tmp\n```\n\n## Prepare\n\n1. Prepare your intended domain name or subdomain's DNS and Matomo MariaDB MySQL database name, user and password and Maxmind geolocation database license registration. Below guide will use \n\n* subdomain hostname = `u.domain.com` \n* MariaDB database name = `matomodb`\n* MariaDB database username = `matomo_user`\n* MariaDB database username password = `matomopass`\n\na. Update `u.domain.com` DNS A record to point to Centmin Mod server's IPv4 IP address\n\nb. Edit /etc/my.cnf and add `local-infile=1` to `[mysql]` and `[mysqld]` sections and remove existing `local-infile=0`\n\n```\n[mysql]\nlocal-infile=1\nmax_allowed_packet = 64M\n\n[mysqld]\nlocal-infile=1\n```\n\nThen restart MariaDB MySQL server via command shortcut or systemctl command\n\n```\nmysqlrestart\n```\n\nor\n\n```\nsystemctl restart mariadb\n```\n\nc. Create MariaDB database name and user/pass using Centmin Mod's addons/mysqladmin_shell.sh tool\n\n```\n/usr/local/src/centminmod/addons/mysqladmin_shell.sh createuserdb matomodb matomo_user matomopass\n```\n\nOr if you want a more secure password use included `pwgen` tool to generate. Be sure to write down the output from `echo $newpass`\n\n```\nnewpass=$(pwgen -1cny 27 | tr -d '\\!@#\\$%^\u0026*()_+[]{}|;:,.\u003c\u003e?\\\\`')\necho $newpass\nburie1quaiz2OhcauDohwaich\n\n/usr/local/src/centminmod/addons/mysqladmin_shell.sh createuserdb matomodb matomo_user $newpass\n```\n\nThere is also a Node.js dependency for some Matomo Plugins i.e. Performance Audit Plugin. So install Node.js via Centmin Mod `addons/nodejs.sh` addon installer.\n\n```\n/usr/local/src/centminmod/addons/nodejs.sh install\n```\n```\nnode --version\nv20.16.0\n\nnpm --version\n10.8.1\n```\n\nAnd YUM dependencies for Performance Audit Plugin. On Centmin Mod LEMP stack with AlmaLinux 9:\n\nList dependencies\n\n```\nyum -q list alsa-lib.x86_64 atk.x86_64 cups-libs.x86_64 gtk3.x86_64 ipa-gothic-fonts libXcomposite.x86_64 libXcursor.x86_64 libXdamage.x86_64 libXext.x86_64 libXi.x86_64 libXrandr.x86_64 libXScrnSaver.x86_64 libXtst.x86_64 pango.x86_64 xorg-x11-fonts-100dpi xorg-x11-fonts-75dpi xorg-x11-fonts-cyrillic xorg-x11-fonts-misc xorg-x11-fonts-Type1 xorg-x11-utils | tr -s ' ' | column -t\nInstalled                       Packages             \nalsa-lib.x86_64                 1.2.10-2.el9         @appstream\natk.x86_64                      2.36.0-5.el9         @appstream\ncups-libs.x86_64                1:2.3.3op2-27.el9_4  @baseos\ngtk3.x86_64                     3.24.31-2.el9        @appstream\nlibXcomposite.x86_64            0.4.5-7.el9          @appstream\nlibXcursor.x86_64               1.2.0-7.el9          @appstream\nlibXdamage.x86_64               1.1.5-7.el9          @appstream\nlibXext.x86_64                  1.3.4-8.el9          @appstream\nlibXi.x86_64                    1.7.10-8.el9         @appstream\nlibXrandr.x86_64                1.5.2-8.el9          @appstream\nlibXtst.x86_64                  1.2.3-16.el9         @appstream\npango.x86_64                    1.48.7-3.el9         @appstream\nAvailable                       Packages             \nlibXScrnSaver.x86_64            1.2.3-10.el9         appstream\nxorg-x11-fonts-100dpi.noarch    7.5-33.el9           appstream\nxorg-x11-fonts-75dpi.noarch     7.5-33.el9           appstream\nxorg-x11-fonts-Type1.noarch     7.5-33.el9           appstream\nxorg-x11-fonts-cyrillic.noarch  7.5-33.el9           appstream\nxorg-x11-fonts-misc.noarch      7.5-33.el9           appstream\nxorg-x11-utils.x86_64           7.5-40.el9           appstream\n```\n\nInstall dependencies\n\n```\nyum -y install alsa-lib.x86_64 atk.x86_64 cups-libs.x86_64 gtk3.x86_64 ipa-gothic-fonts libXcomposite.x86_64 libXcursor.x86_64 libXdamage.x86_64 libXext.x86_64 libXi.x86_64 libXrandr.x86_64 libXScrnSaver.x86_64 libXtst.x86_64 pango.x86_64 xorg-x11-fonts-100dpi xorg-x11-fonts-75dpi xorg-x11-fonts-cyrillic xorg-x11-fonts-misc xorg-x11-fonts-Type1 xorg-x11-utils --skip-broken\n```\n\n## Letsencrypt Setup\n\n2. Ensure you have Letsencrypt integration and Nginx GeoIP 2 Lite Nginx module support enabled by setting up in Centmin Mod persistent config file `/etc/centminmod/custom_config.inc` the variables for:\n\n```\nLETSENCRYPT_DETECT='y'\nNGINX_GEOIPTWOLITE='y'\nNGXDYNAMIC_GEOIPTWOLITE='y'\n```\n\nYou can run these 3 commands to automate this:\n\n```\ngrep 'LETSENCRYPT_DETECT' /etc/centminmod/custom_config.inc || echo \"LETSENCRYPT_DETECT='y'\" \u003e\u003e /etc/centminmod/custom_config.inc\ngrep 'NGINX_GEOIPTWOLITE' /etc/centminmod/custom_config.inc || echo \"NGINX_GEOIPTWOLITE='y'\" \u003e\u003e /etc/centminmod/custom_config.inc\ngrep 'NGXDYNAMIC_GEOIPTWOLITE' /etc/centminmod/custom_config.inc || echo \"NGXDYNAMIC_GEOIPTWOLITE='y'\" \u003e\u003e /etc/centminmod/custom_config.inc\n```\n\nIf you are using Cloudflare for, then also setup Cloudflare DNS API validation as per https://centminmod.com/letsencrypt-freessl.html#dns. Cloudflare API Token variables are set in persistent config file at `/etc/centminmod/custom_config.inc`. This method is recommended if your Centmin Mod Nginx domain is behind Cloudflare orange cloud enabled proxy and you have Cloudflare Full or Full Strict SSL mode enabled.\n\nCloudflare API Tokens, requires you to create your Cloudflare Token API with permissions for read access to Zone.Zone, and edit/write access to Zone.DNS, across all Zones at https://dash.cloudflare.com/profile/api-tokens and to grab your Cloudflare Account ID from any of your Cloudflare domain's main dashboard's right side column listing.\n\n```\nLETSENCRYPT_DETECT='y'\nNGINX_GEOIPTWOLITE='y'\nNGXDYNAMIC_GEOIPTWOLITE='y'\nCF_DNSAPI_GLOBAL='y'\nCF_Token=\"YOUR_CF_TOKEN\"\nCF_Account_ID=\"YOUR_CF_ACCOUNT_ID\"\n```\n\n## Update Nginx\n\n3. Update Nginx to 1.27.0 via centmin.sh menu option 4\n\n```\n--------------------------------------------------------\n     Centmin Mod Menu 140.00beta01 centminmod.com     \n--------------------------------------------------------\n1).  Centmin Install\n2).  Add Nginx vhost domain\n3).  NSD setup domain name DNS\n4).  Nginx Upgrade / Downgrade\n5).  PHP Upgrade / Downgrade\n6).  MySQL User Database Management\n7).  Persistent Config File Management\n8).  Option Being Revised (TBA)\n9).  Option Being Revised (TBA)\n10). Memcached Server Re-install\n11). MariaDB MySQL Upgrade \u0026 Management\n12). Zend OpCache Install/Re-install\n13). Install/Reinstall Redis PHP Extension\n14). SELinux disable\n15). Install/Reinstall ImagicK PHP Extension\n16). Change SSHD Port Number\n17). Multi-thread compression: zstd,pigz,pbzip2,lbzip2\n18). Suhosin PHP Extension install\n19). Install FFMPEG and FFMPEG PHP Extension\n20). NSD Install/Re-Install\n21). Data Transfer\n22). Add Wordpress Nginx vhost + Cache Plugin\n23). Update Centmin Mod Code Base\n24). Exit\n--------------------------------------------------------\nEnter option [ 1 - 24 ] 4\n--------------------------------------------------------\n```\n```\nNginx Upgrade - Would you like to continue? [y/n] y\n\nCurrent Nginx Version: 1.27.0 (260724-025453-almalinux8-kvm-561a713-br-a71f931)\n\nInstall which version of Nginx? (version i.e. type 1.27.0): 1.27.0\n\nDo you still want to continue? [y/n] y\n```\n\nOn Centmin Mod Nginx upgrade completion, you can verify if Nginx was build with GeoIP 2 Lite nginx module support using below command when installed woult return the value of `ngx_http_geoip2_module`\n\n```\nnginx -V 2\u003e\u00261 | grep -o 'ngx_http_geoip2_module'\nngx_http_geoip2_module\n```\n\n```\nnginx -V\nnginx version: nginx/1.27.0 (040824-141522-almalinux8-kvm-da33abe-br-a71f931)\nbuilt by gcc 13.2.1 20231205 (Red Hat 13.2.1-6) (GCC) \nbuilt with OpenSSL 1.1.1k  FIPS 25 Mar 2021\nTLS SNI support enabled\n```\n\u003e configure arguments: --with-ld-opt='-Wl,-E -L/usr/local/zlib-cf/lib -L/usr/local/nginx-dep/lib -ljemalloc -Wl,-z,relro,-z,now -Wl,-rpath,/usr/local/zlib-cf/lib:/usr/local/nginx-dep/lib -pie -flto=2 -flto-compression-level=1 -fuse-ld=gold' --with-cc-opt='-I/usr/local/zlib-cf/include -I/usr/local/nginx-dep/include -m64 -march=native -fPIC -g -O3 -fstack-protector-strong -flto=2 -flto-compression-level=1 -fuse-ld=gold --param=ssp-buffer-size=4 -Wformat -Wno-pointer-sign -Wimplicit-fallthrough=0 -Wno-cast-align -Wno-implicit-function-declaration -Wno-builtin-declaration-mismatch -Wno-deprecated-declarations -Wno-int-conversion -Wno-unused-result -Wno-vla-parameter -Wno-maybe-uninitialized -Wno-return-local-addr -Wno-array-parameter -Wno-alloc-size-larger-than -Wno-address -Wno-array-bounds -Wno-discarded-qualifiers -Wno-stringop-overread -Wno-stringop-truncation -Wno-missing-field-initializers -Wno-unused-variable -Wno-format -Wno-error=unused-result -Wno-missing-profile -Wno-stringop-overflow -Wno-free-nonheap-object -Wno-discarded-qualifiers -Wno-bad-function-cast -Wno-dangling-pointer -Wno-array-parameter -fcode-hoisting -Wno-cast-function-type -Wno-format-extra-args -Wp,-D_FORTIFY_SOURCE=2' --prefix=/usr/local/nginx --sbin-path=/usr/local/sbin/nginx --conf-path=/usr/local/nginx/conf/nginx.conf --build=040824-141522-almalinux8-kvm-da33abe-br-a71f931 --with-compat --without-pcre2 --with-http_stub_status_module --with-http_secure_link_module --with-libatomic --with-http_gzip_static_module --add-dynamic-module=../ngx_brotli --add-module=../zstd-nginx-module --add-dynamic-module=../ngx_http_geoip2_module --with-http_sub_module --with-http_addition_module --with-http_image_filter_module=dynamic --with-http_geoip_module --with-stream_geoip_module --with-stream_realip_module --with-stream_ssl_preread_module --with-threads --with-stream --with-stream_ssl_module --with-http_realip_module --add-dynamic-module=../ngx-fancyindex-0.4.2 --add-module=../ngx_cache_purge-2.5.3 --add-dynamic-module=../ngx_devel_kit-0.3.2 --add-dynamic-module=../set-misc-nginx-module-0.33 --add-dynamic-module=../echo-nginx-module-0.63 --add-module=../redis2-nginx-module-0.15 --add-module=../ngx_http_redis-0.4.0-cmm --add-module=../memc-nginx-module-0.20 --add-module=../srcache-nginx-module-0.33 --add-dynamic-module=../headers-more-nginx-module-0.37 --with-pcre-jit --with-zlib=../zlib-cloudflare-1.3.3 --with-zlib-opt=-fPIC --with-http_ssl_module --with-http_v2_module\n\n## Create Nginx Vhost Site\n\n4. Create Centmin Mod Nginx Vhost with HTTPS Letsencrypt SSL certificate support using Centmin Mod `nv` command line tool (you can also use centmin.sh menu option 2 shell menu for interactive creation) as outlined at https://centminmod.com/nginx_domain_dns_setup.html:\n\n`nv` command options\n\n```\nnv\n\nUsage: /bin/nv [-d yourdomain.com] [-s y|n|yd|le|led|lelive|lelived] [-u ftpusername]\n\n  -d  yourdomain.com or subdomain.yourdomain.com\n  -s  ssl self-signed create = y or n or https only vhost = yd\n  -s  le - letsencrypt test cert or led test cert with https default\n  -s  lelive - letsencrypt live cert or lelived live cert with https default\n  -u  your FTP username\n\n  example:\n\n  /bin/nv -d yourdomain.com -s y -u ftpusername\n  /bin/nv -d yourdomain.com -s n -u ftpusername\n  /bin/nv -d yourdomain.com -s yd -u ftpusername\n  /bin/nv -d yourdomain.com -s le -u ftpusername\n  /bin/nv -d yourdomain.com -s led -u ftpusername\n  /bin/nv -d yourdomain.com -s lelive -u ftpusername\n  /bin/nv -d yourdomain.com -s lelived -u ftpusername\n```\n\nFor Centmin Mod Nginx vhost with Letsencrypt HTTPS default changing `ftpusername` to your desired pure-ftpd virtual FTP username. The password will be auto generated and displayed when creation run is completed.\n\n```\nnv -d u.domain.com -s lelived -u ftpusername\n```\n\nYou'll get information for your Nginx vhost like including the pure-ftpd virtual FTP user credentials https://centminmod.com/ftp.html:\n\n```\n-------------------------------------------------------------\nFTP hostname : xxx.xxx.xxx.xxx\nFTP port : 21\nFTP mode : FTP (explicit SSL)\nFTP Passive (PASV) : ensure is checked/enabled\nFTP username created for u.domain.com : ftpusername\nFTP password created for u.domain.com : O2DxxxxxxJRHWKy\n-------------------------------------------------------------\nvhost for u.domain.com created successfully\n\nAUDITD_ENABLE is set to = n\n\ndomain: http://u.domain.com\nvhost conf file for u.domain.com created: /usr/local/nginx/conf/conf.d/u.domain.com.conf\n\nvhost ssl for u.domain.com created successfully\n\ndomain: https://u.domain.com\nvhost ssl conf file for u.domain.com created: /usr/local/nginx/conf/conf.d/u.domain.com.ssl.conf\n\nupload files to /home/nginx/domains/u.domain.com/public\nvhost log files directory is /home/nginx/domains/u.domain.com/log\n```\n\nAnd also shows log location if you need to revisit the credential info or troubleshoot Nginx vhost creation\n\n```\n-------------------------------------------------------------\nvhost for u.domain.com setup successfully\nu.domain.com setup info log saved at: \n/root/centminlogs/centminmod_040824-143037_nginx_addvhost_nv.log\n-------------------------------------------------------------\n```\n\n`nv` command and centmin.sh menu option 2 or 22 will also save a `*-remove-*.log` like `centminmod_040824-143037_nginx_addvhost_nv-remove-cmds-u.domain.com.log` with commands to remove the created Nginx vhost\n\n```\nls -lAhrt /root/centminlogs/ | tail -2\n-rw-r--r-- 1 root root 1.4K Aug  4 14:30 centminmod_040824-143037_nginx_addvhost_nv-remove-cmds-u.domain.com.log\n-rw-r--r-- 1 root root 8.5K Aug  4 14:30 centminmod_040824-143037_nginx_addvhost_nv.log\n```\n\nYou can optionally setup some SSH command aliases commands for easier navigation of your Nginx vhost. Type in SSH session:\n\n```\nalias myconf='nano /usr/local/nginx/conf/conf.d/u.domain.com.ssl.conf'\nalias mylog='pushd /home/nginx/domains/u.domain.com/log/'\nalias mypub='pushd /home/nginx/domains/u.domain.com/public/'\n```\n\nand add these 3 lines into your `/root/.bashrc` file.\n\nThen you'll be able to type:\n\n* `myconf` to launch nano text editor to edit Nginx vhost config file\n* `mylog` to change into Nginx vhost's log directory using pushd command\n* `mypub` to change into Nginx vhost's public web root directory\n\n## Update Nginx Vhost Site Matomo Rules\n\n5. Update Centmin Mod Nginx vhost config file `/usr/local/nginx/conf/conf.d/u.domain.com.ssl.conf` for Matomo nginx rules\n\nEdit your Nginx vhost config file at `/usr/local/nginx/conf/conf.d/u.domain.com.ssl.conf` replacing the default `location / {}` context content\n\n```\n  location / {\n  include /usr/local/nginx/conf/503include-only.conf;\n\n# block common exploits, sql injections etc\n#include /usr/local/nginx/conf/block.conf;\n\n  # Enables directory listings when index file not found\n  #autoindex  on;\n\n  # Shows file listing times as local time\n  #autoindex_localtime on;\n\n  # Wordpress Permalinks example\n  #try_files $uri $uri/ /index.php?q=$uri\u0026$args;\n\n  }\n```\n\nwith the below content - keeping `/usr/local/nginx/conf/503include-only.conf` include file to support [Centmin Mod's 503 sitestatus maintenance HTML mode](https://community.centminmod.com/threads/sitestatus-maintenance-mode.5599/). These Matomo Nginx rules are a modification of Matomo's Nginx rules https://github.com/matomo-org/matomo-nginx/blob/master/sites-available/matomo.conf made for Centmin Mod Nginx.\n\n```\n# Matomo Stuff\n  # https://github.com/matomo-org/matomo-nginx/blob/master/sites-available/matomo.conf\n  add_header Referrer-Policy origin always; # make sure outgoing links don't show the URL to the Matomo instance\n\n  ## only allow accessing the following php files\n  location ~ ^/(index|matomo|piwik|js/index|plugins/HeatmapSessionRecording/configs)\\.php$ {\n    include /usr/local/nginx/conf/php.conf; # we have to include this again here inside of this location block\n    try_files $fastcgi_script_name =404; # protects against CVE-2019-11043. If this line is already included in your snippets/fastcgi-php.conf you can comment it here.\n    fastcgi_param HTTP_PROXY \"\"; # prohibit httpoxy: https://httpoxy.org/\n  }\n\n  # LOCATION DIRECTIVES\n  location / {\n    include /usr/local/nginx/conf/503include-only.conf;\n    try_files $uri $uri/ =404;\n\n    # Matomo $_SERVER variables\n    fastcgi_param MM_COUNTRY_CODE $geoip2_data_country_code;\n    fastcgi_param MM_CONTINENT_NAME $geoip2_data_continent_name;\n    fastcgi_param MM_COUNTRY_CODE $geoip2_data_country_code;\n    fastcgi_param MM_COUNTRY_NAME $geoip2_data_country_name;\n    fastcgi_param MM_REGION_CODE $geoip2_data_region_iso;\n    fastcgi_param MM_REGION_NAME $geoip2_data_region_name;\n    fastcgi_param MM_LATITUDE $geoip2_data_location_latitude;\n    fastcgi_param MM_LONGITUDE $geoip2_data_location_longitude;\n    fastcgi_param MM_POSTAL_CODE $geoip2_data_postal_code;\n    fastcgi_param MM_CITY_NAME $geoip2_data_city_name;\n    fastcgi_param MM_ISP $geoip2_data_autonomous_system_organization;\n    fastcgi_param MM_ORG $geoip2_data_autonomous_system_number;\n  }\n\n  ## disable all access to the following directories\n  location ~ ^/(config|tmp|core|lang) {\n    deny all;\n    return 403; # replace with 404 to not show these directories exist\n  }\n\n  location ~ /\\.ht {\n    deny  all;\n    return 403;\n  }\n\n  location ~ js/container_.*_preview\\.js$ {\n    expires off;\n    add_header Cache-Control 'private, no-cache, no-store';\n  }\n\n  location ~ ^/(libs|vendor|misc|node_modules) {\n    deny all;\n    return 403;\n  }\n\n  location ~ \\.(gif|ico|jpg|png|svg|js|css|htm|html|mp3|mp4|wav|ogg|avi|ttf|eot|woff|woff2)$ {\n    allow all;\n    ## Cache images,CSS,JS and webfonts for an hour\n    ## Increasing the duration may improve the load-time, but may cause old files to show after an Matomo upgrade\n    expires 1h;\n    add_header Pragma public;\n    add_header Cache-Control \"public\";\n  }\n```\n\nThe difference between Centmin Mod's Matomo Nginx rules and Matomo's defaults is removal of the PHP location context match for\n\n```\n    ## deny access to all other .php files\n    location ~* ^.+\\.php$ {\n        deny all;\n        return 403;\n    }\n```\n\nCentmin Mod LEMP stack Nginx vhost's do not need the PHP location context match as it includes with each created Nginx vhost and include file `/usr/local/nginx/conf/php.conf` that you can use in it's place.\n\n```\n  include /usr/local/nginx/conf/php.conf;\n```\n\nOptionally, you can [enable Centmin Mod Nginx JSON formatted access logs](https://community.centminmod.com/threads/how-to-configure-nginx-for-json-based-access-logging.19641/) for easier parsing of access logs by uncommenting the additional `access_log` line in `/usr/local/nginx/conf/conf.d/u.domain.com.ssl.conf`.\n\nChange from\n\n```\n  access_log /home/nginx/domains/u.domain.com/log/access.log combined buffer=256k flush=5m;\n  #access_log /home/nginx/domains/u.domain.com/log/access.json main_json buffer=256k flush=5m;\n  error_log /home/nginx/domains/u.domain.com/log/error.log;\n```\n\nto\n\n```\n  access_log /home/nginx/domains/u.domain.com/log/access.log combined buffer=256k flush=5m;\n  access_log /home/nginx/domains/u.domain.com/log/access.json main_json buffer=256k flush=5m;\n  error_log /home/nginx/domains/u.domain.com/log/error.log;\n```\n\nIf using Cloudflare, uncomment and enable `/usr/local/nginx/conf/cloudflare.conf` include file in `/usr/local/nginx/conf/conf.d/u.domain.com.ssl.conf`. This ensures Centmin Mod Nginx logs the real visitor IP address.\n\nChange from\n\n```\n  # uncomment cloudflare.conf include if using cloudflare for\n  # server and/or vhost site\n  #include /usr/local/nginx/conf/cloudflare.conf;\n```\n\nto\n\n```\n  # uncomment cloudflare.conf include if using cloudflare for\n  # server and/or vhost site\n  include /usr/local/nginx/conf/cloudflare.conf;\n```\n\nComment out `/usr/local/nginx/conf/staticfiles.conf` and `/usr/local/nginx/conf/drop.conf` include files in `/usr/local/nginx/conf/conf.d/u.domain.com.ssl.conf`\n\n```\n  #include /usr/local/nginx/conf/staticfiles.conf;\n  #include /usr/local/nginx/conf/drop.conf;\n```\nand also comment out Centmin Mod Nginx autoprotect include file `/usr/local/nginx/conf/autoprotect/u.domain.com/autoprotect-u.domain.com.conf`\n\n```\n  #include /usr/local/nginx/conf/autoprotect/u.domain.com/autoprotect-u.domain.com.conf;\n```\n\nExample for the full Centmin Mod Nginx vhost for Matomo created site behind Cloudflare orange cloud proxy with Cloudflare Flexible SSL ([note for Cloudflare Full/Full Strict SSL modes](#cloudflare-full-ssl)) at `/usr/local/nginx/conf/conf.d/u.domain.com.ssl.conf`:\n\n```\n#x# HTTPS-DEFAULT\n server {\n   listen   80;\n   #x#   listen   [::]:80;\n   server_name u.domain.com.com www.u.domain.com.com;\n   return 302 https://u.domain.com.com$request_uri;\n   root /home/nginx/domains/u.domain.com.com/public;\n   include /usr/local/nginx/conf/staticfiles.conf;\n }\n\n\nserver {\n  listen 443 ssl;\n  listen   [::]:443 ssl;\n  http2 on;\n  server_name u.domain.com.com www.u.domain.com.com;\n\n  include /usr/local/nginx/conf/ssl/u.domain.com.com/u.domain.com.com.crt.key.conf;\n  include /usr/local/nginx/conf/ssl_include.conf;\n\n  # cloudflare authenticated origin pull cert community.centminmod.com/threads/13847/\n  #ssl_client_certificate /usr/local/nginx/conf/ssl/cloudflare/u.domain.com.com/origin.crt;\n  #ssl_verify_client on;\n    \n  # mozilla recommended\n  ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384;\n  ssl_prefer_server_ciphers   on;\n  #add_header Alternate-Protocol  443:npn-spdy/3;\n\n  # before enabling HSTS line below read centminmod.com/nginx_domain_dns_setup.html#hsts\n  #add_header Strict-Transport-Security \"max-age=31536000; includeSubdomains;\";\n  #add_header X-Frame-Options SAMEORIGIN;\n  add_header X-Xss-Protection \"1; mode=block\" always;\n  add_header X-Content-Type-Options \"nosniff\" always;\n  #add_header Referrer-Policy \"strict-origin-when-cross-origin\";\n  #add_header Permissions-Policy \"accelerometer=(), camera=(), geolocation=(), gyroscope=(), magnetometer=(), microphone=(), payment=(), usb=()\";\n  #spdy_headers_comp 5;\n  ssl_buffer_size 1369;\n  ssl_session_tickets on;\n  \n  # enable ocsp stapling\n  resolver 8.8.8.8 8.8.4.4 1.1.1.1 1.0.0.1 valid=10m;\n  resolver_timeout 10s;\n  ssl_stapling on;\n  ssl_stapling_verify on;\n\n# ngx_pagespeed \u0026 ngx_pagespeed handler\n#include /usr/local/nginx/conf/pagespeed.conf;\n#include /usr/local/nginx/conf/pagespeedhandler.conf;\n#include /usr/local/nginx/conf/pagespeedstatslog.conf;\n\n  # limit_conn limit_per_ip 16;\n  # ssi  on;\n\n  access_log /home/nginx/domains/u.domain.com.com/log/access.log combined buffer=256k flush=5m;\n  access_log /home/nginx/domains/u.domain.com.com/log/access.json main_json buffer=256k flush=5m;\n  error_log /home/nginx/domains/u.domain.com.com/log/error.log;\n\n  #include /usr/local/nginx/conf/autoprotect/u.domain.com.com/autoprotect-u.domain.com.com.conf;\n  root /home/nginx/domains/u.domain.com.com/public;\n  # uncomment cloudflare.conf include if using cloudflare for\n  # server and/or vhost site\n  include /usr/local/nginx/conf/cloudflare.conf;\n  include /usr/local/nginx/conf/503include-main.conf;\n\n  # Matomo Stuff\n  # https://github.com/matomo-org/matomo-nginx/blob/master/sites-available/matomo.conf\n  add_header Referrer-Policy origin always; # make sure outgoing links don't show the URL to the Matomo instance\n\n  ## only allow accessing the following php files\n  location ~ ^/(index|matomo|piwik|js/index|plugins/HeatmapSessionRecording/configs)\\.php$ {\n    include /usr/local/nginx/conf/php.conf; # we have to include this again here inside of this location block\n    try_files $fastcgi_script_name =404; # protects against CVE-2019-11043. If this line is already included in your snippets/fastcgi-php.conf you can comment it here.\n    fastcgi_param HTTP_PROXY \"\"; # prohibit httpoxy: https://httpoxy.org/\n  }\n\n  # LOCATION DIRECTIVES\n  location / {\n    include /usr/local/nginx/conf/503include-only.conf;\n    try_files $uri $uri/ =404;\n\n    # Matomo $_SERVER variables\n    fastcgi_param MM_COUNTRY_CODE $geoip2_data_country_code;\n    fastcgi_param MM_CONTINENT_NAME $geoip2_data_continent_name;\n    fastcgi_param MM_COUNTRY_CODE $geoip2_data_country_code;\n    fastcgi_param MM_COUNTRY_NAME $geoip2_data_country_name;\n    fastcgi_param MM_REGION_CODE $geoip2_data_region_iso;\n    fastcgi_param MM_REGION_NAME $geoip2_data_region_name;\n    fastcgi_param MM_LATITUDE $geoip2_data_location_latitude;\n    fastcgi_param MM_LONGITUDE $geoip2_data_location_longitude;\n    fastcgi_param MM_POSTAL_CODE $geoip2_data_postal_code;\n    fastcgi_param MM_CITY_NAME $geoip2_data_city_name;\n    fastcgi_param MM_ISP $geoip2_data_autonomous_system_organization;\n    fastcgi_param MM_ORG $geoip2_data_autonomous_system_number;\n  }\n\n  ## disable all access to the following directories\n  location ~ ^/(config|tmp|core|lang) {\n    deny all;\n    return 403; # replace with 404 to not show these directories exist\n  }\n\n  location ~ /\\.ht {\n    deny  all;\n    return 403;\n  }\n\n  location ~ js/container_.*_preview\\.js$ {\n    expires off;\n    add_header Cache-Control 'private, no-cache, no-store';\n  }\n\n  location ~ ^/(libs|vendor|misc|node_modules) {\n    deny all;\n    return 403;\n  }\n\n  location ~ \\.(gif|ico|jpg|png|svg|js|css|htm|html|mp3|mp4|wav|ogg|avi|ttf|eot|woff|woff2)$ {\n    allow all;\n    ## Cache images,CSS,JS and webfonts for an hour\n    ## Increasing the duration may improve the load-time, but may cause old files to show after an Matomo upgrade\n    expires 1h;\n    add_header Pragma public;\n    add_header Cache-Control \"public\";\n  }\n\n  include /usr/local/nginx/conf/php.conf;\n  \n  include /usr/local/nginx/conf/pre-staticfiles-local-u.domain.com.com.conf;\n  include /usr/local/nginx/conf/pre-staticfiles-global.conf;\n  #include /usr/local/nginx/conf/staticfiles.conf;\n  #include /usr/local/nginx/conf/drop.conf;\n  #include /usr/local/nginx/conf/errorpage.conf;\n  include /usr/local/nginx/conf/vts_server.conf;\n}\n```\n\nThe generated free Letsencrypt SSL certificates are referenced in the Nginx vhost's `/usr/local/nginx/conf/ssl/u.domain.com/u.domain.com.crt.key.conf` include file:\n\n```\n  ssl_dhparam /usr/local/nginx/conf/ssl/u.domain.com/dhparam.pem;\n  ssl_certificate      /usr/local/nginx/conf/ssl/u.domain.com/u.domain.com-acme.cer;\n  ssl_certificate_key  /usr/local/nginx/conf/ssl/u.domain.com/u.domain.com-acme.key;\n  ssl_trusted_certificate /usr/local/nginx/conf/ssl/u.domain.com/u.domain.com-acme.cer; \n```\n\nYou can use Centmin Mod's `addons/acmetool.sh` script's `checkdate` option to inspect which Letsencrypt SSL certificates have been issued and installed on your server as well as the domain validation method used and the Letsencrypt SSL certfificates expiry date. It shows where Letsencrypt SSL certificate was issued `/root/.acme.sh/u.domain.com/u.domain.com.cer` and where it was installed for Centmin Mod Nginx `/usr/local/nginx/conf/ssl/u.domain.com/u.domain.com-acme.cer` and a link to `crt.sh` certificate transparency log entry. The Letsencrypt SSL certificates are automatically renewed every 60 days via cronjob.\n\n```\n/usr/local/src/centminmod/addons/acmetool.sh checkdates\n\n----------------------------------------------\nnginx installed\n----------------------------------------------\n\n/usr/local/nginx/conf/ssl/u.domain.com/u.domain.com-acme.cer\nSHA1 Fingerprint=C3046EA21XXXXXXXXXE1A87E31EXXXXXXX\ncertificate expires in 84 days on 3 Nov 2024\n\n----------------------------------------------\nacme.sh obtained\n----------------------------------------------\n\n/root/.acme.sh/u.domain.com/u.domain.com.cer\nSHA1 Fingerprint=C3046EA21XXXXXXXXXE1A87E31EXXXXXXX\n[ below certifcate transparency link is only valid ~1hr after issuance ]\nhttps://crt.sh/?sha1=C3046EA21XXXXXXXXXE1A87E31EXXXXXXX\ncertificate expires in 84 days on 3 Nov 2024\nLetsencrypt validation method: Le_Webroot='dns_cf'\n```\n\n### Cloudflare Full SSL\n\nIf you run Cloudflare orange cloud enabled proxy in front of Matomo site and have set Cloudflare Full/Full Strict SSL and set Cloudflare to always redirect to HTTPS, you may need to comment out the Centmin Mod Nginx non-HTTPS port 80 to HTTPS port 443 redirect `server{}` context\n\nchange in `/usr/local/nginx/conf/conf.d/u.domain.com.ssl.conf` from\n\n```\n server {\n   listen   80;\n   #x#   listen   [::]:80;\n   server_name u.domain.com.com www.u.domain.com.com;\n   return 302 https://u.domain.com.com$request_uri;\n   root /home/nginx/domains/u.domain.com.com/public;\n   include /usr/local/nginx/conf/staticfiles.conf;\n }\n```\n\nto\n\n```\n# server {\n#   listen   80;\n#   #x#   listen   [::]:80;\n#   server_name u.domain.com.com www.u.domain.com.com;\n#   return 302 https://u.domain.com.com$request_uri;\n#   root /home/nginx/domains/u.domain.com.com/public;\n#   include /usr/local/nginx/conf/staticfiles.conf;\n# }\n```\n\nTurn off the default `disable_function` for `shell_exec` as Matomo requires the use of it.\n\n```\nsed -i 's|^php_admin_value\\[disable_functions\\]|;php_admin_value\\[disable_functions\\]|' /usr/local/etc/php-fpm.conf\n```\n\nVerify it's disabled with semi-colon in front of the setting:\n\n```\ncat /usr/local/etc/php-fpm.conf | grep disable_functions\n;php_admin_value[disable_functions] = shell_exec\n```\n\nThen restart Nginx using either Centmin Mod command shortcut or systemctl\n\nRestart both Nginx and PHP-FPM for Nginx vhost and PHP-FPM changes to take effect:\n\n```\nnprestart\n```\n\nor\n\n```\nsystemctl restart nginx php-fpm\n```\n\nFor Nginx only restart:\n\n```\nngxrestart\n```\n\nor\n\n```\nsystemctl restart nginx\n```\n\nto restart PHP-FPM only:\n\n```\nfpmrestart\n```\n\nor\n\n```\nsystemctl restart php-fpm\n```\n\n## Install Matomo\n\n6. Install Matomo\n\nInstall Matomo as per guide at https://matomo.org/faq/on-premise/installing-matomo/.\n\nThe created Nginx vhost's public web root is at `/home/nginx/domains/u.domain.com/public`. I usually like to download files to a staging directory first one level above the public web root and then apply nginx user/group permissions and copy the extracted zip file contents to public web root.\n\n```\nmkdir -p /home/nginx/domains/u.domain.com/matomo-downloads\n# create matomo-archives directory for cron task archive logs\nmkdir -p /home/nginx/domains/u.domain.com/matomo-archives\ncd /home/nginx/domains/u.domain.com/matomo-downloads\nwget -O /home/nginx/domains/u.domain.com/matomo-downloads/matomo.zip https://builds.matomo.org/matomo.zip\nunzip matomo.zip\nchown -R nginx:nginx matomo\ncd matomo\n\\cp -af * /home/nginx/domains/u.domain.com/public\n```\n\nListing public web root's contents after Matomo files copied over:\n\n```\nls -lah /home/nginx/domains/u.domain.com/public\ntotal 428K\ndrwxr-s--- 13 nginx nginx 4.0K Aug  4 14:42 .\ndrwxr-s---  7 nginx nginx   84 Aug  4 14:39 ..\n-rw-r-----  1 nginx nginx 2.0K Aug  4 14:30 401.html\n-rw-r-----  1 nginx nginx 2.0K Aug  4 14:30 403.html\n-rw-r-----  1 nginx nginx 2.0K Aug  4 14:30 404.html\n-rw-r-----  1 nginx nginx 2.0K Aug  4 14:30 500.html\n-rw-r-----  1 nginx nginx 2.0K Aug  4 14:30 502.html\n-rw-r-----  1 nginx nginx 2.0K Aug  4 14:30 503.html\n-rw-r-----  1 nginx nginx 7.6K Aug  4 14:30 503.jpg\n-rw-r-----  1 nginx nginx 2.0K Aug  4 14:30 504.html\n-rw-r-----  1 nginx nginx 2.0K Aug  4 14:30 50x.html\n-rw-r--r--  1 nginx nginx 109K Jun 10 07:48 CHANGELOG.md\ndrwxr-sr-x  3 nginx nginx   89 Jun 10 07:48 config\n-rwxr-xr-x  1 nginx nginx  753 Jun 10 07:48 console\n-rw-r--r--  1 nginx nginx  929 Jun 10 07:48 CONTRIBUTING.md\ndrwxr-sr-x 53 nginx nginx 4.0K Jun 10 07:48 core\n-rw-r--r--  1 nginx nginx  555 Jun 10 07:48 DIObject.php\n-rw-r-----  1 nginx nginx 6.3K Aug  4 14:30 index.html\n-rw-r--r--  1 nginx nginx  716 Jun 10 07:48 index.php\ndrwxr-sr-x  2 nginx nginx  114 Jun 10 07:48 js\ndrwxr-sr-x  2 nginx nginx 4.0K Jun 10 07:48 lang\n-rw-r--r--  1 nginx nginx  828 Jun 10 07:48 LegacyAutoloader.php\n-rw-r--r--  1 nginx nginx 8.9K Jun 10 07:48 LEGALNOTICE\ndrwxr-sr-x  9 nginx nginx  140 Jun 10 07:48 libs\n-rw-r--r--  1 nginx nginx  35K Jun 10 07:48 LICENSE\n-rw-r-----  1 nginx nginx 3.3K Aug  4 14:30 maintenance.html\n-rw-r--r--  1 nginx nginx  66K Jun 10 07:48 matomo.js\n-rw-r--r--  1 nginx nginx  334 Jun 10 07:48 matomo.php\ndrwxr-sr-x  7 nginx nginx  127 Jun 10 07:48 misc\ndrwxr-sr-x 14 nginx nginx  235 Jun 10 07:48 node_modules\n-rw-r--r--  1 nginx nginx 6.3K Jun 10 07:48 offline-service-worker.js\n-rw-r--r--  1 nginx nginx  66K Jun 10 07:48 piwik.js\n-rw-r--r--  1 nginx nginx 2.7K Jun 10 07:48 piwik.php\ndrwxr-sr-x 69 nginx nginx 4.0K Jun 10 07:48 plugins\n-rw-r--r--  1 nginx nginx 4.6K Jun 10 07:48 PRIVACY.md\n-rw-r--r--  1 nginx nginx 5.9K Jun 10 07:48 README.md\n-rw-r--r--  1 nginx nginx  770 Jun 10 07:48 robots.txt\n-rw-r--r--  1 nginx nginx 1.9K Jun 10 07:48 SECURITY.md\ndrwxr-sr-x  2 nginx nginx   23 Jun 10 07:48 tests\ndrwxr-sr-x  2 nginx nginx    6 Jun 10 07:48 tmp\ndrwxr-sr-x 22 nginx nginx  321 Jun 10 07:48 vendor\n```\n\n## Setup Matomo\n\n7. Setup Matomo\n\nOpen your web browser and navigate to the URL to which you uploaded Matomo - `https://u.domain.com`. If everything is uploaded correctly, you should see the Matomo Installation Welcome Screen and proceed as outlined.\n\nThe MariaDB MySQL database tables installed:\n\n```\nmysql -t -e \"SELECT CONCAT(table_schema,'.',table_name) AS 'Table Name', CONCAT(ROUND(table_rows,2),' Rows') AS 'Number of Rows', ENGINE AS 'Storage Engine', CONCAT(ROUND(data_length/(1024*1024),2),'MB') AS 'Data Size', CONCAT(ROUND(index_length/(1024*1024),2),'MB') AS 'Index Size', CONCAT(ROUND((data_length+index_length)/(1024*1024),2),'MB') AS 'Total', ROW_FORMAT, TABLE_COLLATION FROM information_schema.TABLES WHERE table_schema LIKE 'matomodb' ORDER BY table_name;\"\n\n+-------------------------------------------------+----------------+----------------+-----------+------------+--------+------------+--------------------+\n| Table Name                                      | Number of Rows | Storage Engine | Data Size | Index Size | Total  | ROW_FORMAT | TABLE_COLLATION    |\n+-------------------------------------------------+----------------+----------------+-----------+------------+--------+------------+--------------------+\n| matomodb.matomo_access                         | 1 Rows         | InnoDB         | 0.02MB    | 0.02MB     | 0.03MB | Dynamic    | utf8mb4_general_ci |\n| matomodb.matomo_alert                          | 0 Rows         | InnoDB         | 0.02MB    | 0.00MB     | 0.02MB | Dynamic    | utf8mb4_general_ci |\n| matomodb.matomo_alert_site                     | 0 Rows         | InnoDB         | 0.02MB    | 0.00MB     | 0.02MB | Dynamic    | utf8mb4_general_ci |\n| matomodb.matomo_alert_triggered                | 0 Rows         | InnoDB         | 0.02MB    | 0.00MB     | 0.02MB | Dynamic    | utf8mb4_general_ci |\n| matomodb.matomo_archive_blob_2024_01           | 198 Rows       | InnoDB         | 1.02MB    | 0.02MB     | 1.03MB | Dynamic    | utf8mb4_general_ci |\n| matomodb.matomo_archive_blob_2024_02           | 0 Rows         | InnoDB         | 0.02MB    | 0.02MB     | 0.03MB | Dynamic    | utf8mb4_general_ci |\n| matomodb.matomo_archive_blob_2024_03           | 0 Rows         | InnoDB         | 0.02MB    | 0.02MB     | 0.03MB | Dynamic    | utf8mb4_general_ci |\n| matomodb.matomo_archive_blob_2024_04           | 0 Rows         | InnoDB         | 0.02MB    | 0.02MB     | 0.03MB | Dynamic    | utf8mb4_general_ci |\n| matomodb.matomo_archive_blob_2024_05           | 0 Rows         | InnoDB         | 0.02MB    | 0.02MB     | 0.03MB | Dynamic    | utf8mb4_general_ci |\n| matomodb.matomo_archive_blob_2024_06           | 0 Rows         | InnoDB         | 0.02MB    | 0.02MB     | 0.03MB | Dynamic    | utf8mb4_general_ci |\n| matomodb.matomo_archive_blob_2024_07           | 0 Rows         | InnoDB         | 0.02MB    | 0.02MB     | 0.03MB | Dynamic    | utf8mb4_general_ci |\n| matomodb.matomo_archive_blob_2024_08           | 819 Rows       | InnoDB         | 2.02MB    | 0.06MB     | 2.08MB | Dynamic    | utf8mb4_general_ci |\n| matomodb.matomo_archive_blob_2024_09           | 0 Rows         | InnoDB         | 0.02MB    | 0.02MB     | 0.03MB | Dynamic    | utf8mb4_general_ci |\n| matomodb.matomo_archive_invalidations          | 16 Rows        | InnoDB         | 0.02MB    | 0.02MB     | 0.03MB | Dynamic    | utf8mb4_general_ci |\n| matomodb.matomo_archive_numeric_2024_01        | 123 Rows       | InnoDB         | 0.02MB    | 0.03MB     | 0.05MB | Dynamic    | utf8mb4_general_ci |\n| matomodb.matomo_archive_numeric_2024_02        | 0 Rows         | InnoDB         | 0.02MB    | 0.03MB     | 0.05MB | Dynamic    | utf8mb4_general_ci |\n| matomodb.matomo_archive_numeric_2024_03        | 0 Rows         | InnoDB         | 0.02MB    | 0.03MB     | 0.05MB | Dynamic    | utf8mb4_general_ci |\n| matomodb.matomo_archive_numeric_2024_04        | 0 Rows         | InnoDB         | 0.02MB    | 0.03MB     | 0.05MB | Dynamic    | utf8mb4_general_ci |\n| matomodb.matomo_archive_numeric_2024_05        | 0 Rows         | InnoDB         | 0.02MB    | 0.03MB     | 0.05MB | Dynamic    | utf8mb4_general_ci |\n| matomodb.matomo_archive_numeric_2024_06        | 0 Rows         | InnoDB         | 0.02MB    | 0.03MB     | 0.05MB | Dynamic    | utf8mb4_general_ci |\n| matomodb.matomo_archive_numeric_2024_07        | 0 Rows         | InnoDB         | 0.02MB    | 0.03MB     | 0.05MB | Dynamic    | utf8mb4_general_ci |\n| matomodb.matomo_archive_numeric_2024_08        | 562 Rows       | InnoDB         | 0.11MB    | 0.11MB     | 0.22MB | Dynamic    | utf8mb4_general_ci |\n| matomodb.matomo_archive_numeric_2024_09        | 0 Rows         | InnoDB         | 0.02MB    | 0.03MB     | 0.05MB | Dynamic    | utf8mb4_general_ci |\n| matomodb.matomo_bot_db                         | 224 Rows       | InnoDB         | 0.02MB    | 0.00MB     | 0.02MB | Dynamic    | utf8mb3_general_ci |\n| matomodb.matomo_bot_db_stat                    | 0 Rows         | InnoDB         | 0.02MB    | 0.00MB     | 0.02MB | Dynamic    | utf8mb3_general_ci |\n| matomodb.matomo_bot_device_detector_bots       | 213 Rows       | InnoDB         | 0.06MB    | 0.00MB     | 0.06MB | Dynamic    | utf8mb3_general_ci |\n| matomodb.matomo_bot_type                       | 13 Rows        | InnoDB         | 0.02MB    | 0.02MB     | 0.03MB | Dynamic    | utf8mb3_general_ci |\n| matomodb.matomo_bot_visits                     | 266 Rows       | InnoDB         | 0.02MB    | 0.00MB     | 0.02MB | Dynamic    | utf8mb3_general_ci |\n| matomodb.matomo_brute_force_log                | 2 Rows         | InnoDB         | 0.02MB    | 0.02MB     | 0.03MB | Dynamic    | utf8mb4_general_ci |\n| matomodb.matomo_changes                        | 0 Rows         | InnoDB         | 0.02MB    | 0.02MB     | 0.03MB | Dynamic    | utf8mb4_general_ci |\n| matomodb.matomo_custom_dimensions              | 0 Rows         | InnoDB         | 0.02MB    | 0.02MB     | 0.03MB | Dynamic    | utf8mb4_general_ci |\n| matomodb.matomo_goal                           | 2 Rows         | InnoDB         | 0.02MB    | 0.00MB     | 0.02MB | Dynamic    | utf8mb4_general_ci |\n| matomodb.matomo_locks                          | 0 Rows         | InnoDB         | 0.02MB    | 0.00MB     | 0.02MB | Dynamic    | utf8mb4_general_ci |\n| matomodb.matomo_logger_message                 | 0 Rows         | InnoDB         | 0.02MB    | 0.00MB     | 0.02MB | Dynamic    | utf8mb4_general_ci |\n| matomodb.matomo_log_action                     | 1616 Rows      | InnoDB         | 0.23MB    | 0.05MB     | 0.28MB | Dynamic    | utf8mb4_general_ci |\n| matomodb.matomo_log_conversion                 | 2 Rows         | InnoDB         | 0.02MB    | 0.03MB     | 0.05MB | Dynamic    | utf8mb4_general_ci |\n| matomodb.matomo_log_conversion_item            | 0 Rows         | InnoDB         | 0.02MB    | 0.02MB     | 0.03MB | Dynamic    | utf8mb4_general_ci |\n| matomodb.matomo_log_link_visit_action          | 2331 Rows      | InnoDB         | 0.23MB    | 0.19MB     | 0.42MB | Dynamic    | utf8mb4_general_ci |\n| matomodb.matomo_log_performance                | 0 Rows         | InnoDB         | 0.02MB    | 0.08MB     | 0.09MB | Dynamic    | utf8mb3_general_ci |\n| matomodb.matomo_log_profiling                  | 0 Rows         | InnoDB         | 0.02MB    | 0.02MB     | 0.03MB | Dynamic    | utf8mb4_general_ci |\n| matomodb.matomo_log_visit                      | 1457 Rows      | InnoDB         | 0.41MB    | 0.22MB     | 0.63MB | Dynamic    | utf8mb4_general_ci |\n| matomodb.matomo_option                         | 282 Rows       | InnoDB         | 0.22MB    | 0.02MB     | 0.23MB | Dynamic    | utf8mb4_general_ci |\n| matomodb.matomo_plugin_setting                 | 23 Rows        | InnoDB         | 0.02MB    | 0.02MB     | 0.03MB | Dynamic    | utf8mb4_general_ci |\n| matomodb.matomo_privacy_logdata_anonymizations | 0 Rows         | InnoDB         | 0.02MB    | 0.02MB     | 0.03MB | Dynamic    | utf8mb4_general_ci |\n| matomodb.matomo_queuedtracking_queue           | 0 Rows         | InnoDB         | 0.02MB    | 0.00MB     | 0.02MB | Dynamic    | utf8mb4_general_ci |\n| matomodb.matomo_report                         | 0 Rows         | InnoDB         | 0.02MB    | 0.00MB     | 0.02MB | Dynamic    | utf8mb4_general_ci |\n| matomodb.matomo_report_subscriptions           | 0 Rows         | InnoDB         | 0.02MB    | 0.02MB     | 0.03MB | Dynamic    | utf8mb4_general_ci |\n| matomodb.matomo_segment                        | 0 Rows         | InnoDB         | 0.02MB    | 0.00MB     | 0.02MB | Dynamic    | utf8mb4_general_ci |\n| matomodb.matomo_sequence                       | 9 Rows         | InnoDB         | 0.02MB    | 0.00MB     | 0.02MB | Dynamic    | utf8mb4_general_ci |\n| matomodb.matomo_session                        | 175 Rows       | InnoDB         | 0.22MB    | 0.00MB     | 0.22MB | Dynamic    | utf8mb4_general_ci |\n| matomodb.matomo_site                           | 4 Rows         | InnoDB         | 0.02MB    | 0.00MB     | 0.02MB | Dynamic    | utf8mb4_general_ci |\n| matomodb.matomo_site_setting                   | 12 Rows        | InnoDB         | 0.02MB    | 0.02MB     | 0.03MB | Dynamic    | utf8mb4_general_ci |\n| matomodb.matomo_site_url                       | 2 Rows         | InnoDB         | 0.02MB    | 0.00MB     | 0.02MB | Dynamic    | utf8mb4_general_ci |\n| matomodb.matomo_tagmanager_container           | 0 Rows         | InnoDB         | 0.02MB    | 0.02MB     | 0.03MB | Dynamic    | utf8mb4_general_ci |\n| matomodb.matomo_tagmanager_container_release   | 0 Rows         | InnoDB         | 0.02MB    | 0.02MB     | 0.03MB | Dynamic    | utf8mb4_general_ci |\n| matomodb.matomo_tagmanager_container_version   | 0 Rows         | InnoDB         | 0.02MB    | 0.03MB     | 0.05MB | Dynamic    | utf8mb4_general_ci |\n| matomodb.matomo_tagmanager_tag                 | 0 Rows         | InnoDB         | 0.02MB    | 0.02MB     | 0.03MB | Dynamic    | utf8mb4_general_ci |\n| matomodb.matomo_tagmanager_trigger             | 0 Rows         | InnoDB         | 0.02MB    | 0.02MB     | 0.03MB | Dynamic    | utf8mb4_general_ci |\n| matomodb.matomo_tagmanager_variable            | 0 Rows         | InnoDB         | 0.02MB    | 0.02MB     | 0.03MB | Dynamic    | utf8mb4_general_ci |\n| matomodb.matomo_tracking_failure               | 0 Rows         | InnoDB         | 0.02MB    | 0.00MB     | 0.02MB | Dynamic    | utf8mb4_general_ci |\n| matomodb.matomo_twofactor_recovery_code        | 0 Rows         | InnoDB         | 0.02MB    | 0.00MB     | 0.02MB | Dynamic    | utf8mb4_general_ci |\n| matomodb.matomo_user                           | 3 Rows         | InnoDB         | 0.02MB    | 0.02MB     | 0.03MB | Dynamic    | utf8mb4_general_ci |\n| matomodb.matomo_user_dashboard                 | 0 Rows         | InnoDB         | 0.02MB    | 0.00MB     | 0.02MB | Dynamic    | utf8mb4_general_ci |\n| matomodb.matomo_user_language                  | 0 Rows         | InnoDB         | 0.02MB    | 0.00MB     | 0.02MB | Dynamic    | utf8mb4_general_ci |\n| matomodb.matomo_user_token_auth                | 0 Rows         | InnoDB         | 0.02MB    | 0.02MB     | 0.03MB | Dynamic    | utf8mb4_general_ci |\n+-------------------------------------------------+----------------+----------------+-----------+------------+--------+------------+--------------------+\n```\n\n## Setup Matomo Auto-Archiving Cron Task\n\n8. Setup Matomo set up auto-archiving cron task\n\nSetup Matomo set up auto-archiving cron task as per https://matomo.org/docs/setup-auto-archiving/ with the path to your console at `/home/nginx/domains/u.domain.com/public/console` and url to `https://u.domain.com` install location\n\n```\n5 * * * * /usr/local/bin/php /home/nginx/domains/u.domain.com/public/console core:archive --url=https://u.domain.com \u003e /home/nginx/domains/u.domain.com/matomo-archives/matomo-archive.log\n```\n\nYou can use `crontab -e` command to open cron editor to add the above line.\n\n## Matomo Optimizations\n\n9. Optimizations\n\n### a.\n\na. Disable browser triggers for Matomo archiving and limit Matomo reports to updating every hour\n\nAfter you have set up the automatic archive script as explained above, you can set up Matomo so that requests in the user interface do not trigger archiving, but instead read the pre-archived reports. Login as the super user, click on `Administration \u003e System -\u003e General Settings`, and select:\n\n* Archive reports when viewed from the browser: No\n* Archive reports at most every X seconds : 3600 seconds\n\nClick save to save your changes\n\n### b.\n\nb. Setup Matomo Tracking API to use a Redis https://matomo.org/faq/on-premise/how-to-configure-matomo-to-handle-unexpected-peak-in-traffic/. Centmin Mod LEMP stack automatically installs Redis server out of the box listening on `127.0.0.1` with port `6379` with up to 15 databases available for databases 0 to 14.\n\n  1. Get QueuedTracking from the Marketplace https://plugins.matomo.org/QueuedTracking\n  2. Activate the QueuedTracking plugin in “Matomo Administration \u003e Plugins “\n  3. Under “Matomo Administration \u003e System \u003e General Settings \u003e QueuedTracking”\n  4. Select Backend = Redis and Redis port 6379 \u0026 database number = 9 \u0026 Select Number of Queue workers = 1 or 2\n  5. Select Number of requests that are processed in one batch = 50. This will mean your analytics reported won't be real-time but updated in batches of requests.\n  6. Disable the setting Process during tracking request\n  7. Then setup a cronjob that executes the command ./console queuedtracking:process every minute, for example:\n\n```\n* * * * * php /home/nginx/domains/u.domain.com/public/console queuedtracking:process --no-ansi \u003e/dev/null 2\u003e\u00261\n```\n\nThen to check this is working, you can keep track of the queue and see how big it is by executing the command:\n\n```\n/home/nginx/domains/u.domain.com/public/console queuedtracking:monitor\n```\n```\n/home/nginx/domains/u.domain.com/public/console queuedtracking:monitor\nQueue is enabled\nRequest sets in the queue will be processed automatically after a tracking request\nUp to 2 workers will be used\nProcessor will start once there are at least 50 request sets in the queue\n17 (17+0) request sets left in queue. 1.19M used memory (1.39M peak). 0 workers active.\n```\n\nThis will show the current state of the queue. In traffic peak time the queue will grow 1,000 or 10,000 requests or more, but usually the queue should be around 0-150 requests.\n\nTo view the next requests to process in each queue\n\n```\n/home/nginx/domains/u.domain.com/public/console queuedtracking:print-queued-requests\n```\n\n### c.\n\nc. Using Redis or KeyDB caching\n\nBesides using Redis server caching for Matomo QueuedTracking plugin, we can optionally also enable Redis or KeyDB server caching for Matomo itself https://matomo.org/faq/how-to/faq_20511/. The documentation recommends using a separate Redis server instance from the above QueuedTracking plugin's defined Redis server instance.\n\nFor Redis server which Centmin Mod LEMP stack installs by default - changing database number to desired database i.e. `0` and Redis server listening on `127.0.0.1` on port `6379` with empty Redis server password added to `/home/nginx/domains/u.domain.com/public/config/config.ini.php`:\n\n```\n[Cache]\nbackend = chained\n\n[ChainedCache]\nbackends[] = array\nbackends[] = redis\n\n[RedisCache]\nhost = \"127.0.0.1\" \nport = 6379\ntimeout = 1.5\npassword = \"\"\ndatabase = 0\n```\n\nHowever, as documentation recommends a separate Redis server instance, I opted to install faster performance fork [KeyDB](https://docs.keydb.dev/) server caching that I benchmarked - [redis vs keydb vs dragonfly](https://github.com/centminmod/redis-comparison-benchmarks). The KeyDB server installed defaults to listening on `127.0.0.1` on port `7379` but switched it to run on a Unix socket `/run/keydb/keydb.sock`. While AlmaLinux/Rocky Rocky EL8/E9 have KeyDB YUM package in EPEL release YUM repo, it will conflict with Redis installed YUM repo package so you can only choose either Redis or KeyDB usually. So I decided to custom compile KeyDB server so it can run side by side with default Redis server and adhere to Matomo's recommendations for separate caching server instances. \n\nSame backend defined as chained with `array` and `redis` backend as KeyDB is a Redis fork. And defined a KeyDB Unix socket file configuration added to `/home/nginx/domains/u.domain.com/public/config/config.ini.php`\n\n```\n[ChainedCache]\nbackends[] = \"array\"\nbackends[] = \"redis\"\n\n[RedisCache]\nport =  0\ndatabase = 0\nunix_socket = \"/run/keydb/keydb.sock\"\ntimeout = \"1.5\"\npassword = \"\"\n```\n\nphpredisadmin screenshot for Matomo Analytics using Redis caching for QueuedTracking plugin and KeyDB caching for Matomo.\n\n![Matomo Redis \u0026 KeyDB Caching](screenshots/matomo-phpredisadmin-redis-keydb-unix-socket-01.png)\n\nCentmin Mod on AlmaLinux 9 - Redis\n\n```\nredis-cli -p 6379 info server\n\n# Server\nredis_version:7.2.5\nredis_git_sha1:00000000\nredis_git_dirty:0\nredis_build_id:ce975a21d248780e\nredis_mode:standalone\nos:Linux 5.14.0-427.24.1.el9_4.x86_64 x86_64\narch_bits:64\nmonotonic_clock:POSIX clock_gettime\nmultiplexing_api:epoll\natomicvar_api:c11-builtin\ngcc_version:11.4.1\nprocess_id:1386161\nprocess_supervised:systemd\nrun_id:f04275bf0d30f80a3c3d664368b7a78f299e2725\ntcp_port:6379\nserver_time_usec:1723059314485440\nuptime_in_seconds:23992\nuptime_in_days:0\nhz:10\nconfigured_hz:10\nlru_clock:11783282\nexecutable:/usr/bin/redis-server\nconfig_file:/etc/redis/redis.conf\nio_threads_active:0\nlistener0:name=tcp,bind=127.0.0.1,bind=-::1,port=6379\n```\n\nCentmin Mod on AlmaLinux 9 - KeyDB\n\n```\nkeydb-cli -s /run/keydb/keydb.sock info server\n\n# Server\nredis_version:6.3.4\nredis_git_sha1:7e7e5e57\nredis_git_dirty:1\nredis_build_id:e44e2f4345dcaa88\nredis_mode:standalone\nos:Linux 5.14.0-427.24.1.el9_4.x86_64 x86_64\narch_bits:64\nmultiplexing_api:epoll\natomicvar_api:atomic-builtin\ngcc_version:12.2.1\nprocess_id:1399023\nprocess_supervised:systemd\nrun_id:224c3c6aad5292b5cba9924dee0aef392c6f9f60\ntcp_port:0\nserver_time_usec:1723059301661507\nuptime_in_seconds:2376\nuptime_in_days:0\nhz:10\nconfigured_hz:10\nlru_clock:11783269\nexecutable:/usr/local/bin/keydb-server\nconfig_file:/etc/keydb/keydb.conf\navailability_zone:\nfeatures:cluster_mget\n```\n\n## Matomo Notes\n\n10. Matomo Notes\n\nAs Matomo is installed on Nginx, some of the administration (`Diagnostic -\u003e Systems Check`) settings report incorrectly that certain directories or files which are mean to be private are publicly accessible. But these directories and files are already handled by above Nginx vhost's Matomo Nginx rules to deny access.\n\nRequired Private Directories that are incorrectly reported as publicly available but are infact 403 permission denied using above Matomo Nginx rules.\n\n```\nhttps://u.domain.com/config/config.ini.php\nhttps://u.domain.com/tmp/cache/tracker/matomocache_general.php\nhttps://u.domain.com/tmp/\nhttps://u.domain.com/tmp/empty\nhttps://u.domain.com/lang/en.json\n```\n\nAnd file integrity resports Centmin Mod's default Nginx vhost files which should be left available. At least `maintenance.html` should be left available to support Centmin Mod's 503 maintenance mode feature.\n\n```\nFiles were found in your Matomo, but we didn't expect them.\n--\u003e Please delete these files to prevent errors. \u003c--\n\nFile to delete: 401.html\nFile to delete: 403.html\nFile to delete: 404.html\nFile to delete: 500.html\nFile to delete: 502.html\nFile to delete: 503.html\nFile to delete: 503.jpg\nFile to delete: 504.html\nFile to delete: 50x.html\nFile to delete: index.html\nFile to delete: maintenance.html\n```\n\nSeems Matomo 5.1.0 isn't fully compatible with PHP 8.3 or at least a Matomo Plugin I installed isn't PHP 8.3 compatible. Seems to be related to Performance Audit Plugin compatibility https://github.com/matomo-org/matomo/issues/21775. The irony given what the plugin is meant for :) So will need to downgrade back to PHP 8.0.33 if I intend to use Performance Audit Plugin or deactive the plugin to use PHP 8.3.\n\n```\n/home/nginx/domains/u.domain.com/public/console queuedtracking:monitor                                             \nERROR     [2024-08-05 09:53:01] 911986  Uncaught exception: TypeError: Symfony\\Component\\Console\\Application::has(): Argument #1 ($name) must be of type string, null given, called in /home/nginx/domains/u.domain.com/public/core/Console.php on line 180 and defined in /home/nginx/domains/u.domain.com/public/vendor/symfony/console/Application.php:592\nStack trace:\n#0 /home/nginx/domains/u.domain.com/public/core/Console.php(180): Symfony\\Component\\Console\\Application-\u003ehas()\n#1 /home/nginx/domains/u.domain.com/public/core/Console.php(138): Piwik\\Console-\u003eaddCommandIfExists()\n#2 /home/nginx/domains/u.domain.com/public/core/Console.php(92): Piwik\\Console-\u003edoRunImpl()\n#3 /home/nginx/domains/u.domain.com/public/vendor/symfony/console/Application.php(171): Piwik\\Console-\u003edoRun()\n#4 /home/nginx/domains/u.domain.com/public/console(32): Symfony\\Component\\Console\\Application-\u003erun()\n#5 {main}\nUncaught exception in /home/nginx/domains/u.domain.com/public/vendor/symfony/console/Application.php line 592:\nSymfony\\Component\\Console\\Application::has(): Argument #1 ($name) must be of type string, null given, called in /home/nginx/domains/u.domain.com/public/core/Console.php on line 180\n```\n\nMatomo system summary\n\n```\nMatomo version: 5.1.0\nMySQL version: 10.11.8-MariaDB\nPHP version: 8.3.10\n```\n\n## Matomo Console\n\n11. Matomo Console\n\nMatomo console options outlined at https://developer.matomo.org/guides/piwik-on-the-command-line\n\n```\n/home/nginx/domains/u.domain.com/public/console list\n\nMatomo 5.1.0\n\nUsage:\n  command [options] [arguments]\n\nOptions:\n  -h, --help                           Display help for the given command. When no command is given display help for the list command\n  -q, --quiet                          Do not output any message\n  -V, --version                        Display this application version\n      --ansi|--no-ansi                 Force (or disable --no-ansi) ANSI output\n  -n, --no-interaction                 Do not ask any interactive question\n      --matomo-domain[=MATOMO-DOMAIN]  Matomo URL (protocol and domain) eg. \"http://matomo.example.org\"\n      --xhprof                         Enable profiling with XHProf\n      --ignore-warn                    Return 0 exit code even if there are warning logs or error logs detected in the command output.\n  -v|vv|vvv, --verbose                 Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug\n\nAvailable commands:\n  completion                                     Dump the shell completion script\n  help                                           Display help for a command\n  list                                           List commands\n bottracker\n  bottracker:add-bot                             Add new bot.\n  bottracker:add-bot-type                        Add new bot type.\n  bottracker:add-default-bots                    Add default bots.\n  bottracker:delete-bot                          Deletes a bot.\n  bottracker:list-bot-types                      List bot types added.\n  bottracker:list-bots                           List bots for site id.\n climulti\n  climulti:request                               Parses and executes the given query. See Piwik\\CliMulti. Intended only for system usage.\n config\n  config:delete                                  Delete a config setting\n  config:get                                     Get a config value or section\n  config:set                                     Set one or more config settings in the file config/config.ini.php\n core\n  core:archive                                   Runs the CLI archiver. It is an important tool for general maintenance and to keep Piwik very fast.\n  core:calculate-conversion-pages                Calculate the pages before metric for historic conversions\n  core:clear-caches                              [cache:clear] Clears all caches. This command can be useful for instance after updating Matomo files manually.\n  core:create-security-files                     Creates some web server security files if they haven't existed previously. Useful when using for example Apache or IIS web server and Matomo cannot create these files automatically because of missing write permissions.\n  core:delete-logs-data                          Delete data from the user log tables: log_visit, log_link_visit_action, log_conversion, log_conversion_item, log_action.\n  core:fix-duplicate-log-actions                 Removes duplicates in the log action table and fixes references to the duplicates in related tables. NOTE: This action can take a long time to run!\n  core:invalidate-report-data                    Invalidate archived report data by date range, site and period.\n  core:matomo4-migrate-token-auths               Only needed for the matomo 3 to matomo 4 migration\n  core:purge-old-archive-data                    Purges out of date and invalid archive data from archive tables.\n  core:test-email                                Send a test email\n  core:update                                    Triggers upgrades. Use it after Matomo core or any plugin files have been updated. Append --yes to upgrade without confirmation.\n  core:version                                   Returns the current version information of this Matomo instance.\n custom-piwik-js\n  custom-piwik-js:update                         [custom-matomo-js:update] Update the Javascript Tracker with plugin tracker additions\n customdimensions\n  customdimensions:add-custom-dimension          Add new Custom Dimension available.\n  customdimensions:info                          Get information about currently installed Custom Dimensions\n  customdimensions:remove-custom-dimension       Removes an existing Custom Dimension\n database\n  database:optimize-archive-tables               Runs an OPTIMIZE TABLE query on the specified archive tables.\n development\n  development:enable                             [development:disable] Enable or disable development mode. See config/global.ini.php in section [Development] for more information\n device-detector-cache\n  device-detector-cache:warm-cache               Cached device detector information based on access log\n diagnostics\n  diagnostics:analyze-archive-table              Analyze an archive table and display human readable information about what is stored. This command can be used to diagnose issues like bloated archive tables.\n  diagnostics:archiving-config                   Show configuration settings that can affect archiving performance\n  diagnostics:archiving-instance-statistics      Show data statistics which can affect archiving performance\n  diagnostics:archiving-metrics                  Show metrics describing the current archiving status\n  diagnostics:archiving-queue                    Show the current state of the archive invalidations queue as a table\n  diagnostics:archiving-status                   \n  diagnostics:run                                Run diagnostics to check that Piwik is installed and runs correctly\n  diagnostics:unexpected-files                   Show a list of unexpected files found in the Matomo installation directory and optionally delete them.\n googleanalyticsimporter\n  googleanalyticsimporter:archive-imported-data  Initiates core:archive for an imported site. This is run automatically every day, but can be run manually if needed. All it really does is call core:archive w/ a few custom parameters so data from years back gets archived.\n  googleanalyticsimporter:import-ga4-reports     Import GA4 reports from one or more google analytics properties into Matomo sites.\n  googleanalyticsimporter:import-reports         Import reports from one or more google analytics properties into Matomo sites.\n log\n  log:watch                                      Outputs the last parts of the log files and follows as the log file grows. Does not work on Windows\n login\n  login:unblock-blocked-ips                      Unblocks all currently blocked IPs. Useful if you cannot log in to your Matomo anymore because your own IP is blocked\n marketplace\n  marketplace:set-license-key                    Sets a marketplace license key\n plugin\n  plugin:activate                                Activate a plugin.\n  plugin:deactivate                              Deactivate a plugin.\n  plugin:list                                    List installed plugins.\n  plugin:uninstall                               Uninstall a plugin.\n privacymanager\n  privacymanager:anonymize-some-raw-data         Anonymize some of the stored raw data (logs). The reason it only anonymizes \"some\" data is that personal data can be present in many various data collection points, for example some of your page URLs or page titles may include personal data and these will not be anonymized by this command as it is not possible to detect personal data for example in a URL automatically.\n queuedtracking\n  queuedtracking:lock-status                     Outputs information for the status of each locked queue. Unlocking a queue is possible as well.\n  queuedtracking:monitor                         Shows and updates the current state of the queue every 2 seconds.\n  queuedtracking:print-queued-requests           Prints the requests of each queue that will be processed next.\n  queuedtracking:process                         Processes all queued tracking requests in case there are enough requests in the queue and in case they are not already in process by another script. To keep track of the queue use the --verbose option or execute the queuedtracking:monitor command.\n  queuedtracking:test                            Test your Redis connection get some information about your current system.\n scheduled-tasks\n  scheduled-tasks:run                            [core:run-scheduled-tasks] Will run all scheduled tasks due to run at this time.\n twofactorauth\n  twofactorauth:disable-2fa-for-user             Disable two-factor authentication for a user. Useful if a user loses the device that was used for two-factor authentication. After it was disabled, the user will be able to set it up again.\n usercountry\n  usercountry:attribute                          Re-attribute existing raw data (visits \u0026 conversions) with geolocated location data, using the specified or configured location provider.\n  usercountry:convert-region-codes               Convert FIPS region codes saved by GeoIP legacy provider to ISO.\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcentminmod%2Fcentminmod-matomo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcentminmod%2Fcentminmod-matomo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcentminmod%2Fcentminmod-matomo/lists"}