Matomo
Matomo
一、安装
官方文档: Matomo On-Premise (self-hosted)Requirements for Matomo On-Premise
1.1 安装必要依赖
$ sudo apt-get install php php-curl php-gd php-cli mysql-server php-mysql php-xml php-mbstring
1.2 PHP建议开启shell_exec
相关文档How to make the diagnostic “Managing processes via CLI” to display Ok?
# 查看是否开启shell_exec,应该返回Ture
php -r "var_dump(function_exists('shell_exec'));"
1.3 MySQL 配置
-- 创建matomo数据库
$ mysql> CREATE DATABASE matomo_db_name_here;
-- 创建用户 MySQL 5.7及以上
$ mysql> CREATE USER 'matomo'@'localhost' IDENTIFIED WITH mysql_native_password BY 'my-strong-password-here';
-- 创建用户 MySQL 5.7以下
$ mysql> CREATE USER 'matomo'@'localhost' IDENTIFIED BY 'my-strong-password-here';
-- 授权
$ mysql> GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, INDEX, DROP, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES ON matomo_db_name_here.* TO 'matomo'@'localhost';
-- 授权(可选)让用户可以用文件操作[aa](https://matomo.org/faq/troubleshooting/faq_194/)
$ mysql> GRANT FILE ON *.* TO 'matomo'@'localhost';
1.4 Apache Https配置
1.5 安装 matomo
wget https://builds.matomo.org/matomo.zip
cd /var/www/html
sudo unzip ~/matomo.zip
sudo mv matomo/* ./
sudo chown -R www-data:www-data html/