matmoto实现网站前端埋点

原创
2022/03/17 15:30
阅读数 789

【基础环境】
https://github.com/matomo-org/
step1:配置php环境
本例使用,PHP 7.2.34
#rpm  -Uvh   https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
#rpm  -Uvh   https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
#yum  -y  install  php72w-cli  php72w-common  php72w-devel php-mysqli php72w-fpm php72w php72w-cli php72w-fpm php72w-curl php72w-gd php72w-mysql php72w-xml php72w-mbstring
#yum  install  yum-utils –y
检查是否安装成功

# php --version
PHP 7.2.34 (cli) (built: Oct  1 2020 13:37:37) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies

设置服务开机自动启动并启动服务
# sudo systemctl start php-fpm.service
# sudo systemctl enable php-fpm.service
创建服务运行账号和组
#useradd -r -g nginx nginx
配置PHP 的服务运行账号和组
#vim /etc/php-fpm.d/www.conf

#systemctl restart php-fpm.service

#service php-fpm restart

step2:配置nginx支持解析php
本例使用openresty-1.19.9.1
详见(part2):
https://my.oschina.net/guiguketang/blog/1834285
step3:配置mysql
Server version: 5.5.68-MariaDB
详见:
https://my.oschina.net/guiguketang/blog/3047025
step4:下载安装包安装
1、下载
#wget https://builds.matomo.org/matomo.zip
#unzip matomo.zip
2、配置nginx

server {
        listen       80 default_server;
        server_name  matomo.xxx.cn **.**.8.26;
        root         /web/project/matomo;
        include      fastcgi.conf;
        location / {
                try_files $uri /index.php$is_args$args;
        }

        location ~ \.php$ {
              #  try_files $uri =404;
                include fastcgi_params;
                fastcgi_pass 127.0.0.1:9000;
                fastcgi_index index.php;
                fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        }
 }

3、配置生效
#sbin/nginx -s reload


【参考网址】
https://matomo.org/docs/installation/
https://github.com/matomo-org/

 

 

 

展开阅读全文
加载中
点击引领话题📣 发布并加入讨论🔥
打赏
0 评论
0 收藏
0
分享
返回顶部
顶部