访问马托莫
- 打开您的网络浏览器并导航至:
http://<SERVER-IP> - 按照 Matomo Web 安装向导完成安装。
重要文件和目录
- 网络根:
/var/www/matomo(拥有者www-data:www-data) - 阿帕奇配置:
/etc/apache2/sites-available/matomo.conf - 日志:
/var/log/apache2/matomo_error.log&/var/log/apache2/matomo_access.log - 数据库凭证:
/root/.cloudzy-creds
数据库设置
在设置过程中,从生成的文件中输入以下凭据 (/root/.cloudzy-creds):
- 数据库服务器:
127.0.0.1 - 登录:
matomo - 密码:随机生成
- 数据库名称:
matomo
阿帕奇管理
使用 systemd 命令管理 Apache 服务:
systemctl status apache2
systemctl restart apache2
systemctl stop apache2
systemctl start apache2
为域启用 SSL
1. 将您的域名指向服务器IP。
2.编辑Apache配置并替换 ServerName <IP> 与您的域名(ServerName <your-domain>):
vim /etc/apache2/sites-available/matomo.conf
3.安装Certbot:
apt install -y certbot python3-certbot-apache
4. 运行以下命令生成有效的 Lets Encrypt 证书:
certbot --apache --non-interactive --agree-tos --email [email protected] -d yourdomain.com
5. 重新启动 Apache 以应用更改:
systemctl restart apache2
6. 编辑 Matomo 配置文件(/var/www/matomo/config/config.ini.php)并更新 trusted_hosts 设置下 [General] 包含您的域名而不是 IP:
[General]
trusted_hosts[] = "yourdomain.com"
7. 打开浏览器并访问: https://yourdomain.com